msl 1.3.0
Loading...
Searching...
No Matches
Action.h
Go to the documentation of this file.
1// Copyright 2025 Julien Lamy, ICube, Université de Strasbourg-CNRS.
2// Part of msl, distributed under the terms of the MIT license.
3
4#ifndef _70ee755b_d0eb_4fb8_ab2c_1613aca124b2
5#define _70ee755b_d0eb_4fb8_ab2c_1613aca124b2
6
7#include <cstddef>
8#include <functional>
9
10#include <MrMeasSrv/MeasUtils/NLSStatus.h>
11
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>
16
17#include "msl/Dictionary.h"
20
21namespace msl
22{
23
24namespace graph
25{
26
28class Action: public AbstractNode
29{
30public:
33
35
37 static Pointer New(
38 Function const & function, Dictionary::Pointer registry={});
39
40 virtual ~Action() = default;
41
42 NLSStatus prepare(
43 MrProt & protocol, SeqLim & limits, SeqExpo & exports) override;
44
45 NLSStatus run(
46 MrProt & protocol, SeqLim & limits, SeqExpo & exports) override;
47
49 uint64_t duration() const override;
50
52 MrProtocolData::SeqExpoRFInfo rfInfo() const override;
53private:
54 Function _function;
55
56 Action(Function const & function, Dictionary::Pointer registry={});
57 Action(Action const &) = default;
58 Action(Action &&) = default;
59 Action & operator=(Action const &) = default;
60 Action & operator=(Action &&) = default;
61};
62
63}
64}
65
66#endif // _70ee755b_d0eb_4fb8_ab2c_1613aca124b2
std::shared_ptr< Dictionary > Pointer
Reference-counted pointer to Dictionary.
Definition Dictionary.h:34
Dictionary::ConstPointer registry() const
Return the registry.
AbstractNode(Dictionary::Pointer registry={})
Create a node with the given registry.
Node calling a function when run is called.
Definition Action.h:29
static Pointer New(Function const &function, Dictionary::Pointer registry={})
Create an action from a function and registry.
uint64_t duration() const override
Alway return 0.
std::shared_ptr< Action > Pointer
Reference-counted pointer to Action.
Definition Action.h:34
FlexibleFunction< void > Function
Action function.
Definition Action.h:32
NLSStatus prepare(MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
Prepare the node.
NLSStatus run(MrProt &protocol, SeqLim &limits, SeqExpo &exports) override
Run the node.
MrProtocolData::SeqExpoRFInfo rfInfo() const override
Alway return 0.
#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