#include <icy/symple/event.h>Inherits:
Message
Symple event message carrying a named occurrence with a timestamp.
The name field identifies the event. The time field is stored as a Unix timestamp (seconds since epoch).
| Return | Name | Description |
|---|---|---|
Event | Constructs an event with type "event" and time set to now. | |
Event | Constructs an event from a JSON value; sets missing time to now. | |
Event | Copy constructor; preserves or sets missing time to now. | |
bool | valid virtual const | Returns true if the base message is valid and the name field is set. |
std::string | name const | Returns the event name string. |
std::time_t | time const | Returns the event timestamp as a Unix time_t value. |
void | setName | Sets the event name field. |
void | setTime | Sets the event timestamp. |
Event()Constructs an event with type "event" and time set to now.
Event(const json::Value & root)Constructs an event from a JSON value; sets missing time to now.
root JSON object to initialise from.Event(const Event & root)Copy constructor; preserves or sets missing time to now.
root Source event.virtual const
virtual bool valid() constReturns true if the base message is valid and the name field is set.
const
std::string name() constReturns the event name string.
const
std::time_t time() constReturns the event timestamp as a Unix time_t value.
void setName(std::string_view name)Sets the event name field.
name Event name string.void setTime(std::time_t time)Sets the event timestamp.
time Unix timestamp (seconds since epoch).