• Event
  • Event Class

    Holds information required to emit a event described by a EventType. More...

    Header: #include <Event>

    Public Functions

    Event()
    Event(const EventTypeId & eventTypeId, const DeviceId & deviceId, const ParamList & params = ParamList(), bool isStateChangeEvent = false)
    DeviceId deviceId() const
    EventId eventId() const
    EventTypeId eventTypeId() const
    bool isStateChangeEvent() const
    Param param(const ParamTypeId & paramTypeId) const
    ParamList params() const
    void setDeviceId(const DeviceId & deviceId)
    void setEventTypeId(const EventTypeId & eventTypeId)
    void setParams(const ParamList & params)
    bool operator==(const Event & other) const

    Detailed Description

    Holds information required to emit a event described by a EventType.

    It is bound to a Device and a EventType and holds the parameters for the event that happened.

    The params must match the template as described in EventType.

    See also Device, EventType, and EventDescriptor.

    Member Function Documentation

    Event::Event()

    Constructs an Event.

    Event::Event(const EventTypeId & eventTypeId, const DeviceId & deviceId, const ParamList & params = ParamList(), bool isStateChangeEvent = false)

    Constructs an Event reflecting the Event given by eventTypeId, associated with the Device given by deviceId and the parameters given by params. The parameter isStateChangeEvent specifies if the Event will be autogeneratet or not. The parameters must match the description in the reflecting Event.

    DeviceId Event::deviceId() const

    Returns the id of the Device associated with this Event.

    See also setDeviceId().

    EventId Event::eventId() const

    Returns the Id of this Event. Each newly created Event will have a new UUID generated. The id will be copied in the copy constructor.

    EventTypeId Event::eventTypeId() const

    Returns the id of the EventType which describes this Event.

    See also setEventTypeId().

    bool Event::isStateChangeEvent() const

    Returns true if this event is autogenerated by a state change.

    Param Event::param(const ParamTypeId & paramTypeId) const

    Returns the parameter of this Event with the given paramTypeId.

    ParamList Event::params() const

    Returns the parameters of this Event.

    See also setParams().

    void Event::setDeviceId(const DeviceId & deviceId)

    Set the deviceId for this Event.

    See also deviceId().

    void Event::setEventTypeId(const EventTypeId & eventTypeId)

    Set the EventTypeId for this Event to the given eventTypeId.

    See also eventTypeId().

    void Event::setParams(const ParamList & params)

    Set the parameters of this Event to params.

    See also params().

    bool Event::operator==(const Event & other) const

    Compare this Event to the Event given by other. Events are equal (returns true) if eventTypeId, deviceId and params match.