UGDK  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ugdk::structure::IndexableTable< T > Singleton Reference

#include <ugdk/structure/indexabletable.h>

Public Member Functions

 IndexableTable (int expected_size=16)
 
 ~IndexableTable ()
 
size_t size () const
 
void Add (const std::string &name, std::unique_ptr< T > element)
 
bool Remove (const std::string &name)
 Removes the element with the given name. More...
 
T * Search (const std::string &name) const
 Searches for the element with the given name. More...
 
T * Get (int index) const
 Instant access to an element, using a pre-generated ID. More...
 
int MakeIndex (const std::string &name)
 Generates an ID for future instant access. More...
 
bool ReleaseIndex (int id)
 

Static Public Attributes

static const int MAX_NUM_INDEX = 1024
 

Constructor & Destructor Documentation

template<class T >
ugdk::structure::IndexableTable< T >::IndexableTable ( int  expected_size = 16)
inline
template<class T >
ugdk::structure::IndexableTable< T >::~IndexableTable ( )
inline

Member Function Documentation

template<class T >
void ugdk::structure::IndexableTable< T >::Add ( const std::string &  name,
std::unique_ptr< T >  element 
)
inline
template<class T >
T* ugdk::structure::IndexableTable< T >::Get ( int  index) const
inline

Instant access to an element, using a pre-generated ID.

template<class T >
int ugdk::structure::IndexableTable< T >::MakeIndex ( const std::string &  name)
inline

Generates an ID for future instant access.

template<class T >
bool ugdk::structure::IndexableTable< T >::ReleaseIndex ( int  id)
inline
  • id Id to be released.
    Returns
    True on successful release, false otherwise.
template<class T >
bool ugdk::structure::IndexableTable< T >::Remove ( const std::string &  name)
inline

Removes the element with the given name.

Returns
False if element don't exist, true otherwise.
template<class T >
T* ugdk::structure::IndexableTable< T >::Search ( const std::string &  name) const
inline

Searches for the element with the given name.

template<class T >
size_t ugdk::structure::IndexableTable< T >::size ( ) const
inline

Member Data Documentation

template<class T >
const int ugdk::structure::IndexableTable< T >::MAX_NUM_INDEX = 1024
static

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