RefCountingPointer< T > Class Template Reference

#include <RefCountingPointer.h>

List of all members.

Public Member Functions

T & operator* () const
T * operator-> () const
 operator void * () const
bool operator! () const
 RefCountingPointer (T *ptr)
template<typename U >
 RefCountingPointer (RefCountingPointer< U > ptr)

Public Attributes

T * ptr_

Detailed Description

template<typename T>
class oasis::sca::RefCountingPointer< T >

A smart pointer class that holds a real (dumb) pointer to the object. If the reference counting pointer is copied, then a duplicate pointer is returned with the same real pointer. A reference count within the object is incremented for each copy of the pointer, so only when all pointers go out of scope will the object be freed.


Member Function Documentation

operator void * (  )  const [inline]

Used to determine if the underlying pointer is set, i.e. if (p)

Returns:
Zero if the underlying pointer is null, otherwise a non-zero value.
bool operator! (  )  const [inline]

Used to determine if the underlying pointer is not set, i.e. if (!p)

Returns:
A non-zero value if the underlying pointer is null, otherwise zero.
T& operator* (  )  const [inline]

Dereferences the underlying pointer

Returns:
A reference to the value of the pointer.
Exceptions:
SCANullPointerException if the pointer is NULL
T* operator-> (  )  const [inline]

Used to invoke member functions on the underlying pointer. This is equivalent to invoking p->func() where func() is a member function defined on the underlying pointer type.

Exceptions:
SCANullPointerException if the pointer is NULL

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

Service Component Architecture (SCA) Version 1.1 C++ API, CD05 March 2010  doxygen