|
VR-Engage
2.3
|
Provides Ptr (raw non-owning observer) and Uptr (std::unique_ptr) aliases, type function overrides, and a per-class creator factory interface. Mirrors DtVreSharedBase but produces std::unique_ptr<SELF_T> from create(). Use registerCreator<CUSTOM_T>() to replace the default creator at runtime.
Per the MAK coding standard, Ptr is the non-owning observer handle and Uptr is the owning handle.
| SELF_T | The derived class type (CRTP parameter) |
| SUPER_T | The base class type, defaults to DtVreUniqueObject |
#include <baseClass.h>
Public Types | |
| using | Super = SUPER_T |
| using | Ptr = SELF_T* |
| using | Uptr = std::unique_ptr<SELF_T> |
Public Member Functions | |
| DtVreUniqueBase () | |
| virtual | ~DtVreUniqueBase () |
| std::string | type () const override |
Public Member Functions inherited from makVre::DtVreUniqueObject | |
| DtVreUniqueObject () | |
| virtual | ~DtVreUniqueObject () |
Public Member Functions inherited from makVre::DtVreBase | |
| DtVreBase () | |
| virtual | ~DtVreBase ()=default |
| virtual void | setName (const std::string &name) |
| virtual std::string | name () const |
Static Public Member Functions | |
| static std::string | Type () |
| static Uptr | create () |
| template<class CUSTOM_T> | |
| static void | registerCreator () |
Static Protected Member Functions | |
| static std::shared_ptr< DtBaseCreator< SELF_T > > & | creator () |
Additional Inherited Members | |
Protected Attributes inherited from makVre::DtVreBase | |
| std::string | myName |
| using makVre::DtVreUniqueBase< SELF_T, SUPER_T >::Super = SUPER_T |
Super class type alias.
| using makVre::DtVreUniqueBase< SELF_T, SUPER_T >::Ptr = SELF_T* |
Raw non-owning pointer type alias.
| using makVre::DtVreUniqueBase< SELF_T, SUPER_T >::Uptr = std::unique_ptr<SELF_T> |
Owning unique pointer type alias.
|
inline |
Default constructor.
|
inlinevirtual |
Virtual destructor.
|
inlinestatic |
Gets the static type name of this class.
References makVre::DtVreBase::name().
|
inlineoverridevirtual |
Gets the runtime type of this object.
Implements makVre::DtVreBase.
References makVre::DtVreBase::name().
|
inlinestatic |
Creates an instance of this class or its registered extension.
Use CLASS::create() instead of new when you want to allow custom extensions to replace the concrete type produced at runtime. By default, CLASS::create() constructs a new instance of CLASS. Call CLASS::registerCreator<CUSTOM_T>() to substitute a derived class.
std::unique_ptr to the newly created instance References create(), creator(), DtASSERT, and LOG_FATAL.
Referenced by create().
|
inlinestatic |
Registers a custom extended class to be created instead of this type.
| CUSTOM_T | The custom class type to register as the creator |
References creator().
|
inlinestaticprotected |
Gets the reference to the creator object.
Referenced by create(), and registerCreator().