msl 1.3.0
Loading...
Searching...
No Matches
msl::graph::Case< T > Class Template Reference

Detailed Description

template<typename T>
class msl::graph::Case< T >

Node encapsulating a switch/case structure based on a boolean key or a function key.

#include <Case.h>

Public Types

using Map = std::unordered_map< T, AbstractNode::Pointer >
 Dictionary to dispatch key to function.
 
using Function = FlexibleFunction< T >
 Case function.
 
using Pointer = std::shared_ptr< Case< T > >
 Reference-counted pointer to Case<T>

 
using ConstPointer = std::shared_ptr< Case< T > const >
 Reference-counted constant pointer to Case<T>

 
- 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
 Prepare the selected child, throw an exception if unknown value.
 
NLSStatus run (MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
 Run the selected child, throw an exception if unknown value.
 
CasesetRegistry (Dictionary::Pointer registry) override
 Set the registry to this node and its children.
 
uint64_t duration () const override
 Return the duration of the selected child, throw an exception if unknown value.
 
MrProtocolData::SeqExpoRFInfo rfInfo () const override
 Return the RF information of the selected child, throw an exception if unknown value.
 
- Public Member Functions inherited from msl::graph::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, Map const &cases, Dictionary::Pointer registry={})
 Create a case node pointing to a key in the registry.
 

Member Typedef Documentation

◆ Map

template<typename T >
using msl::graph::Case< T >::Map = std::unordered_map<T, AbstractNode::Pointer>

Dictionary to dispatch key to function.

◆ Function

template<typename T >
using msl::graph::Case< T >::Function = FlexibleFunction<T>

Case function.

◆ Pointer

template<typename T >
using msl::graph::Case< T >::Pointer = std::shared_ptr< Case<T> >

Reference-counted pointer to Case<T>

◆ ConstPointer

template<typename T >
using msl::graph::Case< T >::ConstPointer = std::shared_ptr< Case<T> const>

Reference-counted constant pointer to Case<T>

Member Function Documentation

◆ New()

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

Create a case node pointing to a key in the registry.

◆ prepare()

template<typename T >
NLSStatus msl::graph::Case< T >::prepare ( MrProt &  protocol,
SeqLim &  limits,
SeqExpo &  exports 
)
inlineoverridevirtual

Prepare the selected child, throw an exception if unknown value.

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.

◆ run()

template<typename T >
NLSStatus msl::graph::Case< T >::run ( MrProt &  protocol,
SeqLim &  limits,
SeqExpo &  exports 
)
inlineoverridevirtual

Run the selected child, throw an exception if unknown value.

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.

◆ setRegistry()

template<typename T >
Case & msl::graph::Case< T >::setRegistry ( Dictionary::Pointer  registry)
inlineoverridevirtual

Set the registry to this node and its children.

Reimplemented from msl::graph::AbstractNode.

◆ duration()

template<typename T >
uint64_t msl::graph::Case< T >::duration ( ) const
inlineoverridevirtual

Return the duration of the selected child, throw an exception if unknown value.

Implements msl::graph::AbstractNode.

◆ rfInfo()

template<typename T >
MrProtocolData::SeqExpoRFInfo msl::graph::Case< T >::rfInfo ( ) const
inlineoverridevirtual

Return the RF information of the selected child, throw an exception if unknown value.

Implements msl::graph::AbstractNode.


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