Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
A generic container for components. More...
#include <ComponentContainer.h>
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. | |
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.
|
inlineprotected |
Deregister a component.
|
inline |
Obtain a component.
|
inline |
Obtain a component.
|
inlineprotected |
Register a new component instance.
|
inline |
Returns number of registered components.