UniqueIndex< T > Class Template Reference
[Classes for basic data types and vectors/arrays (tjutils library)]

#include <tjindex.h>

Inheritance diagram for UniqueIndex< T >:

Inheritance graph
[legend]
Collaboration diagram for UniqueIndex< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 UniqueIndex ()
 UniqueIndex (const UniqueIndex< T > &)
UniqueIndex< T > & operator= (const UniqueIndex< T > &)
 ~UniqueIndex ()
unsigned int get_index () const

Detailed Description

template<class T>
class UniqueIndex< T >

This template class provides a unique index, i.e. an unique unsigned integer number for all instances of the (derived) class. A new index for the object is created whenever a call to 'get_index()' is issued the first time. The assigned index is removed from the list of assigned indices if the object is destroyed. Please note that the index of temporary objects is deleted from the list of indices, even it is assigned to another object. The class T must have two static member functions, 'get_typename()' and 'get_max_instances()' to return a unique label and the maximum number of instances per class, respectively.

Definition at line 92 of file tjindex.h.


Member Function Documentation

template<class T>
unsigned int UniqueIndex< T >::get_index (  )  const [inline]

Returns a unique index for this object.

Definition at line 107 of file tjindex.h.


The documentation for this class was generated from the following file:
Generated on Sat Jun 14 12:32:52 2008 by  doxygen 1.5.1