Hymn to Beauty
C++ 3D Engine
ComponentContainer< C > Class Template Reference

Stores components. More...

#include <ComponentContainer.hpp>

Public Member Functions

 ComponentContainer ()
 Create new component container. More...
 
 ~ComponentContainer ()
 Destructor. More...
 
C * Create ()
 Create a new component. More...
 
void ClearKilled ()
 Clear all killed components. More...
 
void ClearKilled (const std::function< void(C *)> &preRemove)
 
const std::vector< C * > & GetAll () const
 Get all components. More...
 

Detailed Description

template<class C>
class ComponentContainer< C >

Stores components.

Constructor & Destructor Documentation

◆ ComponentContainer()

template<class C >
ComponentContainer< C >::ComponentContainer

Create new component container.

◆ ~ComponentContainer()

template<class C >
ComponentContainer< C >::~ComponentContainer

Destructor.

Member Function Documentation

◆ ClearKilled() [1/2]

template<class C >
void ComponentContainer< C >::ClearKilled

Clear all killed components.

◆ ClearKilled() [2/2]

template<class C >
void ComponentContainer< C >::ClearKilled ( const std::function< void(C *)> &  preRemove)

Clear all killed components, allowing the caller to do work with the component before it is removed.

Parameters
preRemoveA function that will be called for each killed component before it is removed, passing the component itself.

◆ Create()

template<class C >
C * ComponentContainer< C >::Create

Create a new component.

Returns
The created component.

◆ GetAll()

template<class C >
const std::vector< C * > & ComponentContainer< C >::GetAll

Get all components.

Returns
All of the components in the container.

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