Pyrogenesis  trunk
Classes | Public Member Functions | Private Attributes | List of all members
CDynamicSubscription Class Reference

A list of components that are dynamically subscribed to a particular message. More...

#include <DynamicSubscription.h>

Classes

struct  CompareIComponent
 

Public Member Functions

void Add (IComponent *cmp)
 
void Remove (IComponent *cmp)
 
void Flatten ()
 
const std::vector< IComponent * > & GetComponents ()
 
void DebugDump ()
 

Private Attributes

std::vector< IComponent * > m_Components
 
std::set< IComponent *, CompareIComponentm_Added
 
std::set< IComponent *, CompareIComponentm_Removed
 

Detailed Description

A list of components that are dynamically subscribed to a particular message.

The components list is sorted by (entity_id, ComponentTypeId), with no duplicates.

To cope with changes to the subscription list while a message is still being broadcast, all changes are stored in the added/removed sets. The next time a message is sent, they will be merged into the main components list.

Member Function Documentation

◆ Add()

void CDynamicSubscription::Add ( IComponent cmp)

◆ DebugDump()

void CDynamicSubscription::DebugDump ( )

◆ Flatten()

void CDynamicSubscription::Flatten ( )

◆ GetComponents()

const std::vector< IComponent * > & CDynamicSubscription::GetComponents ( )

◆ Remove()

void CDynamicSubscription::Remove ( IComponent cmp)

Member Data Documentation

◆ m_Added

std::set<IComponent*, CompareIComponent> CDynamicSubscription::m_Added
private

◆ m_Components

std::vector<IComponent*> CDynamicSubscription::m_Components
private

◆ m_Removed

std::set<IComponent*, CompareIComponent> CDynamicSubscription::m_Removed
private

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