Event Class
(LogManager::Event)The Event struct represents a single logged event. For example, CDPAlarm Set or CDPAlarm Clear. More...
Header: | #include <LogManager/Event.h> |
Public Variables
unsigned | code = 0 |
EventData | data |
uint64_t | id = 0 |
double | logstampSec = 0 |
std::string | sender |
unsigned | status = 0 |
double | timestampSec = 0 |
Related Non-Members
typedef | EventData |
typedef | EventSenderTags |
Detailed Description
The Event struct represents a single logged event. For example, CDPAlarm Set or CDPAlarm Clear.
Member Variable Documentation
unsigned Event::code = 0
This variable holds the event code flags.
Common event codes used in the CDP framework (note that multiple flags can be set at the same time):
Name | Code | Description |
---|---|---|
AlarmSet | 0x1 | The alarm's Set flag/state was set. The alarm changed state to "Unack-Set" (The Unack flag was set if not already set). |
AlarmClr | 0x2 | The alarm's Set flag was cleared. The Unack state is unchanged. |
AlarmAck | 0x4 | The alarm changed state from "Unacknowledged" to "Acknowledged". The Set state is unchanged. |
AlarmReprise | 0x40 | A repetition/update of an event that has been reported before. Courtesy of late subscribers. |
SourceObjectUnavailable | 0x100 | The provider of the event has become unavailable (disconnected or similar). |
NodeBoot | 0x40000000 | The provider reports that the CDPEventNode has just booted. |
EventData Event::data
This variable holds a map of key-value pairs describing the event.
Unlike EventSenderTags, the event data will change during logging - it can be different for each event.
uint64_t Event::id = 0
This variable holds the system-wide global event ID (CDP eventId + application handle).
Note, the ID is unique only until application reboot.
double Event::logstampSec = 0
This variable holds the timestamp when the event was logged.
The logstamp is helpful when extracting data by chunks as events might arrive out of order to the logger in a multi-application system.
std::string Event::sender
This variable holds the sender of the event.
This is the long name (starting with the application name) of the node that sent the event. It also mathces the key in EventSenderTags.
unsigned Event::status = 0
This variable holds the status of the alarm/event.
See the Alarm Status Defines in CDPAlarm documentation.
double Event::timestampSec = 0
This variable holds the timestamp when the event was sent. The timestampSec matches the xAxis in the value log.
Related Non-Members
typedef LogManager::EventData
Event data is a map of key-value pairs describing the event.
Unlike EventSenderTags, the event data will change during logging - it can be different for each event.
typedef LogManager::EventSenderTags
A map of event sender names to tags associated with the sender.
The event sender tags are static and will not change during logging.
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.