Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# TAO_Object_Manager< T, T_var > Class Template Reference

Manager for Objects. More...

`#include <Sequence_T.h>`

Collaboration diagram for TAO_Object_Manager< T, T_var >:

[legend]
List of all members.

## Public Methods
| TAO_Object_Manager (const TAO_Object_Manager< T, T_var > &rhs)
| TAO_Object_Manager (T **, CORBA::Boolean release)
| ~TAO_Object_Manager (void)
| Destructor, only releases the object if <release_> is true.
TAO_Object_Manager< T, T_var > & | operator= (const TAO_Object_Manager< T, T_var > &rhs)
TAO_Object_Manager< T, T_var > & | operator= (T *)
| Assignment from T *.
TAO_Object_Manager< T, T_var > & | operator= (const T_var &)
| Assignment from T_life.
T * | operator-> (void) const
| Return pointer.
| operator const T * () const
| Cast (read-only).
| operator T *& ()
| Cast.
| operator const T_var () const
T * | in (void) const
| for in parameter.
T *& | inout (void)
| for inout parameter.
T *& | out (void)
| for out parameter.
T * | _retn (void)
| for return type
## Private Attributes
T ** | ptr_
CORBA::Boolean | release_
| release flag based on parent's flag

## Detailed Description

### template<typename T, typename T_var>
class TAO_Object_Manager< T, T_var >

Manager for Objects.

The mapping for sequences of objects (and other pseudo objects) requires an auxiliar class or <Manager> to handle the reference count on the object, (a kind of smart pointer). The main difference with respect to T_var classes is that automatic release is not controlled on a per-item basis, but for the sequence as a whole. Further the class must implement "transparent" assignment into the sequence, for instance, operator[] returns a managed object, but: object_sequence[i] = foo; must change the state of the sequence. This class implements the generic object manager and is used to instantiate the proper sequence types. = NOTES It has been proposed that the class should be parametric on both T and T_ptr, IMHO this is no necesary: though the IDL spec says that T_ptr *could* map to a type different to T* in the particular case of TAO it does map to <T*>.

## Constructor & Destructor Documentation

template<typename T, typename T_var>
ACE_INLINE TAO_Object_Manager< T, T_var >::TAO_Object_Manager | ( | const TAO_Object_Manager< T, T_var > & | rhs | ) |

| Copy constructor, the semantics are non-trivial: + The referenced element is duplicated or not according to the release value on the <rhs>. + In any case a new reference to the same object is created.

template<typename T, typename T_var>
ACE_INLINE TAO_Object_Manager< T, T_var >::TAO_Object_Manager | ( | T ** | ,
|  | CORBA::Boolean | release
| ) |

| Constructor from address of an element, it should be private and only TAO_*_Object_Sequence would use it, but we have some problems with friendship and templates.

template<typename T, typename T_var>
ACE_INLINE TAO_Object_Manager< T, T_var >::~TAO_Object_Manager | ( | void |  | ) |

| Destructor, only releases the object if <release_> is true.

## Member Function Documentation

template<typename T, typename T_var>
T * TAO_Object_Manager< T, T_var >::_retn | ( | void |  | ) |

| for return type

template<typename T, typename T_var>
ACE_INLINE T * TAO_Object_Manager< T, T_var >::in | ( | void |  | ) | const

| for in parameter.

template<typename T, typename T_var>
ACE_INLINE T *& TAO_Object_Manager< T, T_var >::inout | ( | void |  | ) |

| for inout parameter.

template<typename T, typename T_var>
ACE_INLINE TAO_Object_Manager< T, T_var >::operator const T * | ( |  | ) |

| Cast (read-only).

template<typename T, typename T_var>
ACE_INLINE TAO_Object_Manager< T, T_var >::operator const T_var | ( |  | ) |

| Cast (read-only) so that assignment from a structured type to a T_var will make a copy.

template<typename T, typename T_var>
ACE_INLINE TAO_Object_Manager< T, T_var >::operator T *& | ( |  | ) |

| Cast.

template<typename T, typename T_var>
ACE_INLINE T * TAO_Object_Manager< T, T_var >::operator-> | ( | void |  | ) | const

| Return pointer.

template<typename T, typename T_var>
TAO_Object_Manager< T, T_var > & TAO_Object_Manager< T, T_var >::operator= | ( | const T_var & |  | ) |

| Assignment from T_life.

template<typename T, typename T_var>
TAO_Object_Manager< T, T_var > & TAO_Object_Manager< T, T_var >::operator= | ( | T * |  | ) |

| Assignment from T *.

template<typename T, typename T_var>
TAO_Object_Manager< T, T_var > & TAO_Object_Manager< T, T_var >::operator= | ( | const TAO_Object_Manager< T, T_var > & | rhs | ) |

| Assignment from another managed type, only release if <this->release_> is true. @ TODO what happens if rhs.release_ is true an this->relase_ is false?

template<typename T, typename T_var>
T *& TAO_Object_Manager< T, T_var >::out | ( | void |  | ) |

| for out parameter.

## Member Data Documentation

template<typename T, typename T_var>
T** TAO_Object_Manager< T, T_var >::ptr_`[private]`

| data member, notice that it is a pointer, to implement the reference behavior for assignment.

template<typename T, typename T_var>
CORBA::Boolean TAO_Object_Manager< T, T_var >::release_`[private]`

| release flag based on parent's flag

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

- Sequence_T.h
- Sequence_T.cpp
- Sequence_T.i