TypeID Class Template Reference

TypeID is a mixin-base class for defining ID types. More...

#include <type_id.hpp>

Inheritance diagram for TypeID:

ElementType List of all members.

Public Types

typedef TypeID< T, V > self_type

Public Member Functions

 TypeID (self_type const &src)
 ~TypeID ()
 The destructor for this class is intentionally non-virtual.
 operator V () const
 Implicit conversion to value type.
bool operator== (self_type const &rhs) const
bool operator!= (self_type const &rhs) const
bool operator< (self_type const &rhs) const
bool operator<= (self_type const &rhs) const
bool operator> (self_type const &rhs) const
bool operator>= (self_type const &rhs) const
self_typeoperator= (self_type const &rhs)

Protected Member Functions

 TypeID (V value)
void increment ()
void decrement ()

Friends

std::ostream & operator<< (std::ostream &os, self_type const &t)

Detailed Description

template<typename T, typename V = int>
class BTK::UTILITY::TypeID< T, V >

TypeID is a mixin-base class for defining ID types.

It is frequently a pain to define a new ID type for a given purpose, because a number of operators and constructors need to be written for each ID type. This class is a tool to speed up this process. Essentially, the author of a new ID type need only derive from this class, with the new ID type as the first template parameter.


Member Typedef Documentation

typedef TypeID<T,V> self_type


Constructor & Destructor Documentation

TypeID ( self_type const &  src  ) 

~TypeID (  ) 

The destructor for this class is intentionally non-virtual.

TypeID is intended to be a lightweight class. Vtables are inappropriate.

TypeID ( value  )  [protected]


Member Function Documentation

operator V (  )  const

Implicit conversion to value type.

bool operator== ( self_type const &  rhs  )  const

bool operator!= ( self_type const &  rhs  )  const

bool operator< ( self_type const &  rhs  )  const

bool operator<= ( self_type const &  rhs  )  const

bool operator> ( self_type const &  rhs  )  const

bool operator>= ( self_type const &  rhs  )  const

self_type& operator= ( self_type const &  rhs  ) 

void increment (  )  [protected]

void decrement (  )  [protected]


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
self_type const &  t 
) [friend]


The documentation for this class was generated from the following file:
Generated on Sun Jul 15 20:46:43 2007 for BTK Core by  doxygen 1.5.1