xbmc
Public Member Functions | Protected Member Functions | List of all members
CComponentContainer< BaseType > Class Template Reference

A generic container for components. More...

#include <ComponentContainer.h>

Inheritance diagram for CComponentContainer< BaseType >:
Inheritance graph
[legend]

Public Member Functions

template<class T >
std::shared_ptr< T > GetComponent ()
 Obtain a component.
 
template<class T >
std::shared_ptr< const T > GetComponent () const
 Obtain a component.
 
std::size_t size () const
 Returns number of registered components.
 

Protected Member Functions

void RegisterComponent (const std::shared_ptr< BaseType > &component)
 Register a new component instance.
 
void DeregisterComponent (const std::type_info &typeInfo)
 Deregister a component.
 

Detailed Description

template<class BaseType>
class CComponentContainer< BaseType >

A generic container for components.

A component has to be derived from the BaseType. Only a single instance of each derived type can be registered. Intended use is through inheritance.


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