4#ifndef _29882abf_80e7_4434_8f2c_b5109dd75ef7
5#define _29882abf_80e7_4434_8f2c_b5109dd75ef7
10#include <MrMeasSrv/MeasUtils/NLSStatus.h>
11#include <MrMeasSrv/SeqIF/libRT/sSLICE_POS.h>
13#include <MrProtSrv/Domain/CoreNative/SeqLim.h>
14#include <MrProtSrv/Domain/MrProtData/MrProt/MrProt.h>
15#include <MrProtSrv/Domain/MrProtData/MrProt/SeqIF/SeqExpo.h>
16#include <MrProtSrv/Domain/MrProtData/MrProt/SeqIF/SeqExpoRFBlockInfo.h>
50 std::string
const & key, T
const &
child,
61 std::string
const & key,
Siblings const & siblings,
69 virtual ~If() =
default;
73 MrProt & protocol, SeqLim & limits, SeqExpo & exports)
override;
77 MrProt & protocol, SeqLim & limits, SeqExpo & exports)
override;
95 MrProtocolData::SeqExpoRFInfo
rfInfo()
const override;
104 mutable uint64_t _duration;
105 mutable MrProtocolData::SeqExpoRFInfo _rfInfo;
113 std::string
const & key, T
const &
child,
122 std::string
const & key,
Siblings const & siblings,
129 If(If
const &) =
default;
131 If & operator=(If
const &) =
default;
132 If & operator=(If &&) =
default;
134 bool _condition(MrProt & protocol, SeqLim & limits, SeqExpo & exports)
const;
std::shared_ptr< Dictionary > Pointer
Reference-counted pointer to Dictionary.
Definition Dictionary.h:34
Dictionary::ConstPointer registry() const
Return the registry.
Node running its children based on a boolean key, a function key, or a function stored in the node.
Definition If.h:32
std::shared_ptr< If > Pointer
Reference-counted pointer to If.
Definition If.h:34
NLSStatus run(MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
Run the children if the boolean is true.
static Pointer New(Function const &function, Dictionary::Pointer registry={})
Create an If node without children.
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.
uint64_t duration() const override
Return the sum of the duration of the children if the boolean is true, 0 otherwise.
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...
static Pointer New(Function const &function, Siblings const &siblings, Dictionary::Pointer registry={})
Create an If node with multiple children.
FlexibleFunction< bool > Function
Test function.
Definition If.h:37
NLSStatus prepare(MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
Prepare the children if the boolean is true.
static Pointer New(Function const &function, T const &child, Dictionary::Pointer registry={})
Create an If node with a single child.
std::vector< AbstractNode::Pointer > Siblings
Child container.
Definition Node.h:33
Node(Dictionary::Pointer registry={})
Create a node with no child.
AbstractNode::ConstPointer child(std::size_t index) const
Return a child at given position.
#define DECLARE_POINTERS(name)
Declare pointer type aliases.
Definition helpers.h:83
Graph-related objects and functions.
Definition AbstractNode.h:24
boost::variant< std::function< T()>, std::function< T(Dictionary::Pointer)>, std::function< T(MrProt &)>, std::function< T(MrProt &, Dictionary::Pointer)>, std::function< T(MrProt &, SeqLim &, SeqExpo &)>, std::function< T(MrProt &, SeqLim &, SeqExpo &, Dictionary::Pointer)> > FlexibleFunction
A graph function (e.g. Case or If), with flexible arguments.
Definition FlexibleFunction.h:29
Top-level namespace of the msl library.
Definition acceleration.h:17