IT_Bus::Var< T > Class Template Reference

#include <it_bus/var.h>

List of all members.


Detailed Description

template<class T>
class IT_Bus::Var< T >

Smart pointer to a reference counted object.

The class IT_AutoPtr, described in it_cal/auto_ptr.h, is a smart pointer for non-reference counted objects.

Definition at line 18 of file var.h.

Public Member Functions

 Var (T *ptr) throw (())
 Constructor.
 Var (const Var< T > &ptr) throw (())
 Constructor.
 Var () throw (())
 No argument constructor.
 ~Var () throw (())
 Destructor.
T * operator-> () const throw (())
 Arrow operator.
T & operator * () const throw (())
 Dereferencing operator.
T * get () const throw (())
 Get the pointer but do not give up ownership.
T * release () throw (())
 Release the reference, giving up responsibility for calling _remove_ref to the caller.
Var< T > & operator= (const Var< T > &ptr) throw (())
 Assignment operator.
Var< T > & operator= (T *ptr) throw (())
 Assignment operator.
 operator T * () const
 Return the encapsulated T pointer.

Private Attributes

T * m_ptr


Constructor & Destructor Documentation

template<class T>
IT_Bus::Var< T >::Var ( T *  ptr  )  throw (()) [inline]

Constructor.

Parameters:
A pointer to the object.

Definition at line 26 of file var.h.

template<class T>
IT_Bus::Var< T >::Var ( const Var< T > &  ptr  )  throw (()) [inline]

Constructor.

Parameters:
A reference to another Var instance. Increments the reference count on the object.

Definition at line 38 of file var.h.

template<class T>
IT_Bus::Var< T >::~Var (  )  throw (()) [inline]

Destructor.

Decrements the reference count on the object.

Definition at line 62 of file var.h.


Member Function Documentation

template<class T>
T* IT_Bus::Var< T >::operator-> (  )  const throw (()) [inline]

Arrow operator.

Returns:
A pointer to the object.

Definition at line 77 of file var.h.

template<class T>
T& IT_Bus::Var< T >::operator * (  )  const throw (()) [inline]

Dereferencing operator.

Returns:
A reference to the object.

Definition at line 89 of file var.h.

template<class T>
T* IT_Bus::Var< T >::get (  )  const throw (()) [inline]

Get the pointer but do not give up ownership.

Do not reduce the reference count on the object.

Returns:
A pointer to the object.

Definition at line 102 of file var.h.

Referenced by IT_Bus::const_cast_var(), IT_Bus::dynamic_cast_var(), IT_Bus::Var< T >::operator T *(), and IT_Bus::static_cast_var().

template<class T>
T* IT_Bus::Var< T >::release (  )  throw (()) [inline]

Release the reference, giving up responsibility for calling _remove_ref to the caller.

Set internal pointer to 0 since it no longer points to a valid reference; do not reduce the reference count on the object.

Returns:
A pointer to the object.

Definition at line 117 of file var.h.

template<class T>
Var<T>& IT_Bus::Var< T >::operator= ( const Var< T > &  ptr  )  throw (()) [inline]

Assignment operator.

Parameters:
A reference to a Var instance.
Returns:
A reference to the Var instance.

Definition at line 132 of file var.h.

template<class T>
Var<T>& IT_Bus::Var< T >::operator= ( T *  ptr  )  throw (()) [inline]

Assignment operator.

Parameters:
A pointer to the object.
Returns:
A reference to the Var.

Definition at line 158 of file var.h.

template<class T>
IT_Bus::Var< T >::operator T * (  )  const [inline]

Return the encapsulated T pointer.

Returns:
Pointer to T.

Definition at line 176 of file var.h.

References IT_Bus::Var< T >::get().


Generated on Tue Mar 20 15:28:09 2007 for Artix by  doxygen 1.5.1-p1