Loading...
Searching...
No Matches
ScenarioInterface.hpp
1#pragma once
2#include <Process/ExpandMode.hpp>
3#include <Process/TimeValue.hpp>
4
5#include <score/model/Identifier.hpp>
6#include <score/tools/std/IndirectContainer.hpp>
7
8#include <score_plugin_scenario_export.h>
9
10#include <verdigris>
12namespace Scenario
13{
14class IntervalModel;
15class EventModel;
16class StateModel;
17class TimeSyncModel;
18
19class SCORE_PLUGIN_SCENARIO_EXPORT ScenarioInterface
20{
21public:
22 virtual ~ScenarioInterface();
23 virtual IntervalModel* findInterval(const Id<IntervalModel>& intervalId) const = 0;
24 virtual EventModel* findEvent(const Id<EventModel>& eventId) const = 0;
25 virtual TimeSyncModel* findTimeSync(const Id<TimeSyncModel>& timeSyncId) const = 0;
26 virtual StateModel* findState(const Id<StateModel>& stId) const = 0;
27
28 virtual IntervalModel& interval(const Id<IntervalModel>& intervalId) const = 0;
29 virtual EventModel& event(const Id<EventModel>& eventId) const = 0;
30 virtual TimeSyncModel& timeSync(const Id<TimeSyncModel>& timeSyncId) const = 0;
31 virtual StateModel& state(const Id<StateModel>& stId) const = 0;
32
33 virtual score::IndirectContainer<IntervalModel> getIntervals() const = 0;
34 virtual score::IndirectContainer<StateModel> getStates() const = 0;
35 virtual score::IndirectContainer<EventModel> getEvents() const = 0;
36 virtual score::IndirectContainer<TimeSyncModel> getTimeSyncs() const = 0;
37};
38
39static const constexpr auto startId_val = 0;
40static const constexpr auto endId_val = 1;
41
42template <typename T>
43auto startId()
44{
45 return Id<T>{startId_val};
46}
47
48template <typename T>
49auto endId()
50{
51 return Id<T>{endId_val};
52}
53
54template <typename Scenario_T, typename Element_T>
56// { auto container_accessor = &intervals; etc... }
57
58template <>
60{
61 static const constexpr auto accessor = &ScenarioInterface::getIntervals;
62};
63template <>
65{
66 static const constexpr auto accessor = &ScenarioInterface::getEvents;
67};
68template <>
70{
71 static const constexpr auto accessor = &ScenarioInterface::getTimeSyncs;
72};
73template <>
75{
76 static const constexpr auto accessor = &ScenarioInterface::getStates;
77};
78}
79
80W_REGISTER_ARGTYPE(const Scenario::ScenarioInterface&)
81W_REGISTER_ARGTYPE(Scenario::ScenarioInterface)
82
83Q_DECLARE_METATYPE(const Scenario::ScenarioInterface*)
84Q_DECLARE_METATYPE(Scenario::ScenarioInterface*)
85W_REGISTER_ARGTYPE(const Scenario::ScenarioInterface*)
86W_REGISTER_ARGTYPE(Scenario::ScenarioInterface*)
The OngoingCommandDispatcher class.
Definition OngoingCommandDispatcher.hpp:27
Definition EventModel.hpp:36
Definition IntervalModel.hpp:50
Definition ScenarioInterface.hpp:20
Definition StateModel.hpp:63
Definition TimeSyncModel.hpp:34
The id_base_t class.
Definition Identifier.hpp:57
Definition IndirectContainer.hpp:129
Main plug-in of score.
Definition score-plugin-dataflow/Dataflow/PortItem.hpp:13
Definition ScenarioInterface.hpp:55