Siena
C++ API documentation (v. 0.4.3b5)
AttributeValue Class Reference
#include <Siena.h>
List of all members.
Detailed Description
value of an attribute in a notification
An AttributeValue
stores the value of an attribute. Attributes can be of a pre-defined set of types (SXType). AttributeValue
provides methods for accessing and assigning values in the form of C++ types. In particular, an AttributeValue
of type SX_integer
can be assigned to and from an int
, an AttributeValue
of type SX_string
can be assigned to and from a C++ standard string
, etc.
Example:
AttributeValue x, y;
//
// now x.type() == y.type() == SX_null
//
x = true;
y = x;
//
// now x.type() == y.type() == SX_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;
Constructor & Destructor Documentation
AttributeValue::AttributeValue |
( |
|
) |
|
|
AttributeValue::AttributeValue |
( |
const string & |
|
) |
|
|
AttributeValue::AttributeValue |
( |
const char * |
|
) |
|
|
|
construct from a C-style string |
AttributeValue::AttributeValue |
( |
int |
|
) |
|
|
AttributeValue::AttributeValue |
( |
short |
|
) |
|
|
AttributeValue::AttributeValue |
( |
long |
|
) |
|
|
AttributeValue::AttributeValue |
( |
bool |
|
) |
|
|
AttributeValue::AttributeValue |
( |
double |
|
) |
|
|
AttributeValue::~AttributeValue |
( |
|
) |
|
|
Member Function Documentation
const bool& AttributeValue::bool_value |
( |
|
) |
const |
|
|
returns a copy of the value as a boolean
- Exceptions:
-
|
bool& AttributeValue::bool_value |
( |
|
) |
|
|
|
returns a reference to the value as a boolean
- Exceptions:
-
|
const double& AttributeValue::double_value |
( |
|
) |
const |
|
|
returns a copy of the value as a double
- Exceptions:
-
|
double& AttributeValue::double_value |
( |
|
) |
|
|
|
returns a reference to the value as a double
- Exceptions:
-
|
const int32_t& AttributeValue::int_value |
( |
|
) |
const |
|
|
returns a reference to the value as an integer
- Exceptions:
-
|
int32_t& AttributeValue::int_value |
( |
|
) |
|
|
|
returns a reference to the value as an integer
returns a reference to the value as an integer
Example:
AttributeValue x = 20;
cout << x.int_value();
x.int_value()++;
cout << x.int_value();
- Exceptions:
-
|
AttributeValue::operator bool |
( |
|
) |
const |
|
|
conversion operator to bool
- Exceptions:
-
conversion operator to bool |
AttributeValue::operator double |
( |
|
) |
const |
|
|
conversion operator to double
- Exceptions:
-
conversion operator to double |
AttributeValue::operator int |
( |
|
) |
const |
|
|
conversion operator to int
returns a copy of the value as an integer whenever the AttributeValue is used in place of an int .
Example:
AttributeValue x = 20;
int i = x;
- Exceptions:
-
|
AttributeValue::operator long |
( |
|
) |
const |
|
|
conversion operator to long
returns a copy of the value as an integer whenever the AttributeValue is used in place of an int .
Example:
AttributeValue x = 20;
long l = x;
- Exceptions:
-
|
AttributeValue::operator short |
( |
|
) |
const |
|
|
conversion operator to short
returns a copy of the value as an integer whenever the AttributeValue is used in place of an int .
Example:
AttributeValue x = 20;
short s = x;
- Exceptions:
-
|
AttributeValue::operator string |
( |
|
) |
const |
|
|
conversion operator to string
- Exceptions:
-
returns a copy of the value as a string whenever the AttributeValue is used in place of a string .
Example:
AttributeValue x = "Siena";
string s = x;
|
const string& AttributeValue::string_value |
( |
|
) |
const |
|
|
returns a copy of the value as a string
- Exceptions:
-
|
string& AttributeValue::string_value |
( |
|
) |
|
|
|
returns a reference to the value as a string
Example:
AttributeValue x = "ciao";
cout << x.string_value();
x.string_value() += " ciao";
cout << x.string_value();
- Exceptions:
-
|
SXType AttributeValue::type |
( |
|
) |
const |
|
|
returns the actual type of this value |
The documentation for this class was generated from the following file:
Copyright © 2001 University of Colorado.
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.1 or any later version published by the Free Software
Foundation; with no Invariant Sections, no Front-Cover Texts and no
Back-Cover Texts. A copy of the license is included in the section
entitled "GNU Free Documentation License".
This documentation is authored and maintained by
Antonio
Carzaniga