• StateDescriptor
  • StateDescriptor Class

    Describes a certain State. More...

    Header: #include <StateDescriptor>

    Public Types

    enum Type { TypeDevice, TypeInterface }

    Public Functions

    StateDescriptor()
    StateDescriptor(const StateTypeId & stateTypeId, const DeviceId & deviceId, const QVariant & stateValue, Types::ValueOperator operatorType = Types::ValueOperatorEquals)
    StateDescriptor(const QString & interface, const QString & interfaceState, const QVariant & stateValue, Types::ValueOperator operatorType = Types::ValueOperatorEquals)
    DeviceId deviceId() const
    QString interface() const
    QString interfaceState() const
    bool isValid() const
    Types::ValueOperator operatorType() const
    StateTypeId stateTypeId() const
    QVariant stateValue() const
    Type type() const
    bool operator!=(const State & state) const
    bool operator==(const StateDescriptor & other) const
    bool operator==(const State & state) const

    Detailed Description

    Describes a certain State.

    A StateDescriptor describes a State in order to match it with a nymeaserver::Rule. A StateDescriptor uses either a DeviceId/StateTypeId pair to describe a State or a pair of strings describing the interface and interface action for a State.

    See also State and nymeaserver::Rule.

    Member Type Documentation

    enum StateDescriptor::Type

    ConstantValueDescription
    StateDescriptor::TypeDevice0Describes a state by deviceId and stateTypeId
    StateDescriptor::TypeInterface1Describes a state by interface name and interfaceState name

    Member Function Documentation

    StateDescriptor::StateDescriptor()

    Constructs an StateDescriptor describing an State.

    StateDescriptor::StateDescriptor(const StateTypeId & stateTypeId, const DeviceId & deviceId, const QVariant & stateValue, Types::ValueOperator operatorType = Types::ValueOperatorEquals)

    Constructs an StateDescriptor describing an State with the given stateTypeId, deviceId, stateValue and operatorType.

    StateDescriptor::StateDescriptor(const QString & interface, const QString & interfaceState, const QVariant & stateValue, Types::ValueOperator operatorType = Types::ValueOperatorEquals)

    Constructs an StateDescriptor describing an State with the given interface, interfaceState, stateValue and operatorType.

    DeviceId StateDescriptor::deviceId() const

    Returns the DeviceId of this State.

    QString StateDescriptor::interface() const

    Returns the interface for this {StateDescriptor}.

    QString StateDescriptor::interfaceState() const

    Returns the interface state's name for this {StateDescriptor}.

    bool StateDescriptor::isValid() const

    Returns the true if this StateDescriptor is valid. A valid StateDescriptor must have a valid stateValue along with either a DeviceId/StateTypeId pair or an interface/interfaceState pair.

    See also StateDescriptor(), deviceId(), and stateValue().

    Types::ValueOperator StateDescriptor::operatorType() const

    Returns the ValueOperator of this State.

    StateTypeId StateDescriptor::stateTypeId() const

    Returns the StateTypeId of this State.

    QVariant StateDescriptor::stateValue() const

    Returns the Value of this State.

    Type StateDescriptor::type() const

    Returns true Type of this descriptor.

    bool StateDescriptor::operator!=(const State & state) const

    Compare this StateDescriptor to the State given by state. Returns true if the given state does not match the definition of the StateDescriptor

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

    Compare this StateDescriptor to other. StateDescriptors are equal (returns true) if stateTypeId, stateValue and operatorType match.

    bool StateDescriptor::operator==(const State & state) const

    Compare this StateDescriptor to the State given by state. Returns true if the given state matches the definition of the StateDescriptor