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

Container node, prepare and run its children sequentially. More...

#include <Node.h>

Inheritance diagram for msl::graph::Node:
msl::graph::AbstractNode msl::graph::IteratorTemplate< msl::ConstIterator< T > > msl::graph::IteratorTemplate< msl::Iterator< T > > msl::graph::If msl::graph::IteratorTemplate< T > msl::graph::Loop

Public Types

using Siblings = std::vector<AbstractNode::Pointer>
 

Public Member Functions

 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 (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.
 

Protected Member Functions

 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

Siblings _children
 
- Protected Attributes inherited from msl::graph::AbstractNode
Dictionary::Pointer _registry
 

Detailed Description

Container node, prepare and run its children sequentially.

Member Typedef Documentation

◆ Siblings

using msl::graph::Node::Siblings = std::vector<AbstractNode::Pointer>

Constructor & Destructor Documentation

◆ ~Node()

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

◆ Node() [1/5]

msl::graph::Node::Node ( Dictionary::Pointer registry = {})
protected

◆ Node() [2/5]

template<typename T>
msl::graph::Node::Node ( T const & child,
Dictionary::Pointer registry = {} )
inlineprotected

◆ Node() [3/5]

msl::graph::Node::Node ( Siblings const & siblings,
Dictionary::Pointer registry = {} )
protected

◆ Node() [4/5]

msl::graph::Node::Node ( Node const & )
protecteddefault

◆ Node() [5/5]

msl::graph::Node::Node ( Node && )
protecteddefault

Member Function Documentation

◆ DECLARE_POINTERS()

msl::graph::Node::DECLARE_POINTERS ( Node )

◆ New() [1/3]

static Pointer msl::graph::Node::New ( Dictionary::Pointer registry = {})
static

Create a node with no child.

◆ New() [2/3]

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

Create a node with a single child.

◆ New() [3/3]

static Pointer msl::graph::Node::New ( Siblings const & siblings,
Dictionary::Pointer registry = {} )
static

Create a node with multiple children.

◆ prepare()

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

Prepare all children in order.

Implements msl::graph::AbstractNode.

◆ run()

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

Run all children in order.

Implements msl::graph::AbstractNode.

◆ setRegistry()

Node & msl::graph::Node::setRegistry ( Dictionary::Pointer registry)
overridevirtual

Set the registry to this node and its children.

Reimplemented from msl::graph::AbstractNode.

◆ duration()

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

Return the sum of the duration of the children.

Implements msl::graph::AbstractNode.

◆ rfInfo()

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

Return the sum of the RF information of the children.

Implements msl::graph::AbstractNode.

◆ empty()

bool msl::graph::Node::empty ( ) const

Check whether this node has children.

◆ size()

std::size_t msl::graph::Node::size ( ) const

Return the number of children.

◆ appendChild()

template<typename T>
T & msl::graph::Node::appendChild ( std::shared_ptr< T > const & child)
inline

Append a child in last position, return the child.

◆ deleteChild()

Node & msl::graph::Node::deleteChild ( std::size_t index)

Remove a child.

◆ clearChildren()

Node & msl::graph::Node::clearChildren ( )

Remove all children.

◆ child() [1/2]

AbstractNode::ConstPointer msl::graph::Node::child ( std::size_t index) const

Return a child at given position.

Attention
No bound control is performed.

◆ child() [2/2]

AbstractNode::Pointer msl::graph::Node::child ( std::size_t index)

Return a child at given position.

Attention
No bound control is performed.

◆ operator=() [1/2]

Node & msl::graph::Node::operator= ( Node const & )
protecteddefault

◆ operator=() [2/2]

Node & msl::graph::Node::operator= ( Node && )
protecteddefault

Member Data Documentation

◆ _children

Siblings msl::graph::Node::_children
protected

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