#include <component.h>
Public Member Functions | |
ComponentPtr ()=default | |
ComponentPtr (ComponentType *component) | |
const std::string & | getInstancePath () const |
virtual std::string | toString () const override |
virtual void | assign (const std::string &targetID, rtti::Object &targetObject) override |
const ComponentType & | operator* () const |
ComponentType & | operator* () |
const ComponentType * | operator-> () const |
ComponentType * | operator-> () |
bool | operator== (const ComponentPtr< ComponentType > &other) const |
template<typename OTHER > | |
bool | operator== (const ComponentPtr< OTHER > &other) const |
template<typename OTHER > | |
bool | operator== (const OTHER *ptr) const |
bool | operator== (std::nullptr_t) const |
bool | operator!= (const ComponentPtr< ComponentType > &other) const |
template<typename OTHER > | |
bool | operator!= (const ComponentPtr< OTHER > &other) const |
template<typename OTHER > | |
bool | operator!= (const OTHER *ptr) const |
bool | operator!= (std::nullptr_t) const |
bool | operator< (const ComponentPtr< ComponentType > &other) const |
bool | operator> (const ComponentPtr< ComponentType > &other) const |
bool | operator<= (const ComponentPtr< ComponentType > &other) const |
bool | operator>= (const ComponentPtr< ComponentType > &other) const |
ComponentType * | get () const |
ComponentType * | get () |
Typed version of ComponentPtrBase. ComponentPtr stores the path and the pointer to the target resource.
When pointing to other other components through ComponentPtrs, you can do so using a 'path' to the target component. This path can be of two forms:
Paths consisting out of multiple elements can be either relative or absolute and come in three forms:
When there are ChildEntityIDs on the path, it's possible for the ChildEntityID to be ambiguous (for example, when an entity has multiple children with the same ID). For example, consider the following entity hierarchy:
CarEntity -> WheelEntity -> TransformComponent -> WheelEntity -> TransformComponent -> WheelEntity -> TransformComponent -> WheelEntity -> TransformComponent
Pointing directly to one of these TransformComponents using a component path is not possible, because it would be ambiguous. To disambiguate which specific child entity is meant, the user can append a ':[child_index]' to the ChildEntityID on the path.
In this case, to point to the TransformComponent of the second wheel, the user would use the following path: './WheelEntity:1/TransformComponent'
|
default |
ComponentPtr | ( | ComponentType * | component | ) |
|
overridevirtual |
ComponentType* get | ( | ) |
ComponentType* get | ( | ) | const |
const std::string& getInstancePath | ( | ) | const |
bool operator!= | ( | const ComponentPtr< ComponentType > & | other | ) | const |
bool operator!= | ( | const ComponentPtr< OTHER > & | other | ) | const |
bool operator!= | ( | const OTHER * | ptr | ) | const |
bool operator!= | ( | std::nullptr_t | ) | const |
ComponentType& operator* | ( | ) |
const ComponentType& operator* | ( | ) | const |
ComponentType* operator-> | ( | ) |
const ComponentType* operator-> | ( | ) | const |
bool operator< | ( | const ComponentPtr< ComponentType > & | other | ) | const |
bool operator<= | ( | const ComponentPtr< ComponentType > & | other | ) | const |
bool operator== | ( | const ComponentPtr< ComponentType > & | other | ) | const |
bool operator== | ( | const ComponentPtr< OTHER > & | other | ) | const |
bool operator== | ( | const OTHER * | ptr | ) | const |
bool operator== | ( | std::nullptr_t | ) | const |
bool operator> | ( | const ComponentPtr< ComponentType > & | other | ) | const |
bool operator>= | ( | const ComponentPtr< ComponentType > & | other | ) | const |
|
overridevirtual |