4#ifndef _c1c4f441_160f_46bf_869e_1bf9c199aa91
5#define _c1c4f441_160f_46bf_869e_1bf9c199aa91
7#include <unordered_map>
9#include <MrMeasSrv/MeasUtils/NLSStatus.h>
10#include <MrMeasSrv/SeqIF/Sequence/sequmsg.h>
12#include <MrProtSrv/Domain/CoreNative/SeqLim.h>
13#include <MrProtSrv/Domain/MrProtData/MrProt/MrProt.h>
14#include <MrProtSrv/Domain/MrProtData/MrProt/SeqIF/SeqExpo.h>
15#include <MrProtSrv/Domain/MrProtData/MrProt/SeqIF/SeqExpoRFBlockInfo.h>
37 using Map = std::unordered_map<T, AbstractNode::Pointer>;
46 std::string
const & key,
Map const & cases,
61 MrProt & protocol, SeqLim & limits, SeqExpo & exports)
override;
70 MrProt & protocol, SeqLim & limits, SeqExpo & exports)
override;
88 MrProtocolData::SeqExpoRFInfo
rfInfo()
const override;
99 mutable uint64_t _duration;
100 mutable MrProtocolData::SeqExpoRFInfo _rfInfo;
103 std::string
const & key,
Map const & cases,
111 MrProt & protocol, SeqLim & limits, SeqExpo & exports)
const;
114 MrProt & protocol, SeqLim & limits, SeqExpo & exports);
std::shared_ptr< Dictionary > Pointer
Reference-counted pointer to Dictionary.
Definition Dictionary.h:34
std::shared_ptr< AbstractNode > Pointer
Reference-counted pointer to AbstractNode.
Definition AbstractNode.h:30
std::shared_ptr< AbstractNode const > ConstPointer
Reference-counted constant pointer to AbstractNode.
Definition AbstractNode.h:30
Dictionary::ConstPointer registry() const
Return the registry.
AbstractNode(Dictionary::Pointer registry={})
Create a node with the given registry.
Node encapsulating a switch/case structure based on a boolean key or a function key.
Definition Case.h:34
static Pointer New(std::string const &key, Map const &cases, Dictionary::Pointer registry={})
Create a case node pointing to a key in the registry.
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.
FlexibleFunction< T > Function
Case function.
Definition Case.h:40
static Pointer New(Function const &function, Map const &cases, Dictionary::Pointer registry={})
Create a case node holding a function.
Case & setRegistry(Dictionary::Pointer registry) override
Set the registry to this node and its children.
std::shared_ptr< Case< T > > Pointer
Reference-counted pointer to Case<T>.
Definition Case.h:42
std::unordered_map< T, AbstractNode::Pointer > Map
Dictionary to dispatch key to function.
Definition Case.h:37
MrProtocolData::SeqExpoRFInfo rfInfo() const override
Return the RF information of the selected child, throw an exception if unknown value.
uint64_t duration() const override
Return the duration of the selected child, throw an exception if unknown value.
void reset() override
Reset all branches to a default state.
#define DECLARE_POINTERS(name)
Declare pointer type aliases.
Definition helpers.h:83
Graph-related objects and functions.
Definition AbstractNode.h:24
boost::variant< std::function< T()>, std::function< T(Dictionary::Pointer)>, std::function< T(MrProt &)>, std::function< T(MrProt &, Dictionary::Pointer)>, std::function< T(MrProt &, SeqLim &, SeqExpo &)>, std::function< T(MrProt &, SeqLim &, SeqExpo &, Dictionary::Pointer)> > FlexibleFunction
A graph function (e.g. Case or If), with flexible arguments.
Definition FlexibleFunction.h:29
Top-level namespace of the msl library.
Definition acceleration.h:17