• EventDescriptor
  • EventDescriptor Class

    Describes a certain Event. More...

    Header: #include <EventDescriptor>

    Public Types

    enum Type { TypeDevice, TypeInterface }

    Public Functions

    EventDescriptor(const EventTypeId & eventTypeId, const DeviceId & deviceId, const QList<ParamDescriptor> & paramDescriptors = QList<ParamDescriptor> ())
    EventDescriptor(const QString & interface, const QString & interfaceEvent, const QList<ParamDescriptor> & paramDescriptors = QList<ParamDescriptor> ())
    DeviceId deviceId() const
    EventTypeId eventTypeId() const
    QString interface() const
    QString interfaceEvent() const
    bool isValid() const
    ParamDescriptor paramDescriptor(const ParamTypeId & paramTypeId) const
    QList<ParamDescriptor> paramDescriptors() const
    void setParamDescriptors(const QList<ParamDescriptor> & paramDescriptors)
    Type type() const
    bool operator==(const EventDescriptor & other) const

    Detailed Description

    Describes a certain Event.

    An EventDescriptor describes an Event in order to match it with a nymeaserver::Rule.

    An EventDescriptor can either be bound to a certain device/eventtype, or to an interface. If an event is bound to a device, it will only match when the given device fires the given event. If an event is bound to an interface, it will match the given event for all the devices implementing the given interface.

    See also Event, EventType, and nymeaserver::Rule.

    Member Type Documentation

    enum EventDescriptor::Type

    ConstantValueDescription
    EventDescriptor::TypeDevice0The EventDescriptor describes a device Event.
    EventDescriptor::TypeInterface1The EventDescriptor describes an interface based Event.

    Member Function Documentation

    EventDescriptor::EventDescriptor(const EventTypeId & eventTypeId, const DeviceId & deviceId, const QList<ParamDescriptor> & paramDescriptors = QList<ParamDescriptor> ())

    Constructs an EventDescriptor describing an Event with the given eventTypeId, deviceId and the given paramDescriptors.

    EventDescriptor::EventDescriptor(const QString & interface, const QString & interfaceEvent, const QList<ParamDescriptor> & paramDescriptors = QList<ParamDescriptor> ())

    Constructs an EventDescriptor describing an Event with the given interface, interfaceEvent and the given paramDescriptors.

    DeviceId EventDescriptor::deviceId() const

    Returns the id of the Device associated with this Event.

    EventTypeId EventDescriptor::eventTypeId() const

    Returns the id of the EventType which describes this Event.

    QString EventDescriptor::interface() const

    Returns the interface associated with this EventDescriptor.

    QString EventDescriptor::interfaceEvent() const

    Returns the interface's event name associated with this EventDescriptor.

    bool EventDescriptor::isValid() const

    Returns true if the EventDescriptor is valid, that is, when it has either enough data to describe a device/eventType or an interface/interfaceEvent pair.

    ParamDescriptor EventDescriptor::paramDescriptor(const ParamTypeId & paramTypeId) const

    Returns the ParamDescriptor with the given paramTypeId, otherwise an invalid ParamDescriptor.

    QList<ParamDescriptor> EventDescriptor::paramDescriptors() const

    Returns the parameters of this Event.

    See also setParamDescriptors().

    void EventDescriptor::setParamDescriptors(const QList<ParamDescriptor> & paramDescriptors)

    Set the parameters of this Event to paramDescriptors.

    See also paramDescriptors().

    Type EventDescriptor::type() const

    Returns true Type of this descriptor.

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

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