rwsf::Attributerwsf::HandleBase
#include rwsf/core/Attribute.h
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 HydraSCA Core and Web Services Fabrication classes, such as rwsf::CallInfo and rwsf::NamedObject.
rwsf::Attribute makes use of the handle/body idiom in which rwsf::Attribute is the handle, and rwsf::AttributeImp is the body.
Templatized insertion and extraction operators are provided for moving typed objects into and out of an rwsf::Attribute instance.
Lifetime { Transient, Persistent }
Constructs an invalid instance of rwsf::Attribute, with a default lifetime of Transient. Using the insertion operator, a typed object must be inserted into this object before it is usable.
Attribute(Lifetime l = Transient);
Constructs an invalid Attribute instance, with a default lifetime of Transient. A typed object will need to be inserted into this object before it is usable.
Attribute(const Attribute & rhs);
Copy constructor. This instance will be a handle to the same value as rhs..Attaches to and increments the reference count on rhs's body.
virtual ~Attribute();
Destructor. Detaches from the current body (if any), decrements its reference count, and deletes it if there are no other references.
T & value(Attribute & attr);
Returns a reference to the typed value held in self. If this attribute does not hold an object of type T, an exception is thrown.
const T & value(const Attribute & attr);
Returns a const reference to the typed value held in self. If this attribute does not hold an object of type T, an exception is thrown.
bool isTransient() const;
Returns true if self is transient. Otherwise, returns false.
void setTransient(bool isTransient);
Determines whether this rwsf::Attribute is transient or persistent. The default is true (transient).
Attribute & operator=(const Attribute & rhs);
Assignment operator. This instance will hold the same value as rhs.
© Copyright Rogue Wave Software, Inc. All Rights Reserved. All Rights Reserved. Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. HydraExpress is a trademark of Rogue Wave Software, Inc. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.