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>
42 template<
typename Child>
44 std::string
const & key, Child
const &
child,
52 std::string
const & key,
Siblings const & siblings,
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;
94 MrProtocolData::SeqExpoRFInfo
rfInfo()
const override
99 rfInfo *= this->_iterator().end();
112 template<
typename Child>
114 std::string
const & key, Child
const &
child,
122 std::string
const & key,
Siblings const & siblings,
124 : Node(siblings,
registry), _key(key)
129 IteratorTemplate(IteratorTemplate<T>
const &) =
default;
130 IteratorTemplate(IteratorTemplate<T> &&) =
default;
131 IteratorTemplate & operator=(IteratorTemplate<T>
const &) =
default;
132 IteratorTemplate & operator=(IteratorTemplate<T> &&) =
default;
134 T
const & _iterator()
const
136 return this->get<T>(this->_key);
141 return this->get<T>(this->_key);
#define DECLARE_POINTERS(name)
Declare pointer type aliases.
Definition Dictionary.h:18
Generic key-value associative container.
Definition Dictionary.h:26
std::shared_ptr< Dictionary > Pointer
Reference-counted pointer to Dictionary
Definition Dictionary.h:39
Dictionary::ConstPointer registry() const
Return the registry.
Node encapsulating an msl::Iterator.
Definition Iterator.h:31
static Pointer New(std::string const &key, Siblings const &siblings, Dictionary::Pointer registry={})
Create an iterator with multiple children.
Definition Iterator.h:51
NLSStatus run(MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
Run the children for each item of the iterator range.
Definition Iterator.h:69
uint64_t duration() const override
Return the sum of the duration of the children times the number of items of the iterator range.
Definition Iterator.h:85
std::shared_ptr< IteratorTemplate< T > > Pointer
Reference-counted pointer to IteratorTemplate<T>
Definition Iterator.h:33
NLSStatus prepare(MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
Prepare the children.
Definition Iterator.h:61
virtual ~IteratorTemplate()=default
MrProtocolData::SeqExpoRFInfo rfInfo() const override
Return the sum of the RF information of the children times the number of items of the iterator range.
Definition Iterator.h:94
static Pointer New(std::string const &key, Dictionary::Pointer registry={})
Create an iterator with no child.
Definition Iterator.h:36
static Pointer New(std::string const &key, Child const &child, Dictionary::Pointer registry={})
Create an iterator with a single child.
Definition Iterator.h:43
Container node, prepare and run its children sequentially.
Definition Node.h:28
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.
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 ON_ERROR_RETURN_STATUS(S)
Execute statement S, and, if not MRRESULT_SUCCESS, return the status.
Definition helpers.h:21
Top-level namespace of the msl library.
Definition acceleration.h:17