pgID Class Reference
[pgGen -- General purpose module]

A unique value to identify objects. More...

#include <pg_id.h>

List of all members.

Public Member Functions

 pgDefineException (ExceptionInvalidArgument)
 pgDefineException (ExceptionOutOfID)
 pgID ()
 Constructs and initializes a pgID to pgID::ZERO.
bool operator== (pgID id) const
 Returns whether this pgID is equal to the right hand side pgID.
bool operator!= (pgID id) const
 Returns whether this pgID is unequal to the right hand side pgID.
u32 operator% (u32 n) const
 Returns the remainder of the value of this pgID devided by the specified value.
u32 getValue () const
 Returns the value of this pgID.

Static Public Member Functions

static pgID genID ()
 Generates a unique pgID.
static pgID genID (const char *str)
 Generates a pgID whose value is generated from the specified string.
static pgID genIDForSystem (u32 value)
 Generates a pgID from the specified value.
static void setCurIDForSystem (u32 value)
 Sets the value, which is used to generate the next pgID, to the specified value.

Static Public Attributes

static const pgID ZERO
 The initial id.


Detailed Description

A unique value to identify objects.

Member Function Documentation

static pgID pgID::genID ( const char *  str  )  [static]

Generates a pgID whose value is generated from the specified string.

There may be rare occations when the same value is generated from different strings.

Parameters:
[in] str The seed of a unique value.
Returns:
A pgID.

static pgID pgID::genID (  )  [static]

Generates a unique pgID.

Returns:
A unique pgID.

static pgID pgID::genIDForSystem ( u32  value  )  [static]

Generates a pgID from the specified value.

This method is only for system.

Parameters:
[in] value The value of the pgID to be generated.
Returns:
A pgID.

u32 pgID::getValue (  )  const

Returns the value of this pgID.

Returns:
The value of this pgID.

bool pgID::operator!= ( pgID  id  )  const

Returns whether this pgID is unequal to the right hand side pgID.

Parameters:
[in] id The right hand side pgID.
Returns:
Whether this pgID is unequal to the right hand side pgID.

u32 pgID::operator% ( u32  n  )  const

Returns the remainder of the value of this pgID devided by the specified value.

This method is used when pgID is used as the key type of pgMap.

Parameters:
[in] n A value to devide the value of pgID.
Returns:
The remainder of the value of this pgID devided by the specified value.

bool pgID::operator== ( pgID  id  )  const

Returns whether this pgID is equal to the right hand side pgID.

Parameters:
[in] id The right hand side pgID.
Returns:
Whether this pgID is equal to the right hand side pgID.

static void pgID::setCurIDForSystem ( u32  value  )  [static]

Sets the value, which is used to generate the next pgID, to the specified value.

This method is only for system.

Parameters:
[in] value A value which is used to generate the next pgID.


Member Data Documentation

const pgID pgID::ZERO [static]

The initial id.


The documentation for this class was generated from the following file:

Generated on Sat Aug 15 11:24:38 2009 for Pogolyn by  doxygen 1.5.8