LeechCraft  %{LEECHCRAFT_VERSION}
Modular cross-platform feature rich live environment.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LeechCraft::Util::IDPool< T > Class Template Reference

A simple pool of identificators of the given type. More...

#include "idpool.h"

+ Inheritance diagram for LeechCraft::Util::IDPool< T >:

Public Member Functions

void SetID (T id)
 Forcefully sets the current ID. More...
 
void FreeID (T)
 Frees the id. More...
 
QByteArray SaveState () const
 Saves the state of this pool. More...
 
void LoadState (const QByteArray &state)
 Recovers the state of this pool. More...
 

Public Attributes

 __pad0__: CurrentID_ (id) { } virtual ~IDPool () { } T GetID () { return ++CurrentID_
 Creates a pool with the given initial value. More...
 

Detailed Description

template<typename T>
class LeechCraft::Util::IDPool< T >

A simple pool of identificators of the given type.

This class holds a pool of identificators of the given type T. It is very simple and produces consecutive IDs, this T should support operator++().

Definition at line 49 of file idpool.h.

Member Function Documentation

template<typename T>
void LeechCraft::Util::IDPool< T >::FreeID ( )
inline

Frees the id.

Parameters
[in]idThe ID to free.

Definition at line 90 of file idpool.h.

template<typename T>
void LeechCraft::Util::IDPool< T >::LoadState ( const QByteArray &  state)
inline

Recovers the state of this pool.

Parameters
[in]stateThe state of this pool obtained from SaveState().

Definition at line 115 of file idpool.h.

template<typename T>
QByteArray LeechCraft::Util::IDPool< T >::SaveState ( ) const
inline

Saves the state of this pool.

Returns
The serialized state of this pool.

Definition at line 98 of file idpool.h.

template<typename T>
void LeechCraft::Util::IDPool< T >::SetID ( id)
inline

Forcefully sets the current ID.

Parameters
[in]idThe new current ID.

Definition at line 81 of file idpool.h.

Member Data Documentation

template<typename T>
LeechCraft::Util::IDPool< T >::__pad0__

Creates a pool with the given initial value.

Parameters
[in]idThe initial value of the pool.

Definition at line 74 of file idpool.h.


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