Advanced Strategic Command
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
ItemRepository< T > Class Template Reference

#include <itemrepository.h>

Inheritance diagram for ItemRepository< T >:
Inheritance graph
[legend]

Classes

class  RegisterID
 

Public Member Functions

 ItemRepository (const ASCString &typeName_)
 
T * getObject_byPos (int pos) const
 
T * getObject_byID (int id)
 
size_t getNum () const
 
vector< T * > & getVector ()
 
virtual ~ItemRepository ()
 
void addIdTranslation (int from, int to)
 
ASCString getTypeName ()
 

Protected Types

typedef vector< T * > ItemContainerType
 
typedef map< int, T * > ObjectMap
 

Protected Member Functions

void add (T *obj)
 

Protected Attributes

ASCString typeName
 
ItemContainerType container
 
ObjectMap hash
 
map< int, int > idTranslation
 

Friends

class RegisterID
 

Detailed Description

template<class T>
class ItemRepository< T >

Definition at line 57 of file itemrepository.h.

Member Typedef Documentation

template<class T>
typedef vector<T*> ItemRepository< T >::ItemContainerType
protected

Definition at line 61 of file itemrepository.h.

template<class T>
typedef map<int,T*> ItemRepository< T >::ObjectMap
protected

Definition at line 63 of file itemrepository.h.

Constructor & Destructor Documentation

template<class T>
ItemRepository< T >::ItemRepository ( const ASCString typeName_)
inline

Definition at line 82 of file itemrepository.h.

template<class T>
virtual ItemRepository< T >::~ItemRepository ( )
inlinevirtual

Definition at line 101 of file itemrepository.h.

Member Function Documentation

template<class T>
void ItemRepository< T >::add ( T *  obj)
protected
template<class T >
void ItemRepository< T >::addIdTranslation ( int  from,
int  to 
)

Definition at line 134 of file itemrepository.cpp.

References ItemRepository< T >::idTranslation.

template<class T>
size_t ItemRepository< T >::getNum ( ) const
inline
template<class T>
T* ItemRepository< T >::getObject_byID ( int  id)
inline

Definition at line 86 of file itemrepository.h.

Referenced by ItemRepository< ItemType >::getObject_byID().

template<class T>
T* ItemRepository< T >::getObject_byPos ( int  pos) const
inline
template<class T>
ASCString ItemRepository< T >::getTypeName ( )
inline

Definition at line 108 of file itemrepository.h.

Referenced by ItemRepositoryLoader< T >::getTypeName().

template<class T>
vector<T*>& ItemRepository< T >::getVector ( )
inline

Definition at line 100 of file itemrepository.h.

Friends And Related Function Documentation

template<class T>
friend class RegisterID
friend

Definition at line 78 of file itemrepository.h.

Member Data Documentation

template<class T>
ItemContainerType ItemRepository< T >::container
protected
template<class T>
ObjectMap ItemRepository< T >::hash
protected

Definition at line 64 of file itemrepository.h.

Referenced by ItemRepository< ItemType >::getObject_byID().

template<class T>
map<int,int> ItemRepository< T >::idTranslation
protected
template<class T>
ASCString ItemRepository< T >::typeName
protected

Definition at line 59 of file itemrepository.h.

Referenced by ItemRepository< ItemType >::getTypeName().


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