|
VR-Engage
2.3
|
Provides self-referencing mechanisms via self(), safe and unsafe shared pointer casts, and inherits type identification and naming from DtVreBase. Use DtVreSharedBase to derive classes that participate in the per-class creator factory.
#include <baseClass.h>
Public Types | |
| using | Ptr = DtVreSharedObject* |
| using | Sptr = std::shared_ptr<DtVreSharedObject> |
| using | Wptr = std::weak_ptr<DtVreSharedObject> |
Public Member Functions | |
| DtVreSharedObject () | |
| virtual | ~DtVreSharedObject () |
| Sptr | self () |
Public Member Functions inherited from makVre::DtVreBase | |
| DtVreBase () | |
| virtual | ~DtVreBase ()=default |
| virtual std::string | type () const =0 |
| virtual void | setName (const std::string &name) |
| virtual std::string | name () const |
Static Public Member Functions | |
| template<class AS_T> | |
| static std::shared_ptr< AS_T > | cast (Sptr p) |
| template<class AS_T> | |
| static std::shared_ptr< AS_T > | unsafe_cast (Sptr p) |
Private Attributes | |
| Wptr | mySelf |
Additional Inherited Members | |
Protected Attributes inherited from makVre::DtVreBase | |
| std::string | myName |
Raw pointer type alias.
| using makVre::DtVreSharedObject::Sptr = std::shared_ptr<DtVreSharedObject> |
Shared pointer type alias.
| using makVre::DtVreSharedObject::Wptr = std::weak_ptr<DtVreSharedObject> |
Weak pointer type alias.
|
inline |
Default constructor.
|
inlinevirtual |
Virtual destructor.
|
inline |
Gets a shared pointer to this object.
If the weak reference to self is expired, creates a new shared pointer; otherwise returns the existing shared pointer.
References mySelf.
|
inlinestatic |
Safely casts a base shared pointer to a derived type.
| p | The base shared pointer to cast |
Referenced by makVre::DtCigiPublisherTemplate< CIGI_T, SELF_T, SUPER_T, DATA_CREATOR_T >::verifySharedType().
|
inlinestatic |
Performs an unsafe static cast of a shared pointer.
Use only when you are certain the object is of the target type.
| p | The base shared pointer to cast |
|
private |
Weak pointer to self for shared_ptr management.
Referenced by self().