Poco::UPnP::ServiceDesc

class StateVariable

File Information

Library: UPnP/ServiceDesc
Package: ServiceDesc
Header: Poco/UPnP/ServiceDesc/StateVariable.h

Description

This class represents a state variable in a UPnP service description.

Inheritance

Direct Base Classes: Poco::RefCountedObject

All Base Classes: Poco::RefCountedObject

Member Summary

Member Functions: cppType, defaultValue, enableEvents, name, optional, sendEvents, setCppType, setDefaultValue, setName, setOptional, setType, setValueRestriction, type, valueRestriction

Inherited Functions: duplicate, referenceCount, release

Types

Ptr

typedef Poco::AutoPtr < StateVariable > Ptr;

Constructors

StateVariable

StateVariable();

Creates the StateVariable.

Destructor

~StateVariable virtual

~StateVariable();

Destroys the StateVariable.

Member Functions

cppType inline

const std::string & cppType() const;

Returns the C++ type of this variable.

defaultValue inline

const std::string & defaultValue() const;

Returns the default value of this variable, or an empty string if no default value is defined.

name inline

const std::string & name() const;

Returns the name of this variable, UTF-8 encoded.

optional inline

bool optional() const;

Returns true if the variable is optional, or false otherwise.

sendEvents inline

bool sendEvents() const;

Returns true if eventing is enabled for this state variable.

type inline

const std::string & type() const;

Returns the UPnP type of this variable.

The following types are defined in the UPnP Device Architecture document:

  • ui1: Unsigned 1 Byte int. Same format as int without leading sign.
  • ui2: Unsigned 2 Byte int. Same format as int without leading sign.
  • ui4: Unsigned 4 Byte int. Same format as int without leading sign.
  • i1: 1 Byte int. Same format as int.
  • i2: 2 Byte int. Same format as int.
  • i4: 4 Byte int. Same format as int. Must be between -2147483648 and 2147483647.
  • int: Fixed point, integer number. May have leading sign. May have leading zeros. No currency symbol. No grouping of digits to the left of the decimal, e.g., no commas.
  • r4: 4 Byte float. Same format as float. Must be between 3.40282347E+38 to 1.17549435E-38.
  • r8: 8 Byte float. Same format as float. Must be between -1.79769313486232E308 and
  • 4.94065645841247E-324 for negative values, and between 4.94065645841247E-324 and
  • 79769313486232E308 for positive values, i.e., IEEE 64-bit (8-Byte) double.
  • number: Same as r8.
  • fixed.14.4: Same as r8 but no more than 14 digits to the left of the decimal point and no more than 4 to the right.
  • float: Floating point number. Mantissa (left of the decimal) and/or exponent may have a leading sign. Mantissa and/or exponent may have leading zeros. Decimal character in mantissa is a period, i.e., whole digits in mantissa separated from fractional digits by period. Mantissa separated from exponent by E. No currency symbol. No grouping of digits in the mantissa, e.g., no commas.
  • char: Unicode string. One character long.
  • string: Unicode string. No limit on length.
  • date: Date in a subset of ISO 8601 format without time data.
  • dateTime: Date in ISO 8601 format with optional time but no time zone.
  • dateTime.tz: Date in ISO 8601 format with optional time and optional time zone.
  • time: Time in a subset of ISO 8601 format with no date and no time zone.
  • time.tz: Time in a subset of ISO 8601 format with optional time zone but no date.
  • boolean: “0” for false or “1” for true. The values “true”, “yes”, “false”, or “no” may also be used but are not recommended.
  • bin.base64: MIME-style Base64 encoded binary BLOB. Takes 3 Bytes, splits them into 4 parts, and maps each 6 bit piece to an octet. No limit on size.
  • bin.hex: Hexadecimal digits representing octets. Treats each nibble as a hex digit and encodes as a separate Byte. No limit on size.
  • uri: Universal Resource Identifier.
  • uuid: Universally Unique ID. Hexadecimal digits representing octets. Optional embedded hyphens are ignored.

valueRestriction inline

const Restriction & valueRestriction() const;

Returns the restriction for this variable.

enableEvents protected inline

void enableEvents(
    bool enable
);

Enable or disable eventing for this variable.

setCppType protected inline

void setCppType(
    const std::string & type
);

Sets the C++ type of this variable.

setDefaultValue protected inline

void setDefaultValue(
    const std::string & value
);

Sets the default value for this variable.

setName protected inline

void setName(
    const std::string & name
);

Sets the name of the variable.

setOptional protected inline

void setOptional(
    bool optional
);

Sets the optional flag of this variable.

setType protected inline

void setType(
    const std::string & type
);

Sets the data type of this variable.

setValueRestriction protected inline

void setValueRestriction(
    Restriction::Ptr pRestriction
);

Sets a restriction for this variable.

Securely control IoT edge devices from anywhere   Connect a Device