Public Member Functions | Protected Attributes | List of all members
IEntity< TComponent > Class Template Reference

Base class for Component-Entity design pattern implementation. More...

#include <ionComponent.h>

Collaboration diagram for IEntity< TComponent >:
Collaboration graph
[legend]

Public Member Functions

template<typename T >
T * AddComponent (T *Component)
 Add a component to this entity. More...
 
template<typename T >
pair< typename multimap< Type, TComponent * >::iterator, typename multimap< Type, TComponent * >::iterator > GetComponents ()
 Get an iterator range of all components of a given type Note: Does not return elemtns of a type derived from T. More...
 
template<typename T >
size_t GetComponentCount () const
 Get the number of components of a given type Note: Does not count elements of a type derived from T. More...
 
template<typename T >
size_t ExpectSingleComponent (T *&Component)
 
template<typename T >
T * RequireSingleComponent ()
 

Protected Attributes

multimap< Type, TComponent * > Components
 

Detailed Description

template<typename TComponent>
class IEntity< TComponent >

Base class for Component-Entity design pattern implementation.

Member Function Documentation

template<typename TComponent >
template<typename T >
T* IEntity< TComponent >::AddComponent ( T *  Component)
inline

Add a component to this entity.

Parameters
ComponentThe component to add
Template Parameters
TThe actual type of the component added (assumed derived from TComponent)
Returns
The component that was added by this operation
template<typename TComponent >
template<typename T >
size_t IEntity< TComponent >::ExpectSingleComponent ( T *&  Component)
inline
template<typename TComponent >
template<typename T >
size_t IEntity< TComponent >::GetComponentCount ( ) const
inline

Get the number of components of a given type Note: Does not count elements of a type derived from T.

Template Parameters
TType of matched components
template<typename TComponent >
template<typename T >
pair<typename multimap<Type, TComponent *>::iterator, typename multimap<Type, TComponent *>::iterator> IEntity< TComponent >::GetComponents ( )
inline

Get an iterator range of all components of a given type Note: Does not return elemtns of a type derived from T.

Template Parameters
TType of matched components
template<typename TComponent >
template<typename T >
T* IEntity< TComponent >::RequireSingleComponent ( )
inline

Member Data Documentation

template<typename TComponent >
multimap<Type, TComponent *> IEntity< TComponent >::Components
protected

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