Library: UPnP/GENA
Package: StateVariables
Header: Poco/UPnP/GENA/EventedStateVariable.h
A helper class template for implementing UPnP evented state variables.
Firing of events is controlled by a moderation policy. An EventModerationPolicy must be a class providing a member function named valueChanged() that takes as argument the new value. Three policy classes are predefined:
Member Functions: get, name, set, toString
EventedStateVariable(
const std::string & name,
const T & initialValue,
const MP & moderationPolicy
);
Creates a new EventedStateVariable with the given name and initialValue. The given moderation policy object is used to control the firing of events when the variable's value changes.
const T & get() const;
const std::string & name() const;
void set(
const T & value
);
std::string toString() const;
static std::string toString(
Poco::Int8 value
);
static std::string toString(
Poco::UInt8 value
);
static std::string toString(
Poco::Int16 value
);
static std::string toString(
Poco::UInt16 value
);
static std::string toString(
Poco::Int32 value
);
static std::string toString(
Poco::UInt32 value
);
static std::string toString(
float value
);
static std::string toString(
double value
);
static std::string toString(
bool value
);
static std::string toString(
const std::string & value
);