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

TSub< T, Arg > Class Template Reference

This is a container class that can hold a class of yours or a class that may wish to be overridden by a subtype. More...

#include <refclass.h>

Collaboration diagram for TSub< T, Arg >:

Collaboration graph
[legend]
List of all members.

Public Methods

 TSub (const Arg &a)
 The Constructor of TSub requires an 'a' class to be called-- Dereferences Function Pointer construct_T. More...

void Deallocate ()
 This deallocate function deletes T. More...

T * operator-> ()
 Ye olde dereferencing functions. More...

const T * operator-> () const
 Ye olde dereferencing functions. More...

const T * operator * () const
 Ye olde dereferencing functions. More...

T * operator * ()
 Ye olde dereferencing functions. More...

bool operator== (const TSub< T, Arg > &a) const
bool operator< (const TSub< T, Arg > &a) const

Static Public Methods

T * Default_T_Construct (const Arg &a)
 This is the default T to be constructed given an a. This function may be changed. More...


Public Attributes

T * t
 This is the variable that actually holds t. More...

int refcount
 This variable stores the reference count. More...

T * t

Static Public Attributes

T *(* construct_T )(const Arg &a)
 This is the function pointer that points to potentially any T constructor. Care should be taken to set this before making new TSub classes. More...


Detailed Description

template<class T, class Arg>
class TSub< T, Arg >

This is a container class that can hold a class of yours or a class that may wish to be overridden by a subtype.


Constructor & Destructor Documentation

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

The Constructor of TSub requires an 'a' class to be called-- Dereferences Function Pointer construct_T.

00053                          {
00054         t = (*construct_T)(a);
00055         refcount=0;
00056     }


Member Function Documentation

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

This deallocate function deletes T.

00058                       {
00059         if (t){
00060             delete t;
00061             t=0;
00062         }
00063     }

template<class T, class Arg>
T* TSub< T, Arg >::Default_T_Construct const Arg &    a [inline, static]
 

This is the default T to be constructed given an a. This function may be changed.

00049 {return new T (a);}

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

Ye olde dereferencing functions.

00071 {return t;}

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

Ye olde dereferencing functions.

00069 {return t;}

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

Ye olde dereferencing functions.

00067 {return t;}

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

Ye olde dereferencing functions.

00065 {return t;}

template<class T, class Arg>
bool TSub< T, Arg >::operator< const TSub< T, Arg > &    a const [inline]
 

00075                                                  {
00076         return t<*a;
00077     }

template<class T, class Arg>
bool TSub< T, Arg >::operator== const TSub< T, Arg > &    a const [inline]
 

00072                                                    {
00073         return t==*a;
00074     }


Member Data Documentation

template<class T, class Arg>
T*(* TSub< T, Arg >::construct_T)(const Arg &a) [static]
 

This is the function pointer that points to potentially any T constructor. Care should be taken to set this before making new TSub classes.

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

This variable stores the reference count.

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

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

This is the variable that actually holds 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