Describes a certain State. More...
Header: | #include <StateDescriptor> |
enum | Type { TypeDevice, TypeInterface } |
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 |
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.
Constant | Value | Description |
---|---|---|
StateDescriptor::TypeDevice | 0 | Describes a state by deviceId and stateTypeId |
StateDescriptor::TypeInterface | 1 | Describes a state by interface name and interfaceState name |
Constructs an StateDescriptor describing an State.
Constructs an StateDescriptor describing an State with the given stateTypeId, deviceId, stateValue and operatorType.
Constructs an StateDescriptor describing an State with the given interface, interfaceState, stateValue and operatorType.
Returns the DeviceId of this State.
Returns the interface for this {StateDescriptor}.
Returns the interface state's name for this {StateDescriptor}.
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().
Returns the ValueOperator of this State.
Returns the StateTypeId of this State.
Returns the Value of this State.
Returns true Type of this descriptor.
Compare this StateDescriptor to the State given by state. Returns true if the given state does not match the definition of the StateDescriptor
Compare this StateDescriptor to other. StateDescriptors are equal (returns true) if stateTypeId, stateValue and operatorType match.
Compare this StateDescriptor to the State given by state. Returns true if the given state matches the definition of the StateDescriptor