ProcessStateDataInterface.hpp
1 #pragma once
2 #include <State/Address.hpp>
3 #include <State/Message.hpp>
4 
5 #include <Process/State/MessageNode.hpp>
6 
7 #include <score/model/IdentifiedObject.hpp>
8 #include <score/model/Identifier.hpp>
9 #include <score/tools/std/Optional.hpp>
10 
11 #include <score_lib_process_export.h>
12 
13 #include <vector>
14 #include <verdigris>
15 
16 namespace Process
17 {
18 class ProcessModel;
19 }
20 class QObject;
21 
22 class SCORE_LIB_PROCESS_EXPORT ProcessStateDataInterface
23  : public IdentifiedObject<ProcessStateDataInterface>
24 {
26 public:
27  ProcessStateDataInterface(Process::ProcessModel& model, QObject* parent);
28 
29  virtual ~ProcessStateDataInterface();
30 
37  virtual std::vector<State::AddressAccessor> matchingAddresses() { return {}; }
38 
42  virtual State::MessageList messages() const { return {}; }
43 
50  virtual State::MessageList setMessages(
51  const State::MessageList& newMessages, const Process::MessageNode& currentState)
52  {
53  return messages();
54  }
55 
56  Process::ProcessModel& process() const { return m_model; }
57 
58 public:
59  void stateChanged() E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, stateChanged)
65  void messagesChanged() E_SIGNAL(SCORE_LIB_PROCESS_EXPORT, messagesChanged)
66 
67 private:
68  Process::ProcessModel& m_model;
69 };
The IdentifiedObject class.
Definition: IdentifiedObject.hpp:19
The Process class.
Definition: score-lib-process/Process/Process.hpp:61
Definition: ProcessStateDataInterface.hpp:24
virtual State::MessageList messages() const
messages The current messages in this point of the process.
Definition: ProcessStateDataInterface.hpp:42
virtual std::vector< State::AddressAccessor > matchingAddresses()
matchingAddresses The addresses that correspond to this state.
Definition: ProcessStateDataInterface.hpp:37
virtual State::MessageList setMessages(const State::MessageList &newMessages, const Process::MessageNode &currentState)
setMessages Request a message change on behalf of the process.
Definition: ProcessStateDataInterface.hpp:50
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324