value of an attribute in a notification
AnAttributeValue
stores the value of an attribute. Attributes can be of a pre-defined set of types (SienaType).AttributeValue
provides methods for accessing and assigning values in the form of C++ types. In particular, anAttributeValue
of typeSiena_integer
can be assigned to and from anint
, anAttributeValue
of typeSiena_string
can be assigned to and from a C++ standardstring
, etc.Example:
AttributeValue x, y; // // now x.type() == y.type() == Siena_null // x = true; y = x; // // now x.type() == y.type() == Siena_bool // int i = 10; if (x.bool_value()) y = i + 10; x = i + 20; cout << x.int_value() + y.int_value() << endl; i = x; y = "ciao"; cout << y.string_value() << endl;
AttributeValue(const AttributeValue &v)
AttributeValue(const string &)
AttributeValue(const char *)
AttributeValue(int)
int
Example:
Example:
Example:
Example:
int& int_value()
AttributeValue x = 20;
cout << x.int_value();
x.int_value()++;
cout << x.int_value();
type() != Siena_integer
string& string_value()
AttributeValue x = "ciao";
cout << x.string_value();
x.string_value() += " ciao";
cout << x.string_value();
type() != Siena_string
operator int () const
AttributeValue
is used in place of an
int
.
AttributeValue x = 20;
int i = x;
type() != Siena_int
operator string () const
AttributeValue
is used in place of an
int
.
AttributeValue x = "Siena";
string s = x;
type() != Siena_string
Alphabetic index HTML hierarchy of classes or Java