msl 1.1.0
 
Loading...
Searching...
No Matches
msl::graph::If Class Reference

Node running its children based on a boolean key or a function key. More...

#include <If.h>

Inheritance diagram for msl::graph::If:
msl::graph::Node msl::graph::AbstractNode

Public Types

using Function
 
- Public Types inherited from msl::graph::Node
using Siblings = std::vector<AbstractNode::Pointer>
 

Public Member Functions

 DECLARE_POINTERS (If)
 
virtual ~If ()=default
 
NLSStatus prepare (MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
 Prepare the children if the boolean is true.
 
NLSStatus run (MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
 Run the children if the boolean is true.
 
uint64_t duration () const override
 Return the sum of the duration of the children if the boolean is true, 0 otherwise.
 
MrProtocolData::SeqExpoRFInfo rfInfo () const override
 Return the sum of the RF information of the children if the boolean is true, empty RF information otherwise.
 
- Public Member Functions inherited from msl::graph::Node
 DECLARE_POINTERS (Node)
 
virtual ~Node ()=default
 
NLSStatus prepare (MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
 Prepare all children in order.
 
NLSStatus run (MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
 Run all children in order.
 
NodesetRegistry (Dictionary::Pointer registry) override
 Set the registry to this node and its children.
 
uint64_t duration () const override
 Return the sum of the duration of the children.
 
MrProtocolData::SeqExpoRFInfo rfInfo () const override
 Return the sum of the RF information of the children.
 
bool empty () const
 Check whether this node has children.
 
std::size_t size () const
 Return the number of children.
 
template<typename T>
T & appendChild (std::shared_ptr< T > const &child)
 Append a child in last position, return the child.
 
NodedeleteChild (std::size_t index)
 Remove a child.
 
NodeclearChildren ()
 Remove all children.
 
AbstractNode::ConstPointer child (std::size_t index) const
 Return a child at given position.
 
AbstractNode::Pointer child (std::size_t index)
 Return a child at given position.
 
- Public Member Functions inherited from msl::graph::AbstractNode
 DECLARE_POINTERS (AbstractNode)
 
virtual ~AbstractNode ()=default
 
Dictionary::ConstPointer registry () const
 Return the registry.
 
Dictionary::Pointer registry ()
 Return the registry.
 
template<typename T>
T const & get (std::string const &key) const
 Return an object from the dictionary.
 
template<typename T>
T & get (std::string const &key)
 Return an object from the dictionary.
 
boost::typeindex::type_info const & type (std::string const &key) const
 Return the type of an object in the dictionary.
 

Static Public Member Functions

static Pointer New (std::string const &key, Dictionary::Pointer registry={})
 Create an If node without children.
 
template<typename T>
static Pointer New (std::string const &key, T const &child, Dictionary::Pointer registry={})
 Create an If node with a single child.
 
static Pointer New (std::string const &key, Siblings const &siblings, Dictionary::Pointer registry={})
 Create an If node with multiple children.
 
- Static Public Member Functions inherited from msl::graph::Node
static Pointer New (Dictionary::Pointer registry={})
 Create a node with no child.
 
template<typename T>
static Pointer New (T const &child, Dictionary::Pointer registry={})
 Create a node with a single child.
 
static Pointer New (Siblings const &siblings, Dictionary::Pointer registry={})
 Create a node with multiple children.
 

Additional Inherited Members

- Protected Member Functions inherited from msl::graph::Node
 Node (Dictionary::Pointer registry={})
 
template<typename T>
 Node (T const &child, Dictionary::Pointer registry={})
 
 Node (Siblings const &siblings, Dictionary::Pointer registry={})
 
 Node (Node const &)=default
 
 Node (Node &&)=default
 
Nodeoperator= (Node const &)=default
 
Nodeoperator= (Node &&)=default
 
- Protected Member Functions inherited from msl::graph::AbstractNode
 AbstractNode (Dictionary::Pointer registry={})
 
 AbstractNode (AbstractNode const &)=default
 
 AbstractNode (AbstractNode &&)=default
 
AbstractNodeoperator= (AbstractNode const &)=default
 
AbstractNodeoperator= (AbstractNode &&)=default
 
- Protected Attributes inherited from msl::graph::Node
Siblings _children
 
- Protected Attributes inherited from msl::graph::AbstractNode
Dictionary::Pointer _registry
 

Detailed Description

Node running its children based on a boolean key or a function key.

Member Typedef Documentation

◆ Function

Initial value:
boost::variant<
std::function<bool()>,
std::function<bool(MrProt &)>,
std::function<bool(MrProt &, SeqLim &, SeqExpo &)>>

Constructor & Destructor Documentation

◆ ~If()

virtual msl::graph::If::~If ( )
virtualdefault

Member Function Documentation

◆ DECLARE_POINTERS()

msl::graph::If::DECLARE_POINTERS ( If )

◆ New() [1/3]

static Pointer msl::graph::If::New ( std::string const & key,
Dictionary::Pointer registry = {} )
static

Create an If node without children.

◆ New() [2/3]

template<typename T>
static Pointer msl::graph::If::New ( std::string const & key,
T const & child,
Dictionary::Pointer registry = {} )
inlinestatic

Create an If node with a single child.

◆ New() [3/3]

static Pointer msl::graph::If::New ( std::string const & key,
Siblings const & siblings,
Dictionary::Pointer registry = {} )
static

Create an If node with multiple children.

◆ prepare()

NLSStatus msl::graph::If::prepare ( MrProt & protocol,
SeqLim & limits,
SeqExpo & exports )
overridevirtual

Prepare the children if the boolean is true.

Implements msl::graph::AbstractNode.

◆ run()

NLSStatus msl::graph::If::run ( MrProt & protocol,
SeqLim & limits,
SeqExpo & exports )
overridevirtual

Run the children if the boolean is true.

Implements msl::graph::AbstractNode.

◆ duration()

uint64_t msl::graph::If::duration ( ) const
overridevirtual

Return the sum of the duration of the children if the boolean is true, 0 otherwise.

Warning
The protocol, limits, and exports used in the last call to prepare or run must still be reachable if the condition is given by a function

Implements msl::graph::AbstractNode.

◆ rfInfo()

MrProtocolData::SeqExpoRFInfo msl::graph::If::rfInfo ( ) const
overridevirtual

Return the sum of the RF information of the children if the boolean is true, empty RF information otherwise.

Warning
The protocol, limits, and exports used in the last call to prepare or run must still be reachable if the condition is given by a function

Implements msl::graph::AbstractNode.


The documentation for this class was generated from the following file: