msl 1.3.0
Loading...
Searching...
No Matches
msl::graph::Loop Class Reference

Detailed Description

Node encapsulating a loop structure, using a Counter from the registry.

Each child node is prepared once, and run according to the Counter.

#include <Loop.h>

Public Types

using Pointer = std::shared_ptr<Loop>
 Reference-counted pointer to Loop.
using ConstPointer = std::shared_ptr<Loop const>
 Reference-counted constant pointer to Loop.
Public Types inherited from msl::graph::Node
using Pointer = std::shared_ptr<Node>
 Reference-counted pointer to Node.
using ConstPointer = std::shared_ptr<Node const>
 Reference-counted constant pointer to Node.
using Siblings = std::vector<AbstractNode::Pointer>
 Child container.
Public Types inherited from msl::graph::AbstractNode
using Pointer = std::shared_ptr<AbstractNode>
 Reference-counted pointer to AbstractNode.
using ConstPointer = std::shared_ptr<AbstractNode const>
 Reference-counted constant pointer to AbstractNode.

Public Member Functions

NLSStatus prepare (MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
 Reset the counter and prepare the children.
NLSStatus run (MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
 Reset the counter and run the children for each index of the counter.
void reset () override
 Reset the counter and reset its children to a default state.
uint64_t duration () const override
 Return the sum of the duration of the children times the maximum value of the counter.
MrProtocolData::SeqExpoRFInfo rfInfo () const override
 Return the sum of the RF information of the children times the maximum value of the counter.
Public Member Functions inherited from msl::graph::Node
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.
void reset () override
 Reset children to a default state.
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.
void appendChildren (Siblings const &siblings)
 Append children after the last position.
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
Dictionary::ConstPointer registry () const
 Return the registry.
Dictionary::Pointerregistry ()
 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.
template<typename T>
AbstractNodeset (std::string const &key, T &&value)
 Store an object in the dictionary, create it if needed.
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 &counter, Dictionary::Pointer registry={})
 Create a loop with no child.
template<typename T>
static Pointer New (std::string const &counter, T const &child, Dictionary::Pointer registry={})
 Create a loop with a single child.
static Pointer New (std::string const &counter, Siblings const &siblings, Dictionary::Pointer registry={})
 Create a loop 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={})
 Create a node with no child.
template<typename T>
 Node (T const &child, Dictionary::Pointer registry={})
 Create a node with a single child.
 Node (Siblings const &siblings, Dictionary::Pointer registry={})
 Create a node with multiple children.
 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={})
 Create a node with the given registry.
 AbstractNode (AbstractNode const &)=default
 AbstractNode (AbstractNode &&)=default
AbstractNodeoperator= (AbstractNode const &)=default
AbstractNodeoperator= (AbstractNode &&)=default
Protected Attributes inherited from msl::graph::Node
Siblings _children
 Children of this node.
Protected Attributes inherited from msl::graph::AbstractNode
Dictionary::Pointer _registry
 Registry attached to this node.

Member Function Documentation

◆ prepare()

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

Reset the counter and prepare the children.

Implements msl::graph::AbstractNode.

◆ run()

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

Reset the counter and run the children for each index of the counter.

Implements msl::graph::AbstractNode.

◆ reset()

void msl::graph::Loop::reset ( )
overridevirtual

Reset the counter and reset its children to a default state.

Reimplemented from msl::graph::AbstractNode.

◆ duration()

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

Return the sum of the duration of the children times the maximum value of the counter.

Implements msl::graph::AbstractNode.

◆ rfInfo()

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

Return the sum of the RF information of the children times the maximum value of the counter.

Implements msl::graph::AbstractNode.


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