|
| SIGNAL (sigComInsert,(ComObject &src, Component &com)) |
| Called after component is inserted. More...
|
|
| SIGNAL (sigComRemove,(ComObject &src, Component &com)) |
| Called after component is removed. Reference component with a shared pointer to prevent deletion. More...
|
|
| SIGNAL (sigSetInstId,(ComObject &src, Id id)) |
| Called before instance id is changed. More...
|
|
virtual | ~ComObject () |
| Removes and releases all contained components. More...
|
|
virtual void | setInstId (const Id &id) |
| Override from object, sends message about change. More...
|
|
void | addCom (Component &com, bool createDeps=false) |
| Add a component reference. The component is added to the end of its slot (and any supertype slots). More...
|
|
void | addCom (Component *com, bool createDeps=false) |
| Wrapper for pointer arg. More...
|
|
void | insertCom (Component &com, szt index, bool createDeps=false) |
| Add a component reference. The component is inserted into its slot at index. More...
|
|
template<class Com > |
bool | hasCom (const Id &id=idnull) const |
| hasComInSlot() with type Com More...
|
|
bool | hasComInSlot (const Id &type, const Id &id=idnull) const |
| Check if object contains any components of type (with id). More...
|
|
template<class Com > |
szt | comCount () const |
| comCountInSlot() with type Com More...
|
|
szt | comCountInSlot (const Id &type) const |
| Get number of components of type that this object contains. O(1) complexity. More...
|
|
auto | comSlots () const -> decltype(keys(declval< const SlotMap >())) |
| Get iterator over all slots in this object. A slot may contain one or many components. More...
|
|
template<class Com > |
Com & | com () const |
| Get component of type Com . Returns first component in slot, must exist. More...
|
|
template<class Com > |
Com & | com (const Id &id) const |
| comInSlot() with type Com More...
|
|
Component & | comInSlot (const Id &type, const Id &id=idnull) const |
| Get a single component of type with id. If id is null then first component in slot will be returned. More...
|
|
template<class Com > |
const vector< typename Com::Ptr > & | coms () const |
| comsInSlot() with type Com More...
|
|
const vector< Component::Ptr > & | comsInSlot (const Id &type) const |
| Get all components of type. May return empty list. O(1) complexity. More...
|
|
void | removeCom (Component &com, bool removeDeps=false) |
| Remove a single component. O(n) complexity. More...
|
|
template<class Com > |
void | removeCom (const Id &id=idnull, bool removeDeps=false) |
| Remove a single component of type Com with id. O(n) complexity unless id is null. If id is null then first component in slot is removed. More...
|
|
template<class Com > |
void | removeComAtIndex (szt index, bool removeDeps=false) |
| removeComInSlot() with type Com More...
|
|
void | removeComInSlot (const Id &type, szt index, bool removeDeps=false) |
| Remove component of type at index. O(1) complexity, must exist. More...
|
|
template<class Com > |
void | removeComs (bool removeDeps=false) |
| removeComsInSlot() with type Com More...
|
|
void | removeComs () |
| Remove all components. Components are removed in type-dependent order. More...
|
|
void | removeComsInSlot (const Id &type, bool removeDeps=false) |
| Remove all components of type. Components are removed from slot list in reverse order. More...
|
|
ListenerList & | listeners () |
| Get listener list. More...
|
|
| Object (const Id &id=idnull) |
|
virtual | ~Object () |
|
const Id & | getInstId () const |
|
| SharedObj (Alloc &&a=Alloc()) debug_if( |
| Construct with allocator that is called to deallocate this shared object when all references have been released. More...
|
|
Component object. Object that consists of a collection of components.
A component object contains multiple slots into which components can be inserted. A single slot contains one or many components of the same type.