score::ComponentHierarchyManager< ParentComponent_T, ChildModel_T, ChildComponent_T > Class Template Reference

Manages simple hierarchies of components. More...

Inheritance diagram for score::ComponentHierarchyManager< ParentComponent_T, ChildModel_T, ChildComponent_T >:

Detailed Description

template<typename ParentComponent_T, typename ChildModel_T, typename ChildComponent_T>
class score::ComponentHierarchyManager< ParentComponent_T, ChildModel_T, ChildComponent_T >

Manages simple hierarchies of components.

For instance, if the object Foo is a container for Bar elements, this class can be used so that every time a new Bar is created, a matching component will be added to Bar.

Todo:
If the number of such hierarchies grows, it may be interesting instead to store them in a single hierarchy manager part of the original element.

Classes

struct  ChildPair
 

Public Types

using hierarchy_t = ComponentHierarchyManager
 

Public Member Functions

template<typename... Args>
 ComponentHierarchyManager (Args &&... args)
 
template<typename... Args>
 ComponentHierarchyManager (score::lazy_init_t, Args &&... args)
 
void init ()
 
const auto & children () const
 
void add (ChildModel_T &model)
 
void remove (const ChildModel_T &model)
 
void cleanup (const ChildPair &pair)
 
void clear ()
 

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