![]() |
Sound Bakery  v0.1.0
Open-source audio middleware for games
|
Syntactic type to define a pointer that must be a child of the owning object. More...
#include <database_ptr.h>


Public Types | |
| using | TThisType = ChildPtr< TObject > |
Public Types inherited from SB::Core::DatabasePtr< TObject > | |
| using | TThisType = DatabasePtr< TObject > |
| using | TIdentifierType = SB_ID |
| using | TObjectPtr = TObject * |
| using | TObjectRef = TObject & |
| using | TObjectWeak = std::weak_ptr< DatabaseObject > |
| using | TObjectShared = std::shared_ptr< TObject > |
| using | TPtrType = std::weak_ptr< DatabaseObject > |
Public Member Functions | |
| ChildPtr ()=default | |
| Default constructor is exposed for RTTR but not for the user. | |
| ChildPtr (const TThisType &other) | |
| ChildPtr (TThisType &&other)=default | |
| ChildPtr (const DatabaseObject &owner) | |
| Construct a new Child Ptr object with an owner. | |
| ChildPtr (SB_ID id) | |
| Construct a new ChildPtr that points to the ID. | |
| TThisType & | operator= (typename DatabasePtr< TObject >::TIdentifierType id) |
| TThisType & | operator= (typename DatabasePtr< TObject >::TObjectPtr object) |
| TThisType & | operator= (const TThisType &other) |
| void | setID (typename DatabasePtr< TObject >::TIdentifierType id=0) |
| void | reset (typename DatabasePtr< TObject >::TObjectPtr object=nullptr) |
Public Member Functions inherited from SB::Core::DatabasePtr< TObject > | |
| DatabasePtr () | |
| Creates an empty and null LazyPtr. | |
| DatabasePtr (const TThisType &other)=default | |
| DatabasePtr (TThisType &&other)=default | |
| DatabasePtr (SB_ID id) | |
| Creates a LazyPtr that can lookup its object pointer after construction. | |
| DatabasePtr (const TObjectPtr &object) | |
| Create a valid LazyPtr. | |
| DatabasePtr (std::nullptr_t) | |
| Create an empty and null LazyPtr. | |
| SB_ID | id () const noexcept |
| Get ID of the referenced object. | |
| TObjectShared | shared () const noexcept |
| TObjectWeak | weak () const noexcept |
| TObjectPtr | raw () const noexcept |
| Get raw pointer of the referenced object. | |
| TObjectPtr | lookupRaw () const noexcept |
| bool | hasId () const |
| Returns true if we hold a valid ID and can search for an object at runtime. | |
| bool | null () const |
| Returns true if the object pointer is not set. | |
| bool | pending () const |
| Returns true if we hold an ID but haven't found the live object to point to yet. | |
| bool | stale () const |
| Returns true if we previously referenced an object that has been destroyed. | |
| bool | valid () const |
| Returns true if we hold an ID and a valid pointer to the object. | |
| bool | lookup () const |
| Find the live object referenced by the ID and store it. | |
| void | reset (TObjectPtr object=nullptr) |
| Clear all references. | |
| TThisType & | operator= (TObjectPtr object) |
| Assign this LazyPtr to a new object, potentially destroying the current object if we're acting as a UniquePtr. | |
| TThisType & | operator= (const TThisType &other) |
| TThisType & | operator= (const TThisType &&other) |
| operator bool () const | |
| Returns true if this LazyPtr references a valid object. | |
| bool | operator! () const |
| Returns true if this LazyPtr is invalid. | |
| TObjectPtr | operator-> () const |
| Access the raw object. | |
Additional Inherited Members | |
Protected Attributes inherited from SB::Core::DatabasePtr< TObject > | |
| SB_ID | m_objectID |
| TPtrType | m_objectPtr = TPtrType() |
| bool | m_null |
Syntactic type to define a pointer that must be a child of the owning object.
|
default |
Default constructor is exposed for RTTR but not for the user.
|
inline |
Construct a new Child Ptr object with an owner.
Child Ptr types must have an owner so it can check whether an assigned ptr is a child or not.
| owner | to check for child objects on |
|
inline |
Construct a new ChildPtr that points to the ID.
Tries to find the owner from the ID.