|
Deki 0.19.0
Modular C++ 2D engine for embedded displays and desktop
|
#include <deki/Object.h>
Public Member Functions | |
| Object () | |
| Object (const std::string &objectName) | |
| Object (const Object &)=delete | |
| Not copyable: an Object owns its children and components by raw pointer, so a copy would double-free them, and the editor-only side table is keyed by this, which a copy would share. | |
| Object & | operator= (const Object &)=delete |
| ~Object () | |
| Must stay out of line: it erases this object's row from the editor-only side table in Object.cpp. | |
| uint32_t | GetId () const |
| void | SetId (uint32_t newId) |
| const std::string & | GetName () const |
| void | SetName (const std::string &newName) |
| bool | IsActive () const |
| void | SetActive (bool value) |
| bool | IsEditorOnly () const |
| void | SetEditorOnly (bool value) |
| bool | IsPersistent () const |
| void | SetPersistent (bool value) |
| void | SetOwnerScene (Scene *scene) |
| Scene * | GetOwnerScene () const |
| bool | IsSceneInstance () const |
| bool | IsPartOfInstance () const |
| void | SetPartOfInstance (bool value) |
| const std::string & | GetSourceSceneGuid () const |
| Empty when this object is not a scene instance. | |
| void | SetSourceSceneGuid (const std::string &guid) |
| const std::string & | GetInstanceOverridesJson () const |
| void | SetInstanceOverridesJson (const std::string &json) |
| void | AddChild (Object *child) |
| void | RemoveChild (Object *child) |
| void | SetParent (Object *newParent) |
| Object * | GetParent () const |
| const std::vector< Object * > & | GetChildren () const |
| Object * | FindChild (uint32_t childId) |
| Object * | FindChildByName (const std::string &name) |
| void | RemoveFromParent () |
| bool | IsDescendantOf (Object *ancestor) const |
| void | InsertChildAt (Object *child, size_t index) |
| int | GetChildIndex (Object *child) const |
| bool | IsActiveInHierarchy () const |
| True when this object and all its ancestors are active. | |
| void | MarkWorldTransformDirty () |
| template<typename T, typename... Args> | |
| T * | AddComponent (Args &&... args) |
| template<typename T> | |
| T * | GetComponent () |
| The first component of type T or of a class directly derived from T. | |
| template<typename T> | |
| const T * | GetComponent () const |
| Component * | GetComponentByTypeId (uint32_t typeId) |
| The first component whose type id is exactly typeId. | |
| const Component * | GetComponentByTypeId (uint32_t typeId) const |
| template<typename T> | |
| std::vector< T * > | GetComponents () |
| Every component of type T or of a class directly derived from T. | |
| template<typename T> | |
| bool | HasComponent () const |
| True when a component of type T or a class directly derived from T is attached. | |
| template<typename T> | |
| void | RemoveComponent () |
| void | RemoveComponent (Component *comp) |
| Removes and deletes comp. | |
| const std::vector< Component * > & | GetComponents () const |
| template<typename T> | |
| T * | FindInterface () |
| The first component that implements interface T, found through the ComponentInterfaceAdapters registry (no RTTI). | |
Static Public Member Functions | |
| static uint32_t | GenerateId () |
| static uint32_t | GenerateDeterministicId (uint32_t seed1, uint32_t seed2) |
Friends | |
| void | Internal::AttachComponent (Object &object, Component *component) |
| Component * | Internal::AddComponentByName (Object &object, const std::string &typeName) |
| int | Internal::DetachComponent (Object &object, Component *component) |
| void | Internal::ReattachComponent (Object &object, Component *component, size_t index) |
| Deki::Object::Object | ( | ) |
| Deki::Object::Object | ( | const std::string & | objectName | ) |
|
delete |
Not copyable: an Object owns its children and components by raw pointer, so a copy would double-free them, and the editor-only side table is keyed by this, which a copy would share.
| Deki::Object::~Object | ( | ) |
Must stay out of line: it erases this object's row from the editor-only side table in Object.cpp.
Defining it = default here would make the class layout depend on DEKI_EDITOR again.
|
inline |
| void Deki::Object::SetId | ( | uint32_t | newId | ) |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| const std::string & Deki::Object::GetSourceSceneGuid | ( | ) | const |
Empty when this object is not a scene instance.
The reference is valid until the next SetSourceSceneGuid on this object, or its destruction.
| void Deki::Object::SetSourceSceneGuid | ( | const std::string & | guid | ) |
| const std::string & Deki::Object::GetInstanceOverridesJson | ( | ) | const |
| void Deki::Object::SetInstanceOverridesJson | ( | const std::string & | json | ) |
| void Deki::Object::AddChild | ( | Object * | child | ) |
| void Deki::Object::RemoveChild | ( | Object * | child | ) |
| void Deki::Object::SetParent | ( | Object * | newParent | ) |
|
inline |
|
inline |
| Object * Deki::Object::FindChild | ( | uint32_t | childId | ) |
| Object * Deki::Object::FindChildByName | ( | const std::string & | name | ) |
| void Deki::Object::RemoveFromParent | ( | ) |
| bool Deki::Object::IsDescendantOf | ( | Object * | ancestor | ) | const |
| void Deki::Object::InsertChildAt | ( | Object * | child, |
| size_t | index ) |
| int Deki::Object::GetChildIndex | ( | Object * | child | ) | const |
| bool Deki::Object::IsActiveInHierarchy | ( | ) | const |
True when this object and all its ancestors are active.
|
inline |
|
inline |
|
inline |
The first component of type T or of a class directly derived from T.
For example, GetComponent<SetupComponent>() returns an SDCardComponent that derives from SetupComponent.
|
inline |
|
inline |
The first component whose type id is exactly typeId.
|
inline |
|
inline |
Every component of type T or of a class directly derived from T.
|
inline |
True when a component of type T or a class directly derived from T is attached.
|
inline |
|
inline |
Removes and deletes comp.
|
inline |
|
inline |
The first component that implements interface T, found through the ComponentInterfaceAdapters registry (no RTTI).
T must have a static constexpr uint32_t kInterfaceID member.
|
friend |
|
friend |
|
friend |
|
friend |