13#ifndef RTCTK_COMPONENTFRAMEWORK_EVENTDEFINITIONS_HPP
14#define RTCTK_COMPONENTFRAMEWORK_EVENTDEFINITIONS_HPP
19#include <boost/core/demangle.hpp>
30 return boost::core::demangle((
typeid(T).name()));
41template <
typename EventType>
43 if (j.contains(
"type")) {
59template <
typename EventType>
106 inline static const std::string
TOPIC_NAME =
"computation_topic";
150 const std::string&
item,
168 inline static const std::string
TOPIC_NAME =
"configuration_topic";
210 const std::string&
state);
216 const std::string& item,
217 const std::string&
state);
223 const std::vector<std::string>&
items,
224 const std::string&
state);
387 inline static const std::string
TOPIC_NAME =
"coordination_topic";
409 const std::string&
entity,
410 const std::string&
state);
433 const std::string& hrtc_entity,
434 const std::string& hrtc_state,
461 inline static const std::string
TOPIC_NAME =
"alert_status_topic";
Defines the JSON payload type JsonPayload.
Definition commandReplier.cpp:22
std::optional< EventType > ConvertTo(const JsonPayload &j)
Helper to convert to certain EventType if possible.
Definition eventDefinitions.hpp:60
bool ConvertibleTo(const JsonPayload &j)
Helper to check if JsonPayload is convertible to a certain EventType.
Definition eventDefinitions.hpp:42
void to_json(JsonPayload &j, const DataPointPath &v)
Definition dataPointPath.cpp:218
nlohmann::json JsonPayload
Type requirements:
Definition jsonPayload.hpp:25
void from_json(const JsonPayload &j, DataPointPath &v)
Definition dataPointPath.cpp:223
std::string PrettyTypeName()
Definition eventDefinitions.hpp:29
Abstract Event Type that is used as a base for all events.
Definition eventDefinitions.hpp:78
TimeString time
Definition eventDefinitions.hpp:88
std::string origin
Definition eventDefinitions.hpp:87
virtual ~AbstractEvent()=default
Represents an active alert originating from a component instance.
Definition eventDefinitions.hpp:469
std::string origin
Component instance origin.
Definition eventDefinitions.hpp:473
TimeString since
Timestamp when alert was first made active.
Definition eventDefinitions.hpp:488
std::string id
Alert identifier which is unique to the origin.
Definition eventDefinitions.hpp:478
std::string description
Description of alert.
Definition eventDefinitions.hpp:483
Event published when alert status is changed.
Definition eventDefinitions.hpp:457
AlertStatusEvent()=default
static const std::string TOPIC_NAME
Definition eventDefinitions.hpp:461
bool status
Reduced alert status.
Definition eventDefinitions.hpp:499
std::vector< Alert > active_alerts
List of active alerts.
Definition eventDefinitions.hpp:504
Abstract Event Type that is used as a base for computation events.
Definition eventDefinitions.hpp:105
ComputationEvent()=default
std::string item
Definition eventDefinitions.hpp:114
std::string state
Definition eventDefinitions.hpp:115
static const std::string TOPIC_NAME
Definition eventDefinitions.hpp:106
Event Type used to signal that a computation has finished.
Definition eventDefinitions.hpp:146
ComputationFinishedEvent()=default
JsonPayload result
Definition eventDefinitions.hpp:153
Event Type used to signal that a computation has started.
Definition eventDefinitions.hpp:129
ComputationStartedEvent()=default
Represents a single configuration item.
Definition eventDefinitions.hpp:177
bool operator==(const Item &) const =default
std::string name
PathName of the configuration item.
Definition eventDefinitions.hpp:181
std::optional< TimeString > timestamp
(Optional) Timestamp of the configuration item.
Definition eventDefinitions.hpp:186
std::optional< uint64_t > sequence_id
(Optional) SequenceId of the configuration item.
Definition eventDefinitions.hpp:191
Abstract Event Type that is used as a base for configuration events.
Definition eventDefinitions.hpp:167
ConfigurationEvent()=default
static const std::string TOPIC_NAME
Definition eventDefinitions.hpp:168
std::vector< Item > ItemList
Definition eventDefinitions.hpp:196
std::string state
Definition eventDefinitions.hpp:227
ItemList items
Definition eventDefinitions.hpp:226
Event Type used to signal that configuration data items were retrieved from RTR.
Definition eventDefinitions.hpp:276
ConfigurationRetrievedEvent()=default
Event Type used to signal that configuration data items were updated in RTR.
Definition eventDefinitions.hpp:241
ConfigurationUpdatedEvent()=default
Abstract Event Type that is used as a base for coordination events.
Definition eventDefinitions.hpp:386
static const std::string TOPIC_NAME
Definition eventDefinitions.hpp:387
CoordinationEvent()=default
Event Type used to signal that configuration data items were applied in HRTC.
Definition eventDefinitions.hpp:349
HrtcConfigurationAppliedEvent()=default
uint64_t hrtc_sample_id
Definition eventDefinitions.hpp:372
TimeString hrtc_timestamp
Definition eventDefinitions.hpp:371
std::string hrtc_origin
Definition eventDefinitions.hpp:370
Event Type used to signal that configuration data items were scheduled to be applied in HRTC.
Definition eventDefinitions.hpp:312
HrtcConfigurationScheduledEvent()=default
uint64_t hrtc_sample_id
Definition eventDefinitions.hpp:335
TimeString hrtc_timestamp
Definition eventDefinitions.hpp:334
std::string hrtc_origin
Definition eventDefinitions.hpp:333
Event Type used to signal that some entity in HRTC changed its state.
Definition eventDefinitions.hpp:429
HrtcStateChangedEvent()=default
TimeString hrtc_timestamp
Definition eventDefinitions.hpp:438
uint64_t hrtc_sample_id
Definition eventDefinitions.hpp:439
Event Type used to signal that some entity changed its state.
Definition eventDefinitions.hpp:405
StateChangedEvent()=default
std::string entity
Definition eventDefinitions.hpp:414
std::string state
Definition eventDefinitions.hpp:415
Represents an ISO 8601 time string in format: YYYY-MM-DDThh:mm:ss.sssZ.
Definition timeString.hpp:28
A timestring in ISO-8601 format.