4#ifndef _be7f134a_58de_4d2c_9052_d40da0b2c01d
5#define _be7f134a_58de_4d2c_9052_d40da0b2c01d
10#include <MrMeasSrv/MeasUtils/NLSStatus.h>
11#include <MrMeasSrv/SeqIF/Sequence/sequmsg.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>
30class IteratorTemplate:
public Node
42 template<
typename Child>
44 std::string
const & key, Child
const &
child,
52 std::string
const & key,
Siblings const & siblings,
58 virtual ~IteratorTemplate() =
default;
62 MrProt & protocol, SeqLim & limits, SeqExpo & exports)
override
64 this->_iterator().reset();
70 MrProt & protocol, SeqLim & limits, SeqExpo & exports)
override
72 this->_iterator().reset();
73 while(!this->_iterator().done())
78 return MRI_SEQ_SEQU_NORMAL;
84 this->_iterator().reset();
101 MrProtocolData::SeqExpoRFInfo
rfInfo()
const override
106 rfInfo *= this->_iterator().end();
119 template<
typename Child>
121 std::string
const & key, Child
const &
child,
129 std::string
const & key,
Siblings const & siblings,
136 IteratorTemplate(IteratorTemplate<T>
const &) =
default;
137 IteratorTemplate(IteratorTemplate<T> &&) =
default;
138 IteratorTemplate & operator=(IteratorTemplate<T>
const &) =
default;
139 IteratorTemplate & operator=(IteratorTemplate<T> &&) =
default;
141 T
const & _iterator()
const
143 return this->
get<T>(this->_key);
148 return this->
get<T>(this->_key);
Generic key-value associative container.
Definition Dictionary.h:21
std::shared_ptr< Dictionary > Pointer
Reference-counted pointer to Dictionary.
Definition Dictionary.h:34
Dictionary::ConstPointer registry() const
Return the registry.
T const & get(std::string const &key) const
Return an object from the dictionary.
Definition AbstractNode.h:68
Node encapsulating an msl::Iterator.
Definition Iterator.h:31
static Pointer New(std::string const &key, Siblings const &siblings, Dictionary::Pointer registry={})
Definition Iterator.h:51
NLSStatus run(MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
Definition Iterator.h:69
void reset() override
Definition Iterator.h:82
uint64_t duration() const override
Definition Iterator.h:92
NLSStatus prepare(MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
Definition Iterator.h:61
MrProtocolData::SeqExpoRFInfo rfInfo() const override
Definition Iterator.h:101
static Pointer New(std::string const &key, Dictionary::Pointer registry={})
Definition Iterator.h:36
static Pointer New(std::string const &key, Child const &child, Dictionary::Pointer registry={})
Definition Iterator.h:43
std::shared_ptr< IteratorTemplate< T > > Pointer
Definition Iterator.h:33
void reset() override
Reset children to a default state.
std::vector< AbstractNode::Pointer > Siblings
Child container.
Definition Node.h:33
NLSStatus prepare(MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
Prepare all children in order.
Node(Dictionary::Pointer registry={})
Create a node with no child.
MrProtocolData::SeqExpoRFInfo rfInfo() const override
Return the sum of the RF information of the children.
AbstractNode::ConstPointer child(std::size_t index) const
Return a child at given position.
uint64_t duration() const override
Return the sum of the duration of the children.
NLSStatus run(MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
Run all children in order.
#define DECLARE_POINTERS(name)
Declare pointer type aliases.
Definition helpers.h:83
#define ON_ERROR_RETURN_STATUS(S)
Execute statement S, and, if not MRRESULT_SUCCESS, return the status.
Definition helpers.h:26
Graph-related objects and functions.
Definition AbstractNode.h:24
IteratorTemplate< msl::ConstIterator< T > > ConstIterator
Const iterator node.
Definition Iterator.h:154
IteratorTemplate< msl::Iterator< T > > Iterator
Non-const iterator node.
Definition Iterator.h:158
Top-level namespace of the msl library.
Definition acceleration.h:17