Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
EntityMap< T > Class Template Reference

A fast replacement for map<entity_id_t, T>. More...

#include <EntityMap.h>

Collaboration diagram for EntityMap< T >:

Classes

struct  _iter
 
struct  key_val
 

Public Types

typedef entity_id_t key_type
 
typedef T mapped_type
 
typedef key_val< entity_id_t, Tvalue_type
 
typedef _iter< value_typeiterator
 
typedef _iter< value_type const > const_iterator
 

Public Member Functions

 EntityMap ()
 
 ~EntityMap ()
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
bool empty () const
 
size_t size () const
 
void insert (const key_type key, const mapped_type &value)
 
void erase (iterator it)
 
void erase (const entity_id_t key)
 
void clear ()
 
iterator find (const entity_id_t key)
 
const_iterator find (const entity_id_t key) const
 
size_t count (const entity_id_t key) const
 

Private Member Functions

 EntityMap (const EntityMap &)
 
EntityMapoperator= (const EntityMap &)
 

Private Attributes

size_t m_BufferSize
 
size_t m_BufferCapacity
 
value_typem_Buffer
 
size_t m_Count
 

Detailed Description

template<class T>
class EntityMap< T >

A fast replacement for map<entity_id_t, T>.

We make the following assumptions:

  • entity id's (keys) are unique
  • modifications (add / delete) are far less frequent then look-ups
  • preformance for iteration is important

Member Typedef Documentation

◆ const_iterator

template<class T >
typedef _iter<value_type const> EntityMap< T >::const_iterator

◆ iterator

template<class T >
typedef _iter<value_type> EntityMap< T >::iterator

◆ key_type

template<class T >
typedef entity_id_t EntityMap< T >::key_type

◆ mapped_type

template<class T >
typedef T EntityMap< T >::mapped_type

◆ value_type

template<class T >
typedef key_val<entity_id_t, T> EntityMap< T >::value_type

Constructor & Destructor Documentation

◆ EntityMap() [1/2]

template<class T >
EntityMap< T >::EntityMap ( const EntityMap< T > &  )
private

◆ EntityMap() [2/2]

template<class T >
EntityMap< T >::EntityMap ( )
inline

◆ ~EntityMap()

template<class T >
EntityMap< T >::~EntityMap ( )
inline

Member Function Documentation

◆ begin() [1/2]

template<class T >
iterator EntityMap< T >::begin ( )
inline

◆ begin() [2/2]

template<class T >
const_iterator EntityMap< T >::begin ( ) const
inline

◆ clear()

template<class T >
void EntityMap< T >::clear ( )
inline

◆ count()

template<class T >
size_t EntityMap< T >::count ( const entity_id_t  key) const
inline

◆ empty()

template<class T >
bool EntityMap< T >::empty ( ) const
inline

◆ end() [1/2]

template<class T >
iterator EntityMap< T >::end ( )
inline

◆ end() [2/2]

template<class T >
const_iterator EntityMap< T >::end ( ) const
inline

◆ erase() [1/2]

template<class T >
void EntityMap< T >::erase ( const entity_id_t  key)
inline

◆ erase() [2/2]

template<class T >
void EntityMap< T >::erase ( iterator  it)
inline

◆ find() [1/2]

template<class T >
iterator EntityMap< T >::find ( const entity_id_t  key)
inline

◆ find() [2/2]

template<class T >
const_iterator EntityMap< T >::find ( const entity_id_t  key) const
inline

◆ insert()

template<class T >
void EntityMap< T >::insert ( const key_type  key,
const mapped_type value 
)
inline

◆ operator=()

template<class T >
EntityMap & EntityMap< T >::operator= ( const EntityMap< T > &  )
private

◆ size()

template<class T >
size_t EntityMap< T >::size ( ) const
inline

Member Data Documentation

◆ m_Buffer

template<class T >
value_type* EntityMap< T >::m_Buffer
private

◆ m_BufferCapacity

template<class T >
size_t EntityMap< T >::m_BufferCapacity
private

◆ m_BufferSize

template<class T >
size_t EntityMap< T >::m_BufferSize
private

◆ m_Count

template<class T >
size_t EntityMap< T >::m_Count
private

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