File Information
Library: UPnP/GENA
Package: StateVariables
Header: Poco/UPnP/GENA/EventedStateVariable.h
Description
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:
- NoModerationPolicy: fires an event whenever the value changes.
- MinimumDeltaModerationPolicy: fires an event when the value changes to a certain amount since the last time an event was sent.
- MaximumRateModerationPolicy: fires an event at most every <n> seconds.
Member Summary
Constructors
EventedStateVariable
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.
Destructor
~EventedStateVariable
Member Functions
get
const T & get() const;
name
const std::string & name() const;
set
void set(
const T & value
);
toString
std::string toString() const;
toString
static std::string toString(
Poco::Int8 value
);
toString
static std::string toString(
Poco::UInt8 value
);
toString
static std::string toString(
Poco::Int16 value
);
toString
static std::string toString(
Poco::UInt16 value
);
toString
static std::string toString(
Poco::Int32 value
);
toString
static std::string toString(
Poco::UInt32 value
);
toString
static std::string toString(
float value
);
toString
static std::string toString(
double value
);
toString
static std::string toString(
bool value
);
toString
static std::string toString(
const std::string & value
);