57 bool Has(
const std::string& name)
const;
65 template <
typename T>
bool Has(
const std::string& name)
const;
72 std::shared_ptr<std::vector<std::shared_ptr<Component>>>
Get(
const std::string& name)
const;
80 template <
typename T> std::shared_ptr<std::vector<std::shared_ptr<T>>>
Get(
const std::string& name)
const;
87 std::shared_ptr<std::vector<std::shared_ptr<Component>>>
Get(
const std::vector<std::string>& names)
const;
95 void Added(std::shared_ptr<Component> part,
const bool forced)
override;
102 void Removed(std::shared_ptr<Component> part,
const bool forced)
override;
Extends PartList<Component, StoredPtr> with name- and type-based search helpers.
Definition ComponentList.h:34
BasicComponentList()=default
BasicComponentList(Component *owner, ComponentListRole role)
Constructs a list with relationship role metadata.
void Removed(std::shared_ptr< Component > part, const bool forced) override
Synchronization hook called after a component is removed.
void Added(std::shared_ptr< Component > part, const bool forced) override
Synchronization hook called after a component is added.
std::shared_ptr< std::vector< std::shared_ptr< Component > > > Get(const std::vector< std::string > &names) const
Returns all components whose names are in the provided set.
bool Has(const std::string &name) const
Checks whether any component with the given name exists.
std::shared_ptr< std::vector< std::shared_ptr< Component > > > Get(const std::string &name) const
Returns all components with the given name.
BasicComponentList(const size_t initialAllocation)
Definition ComponentList.h:42
A named Part with a parent/child hierarchy and optional thread safety.
Definition Component.h:34
A thread-safe ordered list of Parts.
Definition PartList.h:114
bool Has() const
Checks whether any Part of type T is in the list.
Definition PartList.h:777
std::shared_ptr< std::vector< std::shared_ptr< Component > > > Get() const
Returns a snapshot (copy) of all currently live Parts in the list.
Definition PartList.h:825
Core namespace for the libultraship engine framework.
Definition gfx_direct3d_common.h:14
ComponentListRole
Describes the role of a ComponentList within a parent/child relationship.
Definition ComponentList.h:21
@ Children
This list holds children; adding updates the child's parent list.
@ None
No automatic relationship management.
@ Parents
This list holds parents; adding updates the parent's child list.