ucc::object_value< T, O > Class Template Reference

Template for embedding a data structure into a reference counted object. More...

#include <object.h>

Inherits O.


Public Member Functions

 object_value ()
 Construct composite value object.
 object_value (T &existing)
 Construct composite value object and assign from existing data value.
T & operator* ()
 Pointer reference to embedded data value.
void operator= (const T &data)
 Assign embedded data value.
 operator T ()
 Retrieve data value by casting reference.
T & operator() ()
 Retrieve data value by expression reference.
void operator() (T &data)
 Set data value by expression reference.

Data Fields

value
 Embedded data value.

Protected Member Functions

void set (const T &object)
 Assign our value from a typed data object.


Detailed Description

template<class T, class O = CountedObject>
class ucc::object_value< T, O >

Template for embedding a data structure into a reference counted object.

This is a convenient means to create reference counted heap managed data structure. This template can be used for embedding data into other kinds of managed object classes in addition to reference counting. For example, it can be used to embed a data structure into a linked list, as shown in the linked_value template.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 408 of file object.h.


Constructor & Destructor Documentation

template<class T, class O = CountedObject>
ucc::object_value< T, O >::object_value ( T &  existing  )  [inline]

Construct composite value object and assign from existing data value.

Parameters:
existing typed value to assign.

Definition at line 430 of file object.h.


Member Function Documentation

template<class T, class O = CountedObject>
ucc::object_value< T, O >::operator T (  )  [inline]

Retrieve data value by casting reference.

Returns:
embedded value.

Definition at line 451 of file object.h.

template<class T, class O = CountedObject>
void ucc::object_value< T, O >::operator() ( T &  data  )  [inline]

Set data value by expression reference.

Parameters:
data value to assign.

Definition at line 465 of file object.h.

template<class T, class O = CountedObject>
T& ucc::object_value< T, O >::operator() ( void   )  [inline]

Retrieve data value by expression reference.

Returns:
embedded value.

Definition at line 458 of file object.h.

template<class T, class O = CountedObject>
T& ucc::object_value< T, O >::operator* (  )  [inline]

Pointer reference to embedded data value.

Returns:
embedded value.

Definition at line 437 of file object.h.

template<class T, class O = CountedObject>
void ucc::object_value< T, O >::operator= ( const T &  data  )  [inline]

Assign embedded data value.

Parameters:
data value to assign.

Reimplemented in ucc::named_value< T, O >, and ucc::linked_value< T, O >.

Definition at line 444 of file object.h.

template<class T, class O = CountedObject>
void ucc::object_value< T, O >::set ( const T &  object  )  [inline, protected]

Assign our value from a typed data object.

This is a helper method.

Parameters:
object to assign our value from.

Definition at line 415 of file object.h.


The documentation for this class was generated from the following file:

Generated on Wed May 13 09:11:38 2009 for UCommon by  doxygen 1.5.8