Reference< RC > Class Template Reference

This class is can be used like a pointer to RC objects. More...

#include <refcounter_decls.h>

List of all members.

Public Member Functions

 Reference (RC *obj)
 Constructs a Reference from a RefCounter object created using new.
 Reference (const Reference &other)
 This is a normal copy constructor needed for reference counting.
Reference< RC > & operator= (RC *obj)
 Assigns a RefCounter reference to this Reference.
Reference< RC > & operator= (const Reference &other)
 This is a normal assignment operator needed for reference counting.
bool operator== (const Reference &other) const
 Checks whether this and other reference the same object.
bool operator!= (const Reference &other) const
 Checks whether this and other reference the same object.
RC & operator * () const
 Returns the RefCounter derived object referenced.
RC * operator-> () const
 Returns the RefCounter derived object referenced.
 ~Reference ()
 This destructor is needed for reference counting.

Friends

class WeakReference< RC >


Detailed Description

template<class RC>
class Reference< RC >

This class is can be used like a pointer to RC objects.

RC must be derived from RefCounter.


Constructor & Destructor Documentation

template<class RC>
Reference< RC >::Reference ( RC *  obj  )  [inline]

Constructs a Reference from a RefCounter object created using new.

Parameters:
obj is the object to reference

template<class RC>
Reference< RC >::Reference ( const Reference< RC > &  other  )  [inline]

This is a normal copy constructor needed for reference counting.

Parameters:
other is the object to "copy"


Member Function Documentation

template<class RC>
Reference< RC > & Reference< RC >::operator= ( RC *  obj  )  [inline]

Assigns a RefCounter reference to this Reference.

Parameters:
obj is the object to reference
Returns:
*this

template<class RC>
Reference< RC > & Reference< RC >::operator= ( const Reference< RC > &  other  )  [inline]

This is a normal assignment operator needed for reference counting.

Parameters:
other is the object to "copy"
Returns:
*this

template<class RC>
bool Reference< RC >::operator== ( const Reference< RC > &  other  )  const [inline]

Checks whether this and other reference the same object.

Parameters:
other is the Reference to compare to
Returns:
true if the references are equal, false otherwise

template<class RC>
bool Reference< RC >::operator!= ( const Reference< RC > &  other  )  const [inline]

Checks whether this and other reference the same object.

Parameters:
other is the Reference to compare to
Returns:
true if the references are differ, false otherwise

template<class RC>
RC & Reference< RC >::operator * (  )  const [inline]

Returns the RefCounter derived object referenced.

Returns:
the object referenced

template<class RC>
RC * Reference< RC >::operator-> (  )  const [inline]

Returns the RefCounter derived object referenced.

Returns:
a pointer to the object referenced


The documentation for this class was generated from the following files:
Generated on Sat Feb 7 01:26:51 2009 by  doxygen 1.5.1