4#ifndef _29882abf_80e7_4434_8f2c_b5109dd75ef7
5#define _29882abf_80e7_4434_8f2c_b5109dd75ef7
10#include <boost/variant/variant.hpp>
12#include <MrMeasSrv/MeasUtils/NLSStatus.h>
13#include <MrMeasSrv/SeqIF/libRT/sSLICE_POS.h>
15#include <MrProtSrv/Domain/CoreNative/SeqLim.h>
16#include <MrProtSrv/Domain/MrProtData/MrProt/MrProt.h>
17#include <MrProtSrv/Domain/MrProtData/MrProt/SeqIF/SeqExpo.h>
18#include <MrProtSrv/Domain/MrProtData/MrProt/SeqIF/SeqExpoRFBlockInfo.h>
36 std::function<bool()>,
37 std::function<bool(MrProt &)>,
38 std::function<bool(MrProt &, SeqLim &, SeqExpo &)>>;
42 std::string
const & key, Dictionary::Pointer
registry={});
47 std::string
const & key, T
const &
child,
55 std::string
const & key,
Siblings const & siblings,
58 virtual ~If() =
default;
62 MrProt & protocol, SeqLim & limits, SeqExpo & exports)
override;
66 MrProt & protocol, SeqLim & limits, SeqExpo & exports)
override;
84 MrProtocolData::SeqExpoRFInfo
rfInfo()
const override;
91 mutable bool _hasCache;
92 mutable MrProt * _protocol;
93 mutable SeqLim * _limits;
94 mutable SeqExpo * _exports;
96 If(std::string
const & key, Dictionary::Pointer
registry={});
100 std::string
const & key, T
const &
child,
108 std::string
const & key,
Siblings const & siblings,
111 If(If
const &) =
default;
113 If & operator=(If
const &) =
default;
114 If & operator=(If &&) =
default;
116 bool _condition()
const;
117 bool _condition(MrProt & protocol, SeqLim & limits, SeqExpo & exports)
const;
Dictionary::ConstPointer registry() const
Return the registry.
Node running its children based on a boolean key or a function key.
Definition If.h:30
NLSStatus run(MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
Run the children if the boolean is true.
static Pointer New(std::string const &key, Siblings const &siblings, Dictionary::Pointer registry={})
Create an If node with multiple children.
static Pointer New(std::string const &key, T const &child, Dictionary::Pointer registry={})
Create an If node with a single child.
Definition If.h:46
uint64_t duration() const override
Return the sum of the duration of the children if the boolean is true, 0 otherwise.
boost::variant< std::function< bool()>, std::function< bool(MrProt &)>, std::function< bool(MrProt &, SeqLim &, SeqExpo &)> > Function
Definition If.h:35
static Pointer New(std::string const &key, Dictionary::Pointer registry={})
Create an If node without children.
MrProtocolData::SeqExpoRFInfo rfInfo() const override
Return the sum of the RF information of the children if the boolean is true, empty RF information oth...
NLSStatus prepare(MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
Prepare the children if the boolean is true.
std::vector< AbstractNode::Pointer > Siblings
Definition Node.h:32
Node(Dictionary::Pointer registry={})
AbstractNode::ConstPointer child(std::size_t index) const
Return a child at given position.
Definition AbstractNode.h:23
Definition acceleration.h:17