Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

TRef< T, Arg > Class Template Reference

#include <refclass.h>

Collaboration diagram for TRef< T, Arg >:

Collaboration graph
[legend]
List of all members.

Public Methods

 TRef (const Arg &a)
 Constructor that takes in an argument and passes it to T. More...

T * operator-> ()
 Dereferences our good variable. More...

const T * operator-> () const
 Dereferences our good variable constly. More...

const T * operator * () const
 Same dereference. More...

T * operator * ()
 Same Dereference. More...

void Deallocate ()
 Deallocates this class before calling the destructor. More...


Public Attributes

int refcount
 The reference count of TRef. Has to be mutable so that the copy constructor works. More...

T * t

Detailed Description

template<class T, class Arg>
class TRef< T, Arg >

This class is a simple way to keep track of many objects which share their arguments This is the default type that would reside within a RefClass. It actually inherits from the class involved, thus it may not have any subclassage The advantage is that it needs less dereferencing.


Constructor & Destructor Documentation

template<class T, class Arg>
TRef< T, Arg >::TRef const Arg &    a [inline]
 

Constructor that takes in an argument and passes it to T.

00020 :T(a){refcount=0;}


Member Function Documentation

template<class T, class Arg>
void TRef< T, Arg >::Deallocate   [inline]
 

Deallocates this class before calling the destructor.

00030 {}

template<class T, class Arg>
T* TRef< T, Arg >::operator *   [inline]
 

Same Dereference.

00028 {return this;}

template<class T, class Arg>
const T* TRef< T, Arg >::operator *   const [inline]
 

Same dereference.

00026 {return this;}

template<class T, class Arg>
const T* TRef< T, Arg >::operator->   const [inline]
 

Dereferences our good variable constly.

00024 {return this;}

template<class T, class Arg>
T* TRef< T, Arg >::operator->   [inline]
 

Dereferences our good variable.

00022 {return this;}


Member Data Documentation

template<class T, class Arg>
int TRef< T, Arg >::refcount
 

The reference count of TRef. Has to be mutable so that the copy constructor works.

template<class T, class Arg>
T* TRef< T, Arg >::t
 


The documentation for this class was generated from the following files:
Generated on Mon Jul 7 21:13:56 2003 for Ethereal by doxygen1.2.15