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,
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,
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)
Definition Dictionary.h:17
Generic key-value associative container.
Definition Dictionary.h:23
Dictionary::ConstPointer registry() const
Return the registry.
T const & get(std::string const &key) const
Return an object from the dictionary.
Definition AbstractNode.h:64
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
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={})
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
std::vector< AbstractNode::Pointer > Siblings
Definition Node.h:32
NLSStatus prepare(MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
Prepare all children in order.
Node(Dictionary::Pointer registry={})
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
Definition AbstractNode.h:23
IteratorTemplate< msl::ConstIterator< T > > ConstIterator
Definition Iterator.h:146
IteratorTemplate< msl::Iterator< T > > Iterator
Definition Iterator.h:149
Definition acceleration.h:17