Cogs.Core
Classes | Public Member Functions | List of all members
Cogs::ComponentModel::ComponentCollection< ComponentType > Class Template Reference

Typed collection of components. More...

#include <ComponentCollection.h>

Inheritance diagram for Cogs::ComponentModel::ComponentCollection< ComponentType >:
Cogs::ComponentModel::ComponentCollectionBase

Classes

class  ComponentCollectionIterator
 Iterator type for iterating over typed component collections. More...
 

Public Member Functions

ComponentCollectionIterator begin ()
 Iterator to the beginning of the collection.
 
ComponentCollectionIterator end ()
 Iterator to the end of the collection.
 
- Public Member Functions inherited from Cogs::ComponentModel::ComponentCollectionBase
ComponentCollectionIterator begin () const
 Iterator to the beginning of the collection.
 
ComponentCollectionIterator end () const
 Iterator to the end of the collection.
 
COGSFOUNDATION_API ComponentCollectionBase ()
 Creates an empty component collection.
 
COGSFOUNDATION_API void add (ComponentHandle component)
 Adds the given component handle to the collection.
 
COGSFOUNDATION_API void remove (ComponentHandle component)
 Removes the given component from the collection.
 
COGSFOUNDATION_API void clear ()
 Clears the contents of the collection.
 
size_t size () const
 Get the size of the collection.
 
const ComponentHandleoperator[] (size_t index) const
 Get the component at the given index.
 

Detailed Description

template<typename ComponentType>
class Cogs::ComponentModel::ComponentCollection< ComponentType >

Typed collection of components.

Holds a set of components by untyped handles, but makes it possible to iterate over the collection in a typed manner.

Definition at line 156 of file ComponentCollection.h.

Member Function Documentation

◆ begin()

template<typename ComponentType >
ComponentCollectionIterator Cogs::ComponentModel::ComponentCollection< ComponentType >::begin ( )
inline

Iterator to the beginning of the collection.

Returns
A ComponentCollectionIterator referencing the first handle in the collection, or equal to end() if the collection is empty.

Definition at line 222 of file ComponentCollection.h.

◆ end()

template<typename ComponentType >
ComponentCollectionIterator Cogs::ComponentModel::ComponentCollection< ComponentType >::end ( )
inline

Iterator to the end of the collection.

Returns
A ComponentCollectionIterator representing the end of the collection.

Definition at line 229 of file ComponentCollection.h.

References Cogs::ComponentModel::ComponentCollectionBase::size().


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