entity
Entity/Component System for C++
entity::component::destruction_queue< ComponentPool > Class Template Reference

Description

template<typename ComponentPool>
class entity::component::destruction_queue< ComponentPool >

Definition at line 50 of file dense_pool.hpp.

Public Types

typedef ComponentPool::type type
 

Public Member Functions

void clear ()
 
 destruction_queue (ComponentPool &p)
 
void flush ()
 
void push (weak_entity e)
 
 ~destruction_queue ()
 

Member Function Documentation

template<typename ComponentPool >
void entity::component::destruction_queue< ComponentPool >::clear ( )

Definition at line 56 of file destruction_queue.hpp.

Referenced by entity::component::destruction_queue< ComponentPool >::flush().

57  {
58  destroyed_.clear();
59  }
template<typename ComponentPool >
void entity::component::destruction_queue< ComponentPool >::flush ( )

Definition at line 49 of file destruction_queue.hpp.

References entity::component::destruction_queue< ComponentPool >::clear().

Referenced by entity::component::destruction_queue< ComponentPool >::~destruction_queue().

50  {
51  std::sort(destroyed_.begin(), destroyed_.end(), std::greater<weak_entity>());
52  pool_.destroy_range(destroyed_.begin(), destroyed_.end());
53  clear();
54  }
template<typename ComponentPool >
void entity::component::destruction_queue< ComponentPool >::push ( weak_entity  e)

Definition at line 44 of file destruction_queue.hpp.

45  {
46  destroyed_.push_back(e);
47  }

Member Typedef Documentation

template<typename ComponentPool >
typedef ComponentPool::type entity::component::destruction_queue< ComponentPool >::type

Definition at line 33 of file destruction_queue.hpp.

Constructor & Destructor Documentation

template<typename ComponentPool >
entity::component::destruction_queue< ComponentPool >::destruction_queue ( ComponentPool &  p)

Definition at line 35 of file destruction_queue.hpp.

36  : pool_(p)
37  {}
template<typename ComponentPool >
entity::component::destruction_queue< ComponentPool >::~destruction_queue ( )