12#ifndef RTCTK_COMPONENTFRAMEWORK_EVENTDEFINITIONS_HPP
13#define RTCTK_COMPONENTFRAMEWORK_EVENTDEFINITIONS_HPP
18#include <boost/core/demangle.hpp>
29 return boost::core::demangle((
typeid(T).name()));
40template <
typename EventType>
42 if (j.contains(
"type")) {
58template <
typename EventType>
105 inline static const std::string
TOPIC_NAME =
"computation_topic";
149 const std::string&
item,
167 inline static const std::string
TOPIC_NAME =
"configuration_topic";
213 const std::string& item,
214 const std::string&
state);
220 const std::vector<std::string>&
items,
221 const std::string&
state);
386 inline static const std::string
TOPIC_NAME =
"coordination_topic";
408 const std::string&
entity,
409 const std::string&
state);
433 const std::string& hrtc_entity,
434 const std::string& hrtc_state,
462 inline static const std::string
TOPIC_NAME =
"alert_status_topic";
Defines the JSON payload type JsonPayload.
Definition commandReplier.cpp:21
std::optional< EventType > ConvertTo(const JsonPayload &j)
Helper to convert to certain EventType if possible.
Definition eventDefinitions.hpp:59
bool ConvertibleTo(const JsonPayload &j)
Helper to check if JsonPayload is convertible to a certain EventType.
Definition eventDefinitions.hpp:41
void to_json(JsonPayload &j, const DataPointPath &v)
Definition dataPointPath.cpp:217
nlohmann::json JsonPayload
Type requirements:
Definition jsonPayload.hpp:24
void from_json(const JsonPayload &j, DataPointPath &v)
Definition dataPointPath.cpp:222
std::string PrettyTypeName()
Definition eventDefinitions.hpp:28
Abstract Event Type that is used as a base for all events.
Definition eventDefinitions.hpp:77
TimeString time
Definition eventDefinitions.hpp:87
std::string origin
Definition eventDefinitions.hpp:86
virtual ~AbstractEvent()=default
Represents an active alert originating from a component instance.
Definition eventDefinitions.hpp:470
std::string origin
Component instance origin.
Definition eventDefinitions.hpp:474
TimeString since
Timestamp when alert was first made active.
Definition eventDefinitions.hpp:489
std::string id
Alert identifier which is unique to the origin.
Definition eventDefinitions.hpp:479
std::string description
Description of alert.
Definition eventDefinitions.hpp:484
Event published when alert status is changed.
Definition eventDefinitions.hpp:457
AlertStatusEvent()=default
static const std::string TOPIC_NAME
Definition eventDefinitions.hpp:462
bool status
Reduced alert status.
Definition eventDefinitions.hpp:500
std::vector< Alert > active_alerts
List of active alerts.
Definition eventDefinitions.hpp:505
Abstract Event Type that is used as a base for computation events.
Definition eventDefinitions.hpp:104
ComputationEvent()=default
std::string item
Definition eventDefinitions.hpp:113
std::string state
Definition eventDefinitions.hpp:114
static const std::string TOPIC_NAME
Definition eventDefinitions.hpp:105
Event Type used to signal that a computation has finished.
Definition eventDefinitions.hpp:145
ComputationFinishedEvent()=default
JsonPayload result
Definition eventDefinitions.hpp:152
Event Type used to signal that a computation has started.
Definition eventDefinitions.hpp:128
ComputationStartedEvent()=default
Represents a single configuration item.
Definition eventDefinitions.hpp:176
bool operator==(const Item &) const =default
std::string name
PathName of the configuration item.
Definition eventDefinitions.hpp:180
std::optional< TimeString > timestamp
(Optional) Timestamp of the configuration item.
Definition eventDefinitions.hpp:185
std::optional< uint64_t > sequence_id
(Optional) SequenceId of the configuration item.
Definition eventDefinitions.hpp:190
Abstract Event Type that is used as a base for configuration events.
Definition eventDefinitions.hpp:166
ConfigurationEvent()=default
static const std::string TOPIC_NAME
Definition eventDefinitions.hpp:167
std::vector< Item > ItemList
Definition eventDefinitions.hpp:195
std::string state
Definition eventDefinitions.hpp:224
ItemList items
Definition eventDefinitions.hpp:223
Event Type used to signal that configuration data items were retrieved from RTR.
Definition eventDefinitions.hpp:273
ConfigurationRetrievedEvent()=default
Event Type used to signal that configuration data items were updated in RTR.
Definition eventDefinitions.hpp:238
ConfigurationUpdatedEvent()=default
Abstract Event Type that is used as a base for coordination events.
Definition eventDefinitions.hpp:385
static const std::string TOPIC_NAME
Definition eventDefinitions.hpp:386
CoordinationEvent()=default
Event Type used to signal that configuration data items were applied in HRTC.
Definition eventDefinitions.hpp:347
HrtcConfigurationAppliedEvent()=default
uint64_t hrtc_sample_id
Definition eventDefinitions.hpp:371
TimeString hrtc_timestamp
Definition eventDefinitions.hpp:370
std::string hrtc_origin
Definition eventDefinitions.hpp:369
Event Type used to signal that configuration data items were scheduled to be applied in HRTC.
Definition eventDefinitions.hpp:309
HrtcConfigurationScheduledEvent()=default
uint64_t hrtc_sample_id
Definition eventDefinitions.hpp:333
TimeString hrtc_timestamp
Definition eventDefinitions.hpp:332
std::string hrtc_origin
Definition eventDefinitions.hpp:331
Event Type used to signal that some entity in HRTC changed its state.
Definition eventDefinitions.hpp:428
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:404
StateChangedEvent()=default
std::string entity
Definition eventDefinitions.hpp:413
std::string state
Definition eventDefinitions.hpp:414
Represents an ISO 8601 time string in format: YYYY-MM-DDThh:mm:ss.sssZ.
Definition timeString.hpp:27
A timestring in ISO-8601 format.