HydraExpress™ C++ 2020 |
HydraExpress™ C++ API Reference Guide |
Product Documentation: HydraExpress C++ Documentation Home |
Provides a wrapper around any type to hold attribute values. More...
#include <rwsf/core/Attribute.h>
Public Member Functions | |
Attribute () | |
Attribute (const Attribute &rhs) | |
virtual | ~Attribute () |
Attribute & | operator= (const Attribute &rhs) |
Public Member Functions inherited from rwsf::HandleBase | |
bool | isValid (void) const |
bool | operator!= (const HandleBase &second) const |
bool | operator== (const HandleBase &second) const |
Static Public Member Functions | |
template<class T > | |
static T & | value (Attribute &attr) |
template<class T > | |
static const T & | value (const Attribute &attr) |
Related Functions | |
(Note that these are not member functions.) | |
template<class T > | |
void | operator<< (Attribute &attr, const T &value) |
template<class T > | |
void | operator>> (const Attribute &attr, T &value) |
Additional Inherited Members | |
Protected Member Functions inherited from rwsf::HandleBase | |
HandleBase (void) | |
HandleBase (StaticCtor) | |
HandleBase (BodyBase *body) | |
HandleBase (const HandleBase &second) | |
virtual | ~HandleBase (void) |
BodyBase & | body (void) const |
HandleBase & | operator= (const HandleBase &second) |
rwsf::Attribute provides a wrapper around objects of any type. rwsf::Attribute contains a single object by value. The contained object must provide a default constructor, a copy constructor, and an assignment operator. The copy constructor must not invalidate the original object. The class provides an inserter template to copy values into an instance and an extractor template to copy values out of an instance.
An instance of rwsf::Attribute is the value of the key/value pair in several Core and Web Services classes, such as rwsf::CallInfo and rwsf::NamedObject.
Templatized insertion and extraction operators are provided for moving typed objects into and out of an rwsf::Attribute instance.
rwsf::Attribute::Attribute | ( | ) |
Constructs an invalid Attribute instance. A typed object needs to be inserted into this object before it is usable.
rwsf::Attribute::Attribute | ( | const Attribute & | rhs | ) |
Copy constructor. This instance becomes a handle to the same value as rhs. Attaches to and increments the reference count on the body of rhs.
|
virtual |
Destructor. Detaches from the current body (if any), decrements its reference count, and deletes it if there are no other references.
Assignment operator. Results in this instance referencing the same value as rhs.
|
static |
Returns a reference to the typed value held in self. If this attribute does not hold an object of type T
, throws an exception.
|
static |
Returns a const reference to the typed value held in self. If this attribute does not hold an object of type T
, throws an exception.
|
related |
Insertion operator. Inserts a copy of value into attr. Note that T
must be a single object rather than an array, and that the operator uses the exact type of T
. In particular, an attribute cannot hold an array of char
. Instead, use an std::string:
|
related |
Extraction operator. Extracts the value stored in attr and copies it into value. If attr does not contain a value, value is unchanged. Note that the type of value must exactly match the type inserted into attr. Otherwise, the operator throws an exception of type rwsf::Exception.
Copyright © 2020 Rogue Wave Software, Inc. All Rights Reserved. |