VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtSpSubClass< SELF_T, SUPER_T > Class Template Reference

Detailed Description

template<class SELF_T, class SUPER_T = DtSpObject>
class makVre::DtSpSubClass< SELF_T, SUPER_T >

Provides Super, Sptr, Wptr aliases, type function overrides, and a factory creation interface. This template enables the creation of objects through a factory pattern, allowing for runtime customization of object creation.

Template Parameters
SELF_TThe derived class type
SUPER_TThe base class type, defaults to DtSpObject

#include <baseClass.h>

Inheritance diagram for makVre::DtSpSubClass< SELF_T, SUPER_T >:
[legend]

Public Types

using Super = SUPER_T
 
using Ptr = SELF_T*
 
using Sptr = std::shared_ptr<SELF_T>
 
using Wptr = std::weak_ptr<SELF_T>
 
- Public Types inherited from makVre::DtSpObject
using Ptr = DtSpObject*
 
using Sptr = std::shared_ptr<DtSpObject>
 
using Wptr = std::weak_ptr<DtSpObject>
 

Public Member Functions

 DtSpSubClass ()
 
virtual ~DtSpSubClass ()
 
Sptr self ()
 
std::string type () const override
 
- Public Member Functions inherited from makVre::DtSpObject
 DtSpObject ()
 
virtual ~DtSpObject ()
 
Sptr self ()
 
virtual void setName (const std::string &name)
 
virtual std::string name () const
 

Static Public Member Functions

static std::string Type ()
 
static std::shared_ptr< SELF_T > create ()
 
template<class CUSTOM_T>
static void registerCreator ()
 
static std::shared_ptr< SELF_T > createVersion (unsigned int version)
 
template<class CUSTOM_T>
static void registerCreatorVersion (unsigned int version)
 
- Static Public Member Functions inherited from makVre::DtSpObject
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)
 

Static Protected Member Functions

static std::shared_ptr< DtBaseCreator< SELF_T > > & creator ()
 
static std::shared_ptr< DtBaseCreator< SELF_T > > & creatorVersion (unsigned int version)
 

Additional Inherited Members

- Protected Attributes inherited from makVre::DtSpObject
std::string myName
 

Member Typedef Documentation

◆ Super

template<class SELF_T, class SUPER_T = DtSpObject>
using makVre::DtSpSubClass< SELF_T, SUPER_T >::Super = SUPER_T

Super class type alias.

◆ Ptr

template<class SELF_T, class SUPER_T = DtSpObject>
using makVre::DtSpSubClass< SELF_T, SUPER_T >::Ptr = SELF_T*

Raw pointer type alias.

◆ Sptr

template<class SELF_T, class SUPER_T = DtSpObject>
using makVre::DtSpSubClass< SELF_T, SUPER_T >::Sptr = std::shared_ptr<SELF_T>

Shared pointer type alias.

◆ Wptr

template<class SELF_T, class SUPER_T = DtSpObject>
using makVre::DtSpSubClass< SELF_T, SUPER_T >::Wptr = std::weak_ptr<SELF_T>

Weak pointer type alias.

Constructor & Destructor Documentation

◆ DtSpSubClass()

template<class SELF_T, class SUPER_T = DtSpObject>
makVre::DtSpSubClass< SELF_T, SUPER_T >::DtSpSubClass ( )
inline

Default constructor.

◆ ~DtSpSubClass()

template<class SELF_T, class SUPER_T = DtSpObject>
virtual makVre::DtSpSubClass< SELF_T, SUPER_T >::~DtSpSubClass ( )
inlinevirtual

Virtual destructor.

Reimplemented in makVre::DtSpSubClass< DtCigiDataTemplate< CIGI_T, FRIEND_T >, DtCigiDataBase >, makVre::DtSpSubClass< DtCigiEntityPublisherBase, DtCigiPublisherBase >, makVre::DtSpSubClass< DtCigiEntityUnpublisher, DtCigiPublisherBase >, makVre::DtSpSubClass< DtCigiEntityUnpublisherV4, DtCigiEntityUnpublisher >, makVre::DtSpSubClass< DtCigiFxPositionPublisher, DtCigiPublisherBase >, makVre::DtSpSubClass< DtCigiFxPositionPublisherV4, DtCigiFxPositionPublisher >, makVre::DtSpSubClass< DtCigiFxPublisher, DtCigiEntityPublisherBase >, makVre::DtSpSubClass< DtCigiFxPublisherV4, DtCigiFxPublisher >, makVre::DtSpSubClass< DtCigiFxVelocityPublisher, DtCigiPublisherBase >, makVre::DtSpSubClass< DtCigiFxVelocityPublisherV4, DtCigiFxVelocityPublisher >, makVre::DtSpSubClass< DtCigiIgControlPublisher, DtCigiPublisherBase >, makVre::DtSpSubClass< DtCigiIgControlPublisherV4, DtCigiIgControlPublisher >, makVre::DtSpSubClass< DtCigiListenerBase, DtCigiObjectBase >, makVre::DtSpSubClass< DtCigiPublisherBase, DtCigiObjectBase >, makVre::DtSpSubClass< DtCigiPublisherBase, DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase > >, makVre::DtSpSubClass< DtCigiPublisherGroup, DtCigiPublisherBase >, makVre::DtSpSubClass< DtCigiSimEntityArtPartPublisher, DtCigiSimEntityComponentPublisherBase >, makVre::DtSpSubClass< DtCigiSimEntityArtPartPublisherV4, DtCigiSimEntityArtPartPublisher >, makVre::DtSpSubClass< DtCigiSimEntityComponentPublisherBase, DtCigiPublisherBase >, makVre::DtSpSubClass< DtCigiSimEntityPositionPublisher, DtCigiSimEntityComponentPublisherBase >, makVre::DtSpSubClass< DtCigiSimEntityPositionPublisherV4, DtCigiSimEntityPositionPublisher >, makVre::DtSpSubClass< DtCigiSimEntityPublisher, DtCigiSimObjectPublisherBase >, makVre::DtSpSubClass< DtCigiSimEntityPublisherV4, DtCigiSimEntityPublisher >, makVre::DtSpSubClass< DtCigiSimEntityVelocityPublisher, DtCigiSimEntityComponentPublisherBase >, makVre::DtSpSubClass< DtCigiSimEntityVelocityPublisherV4, DtCigiSimEntityVelocityPublisher >, makVre::DtSpSubClass< DtCigiSimObjectPublisherBase, DtCigiEntityPublisherBase >, makVre::DtSpSubClass< DtCigiStartOfFrameListener, DtCigiListenerBase >, makVre::DtSpSubClass< DtCigiStartOfFrameListenerV4, DtCigiStartOfFrameListener >, makVre::DtSpSubClass< DtCigiTimePublisher, DtCigiPublisherBase >, makVre::DtSpSubClass< DtCigiTimePublisherV4, DtCigiTimePublisher >, makVre::DtSpSubClass< DtCigiViewControlPublisher, DtCigiPublisherBase >, makVre::DtSpSubClass< DtCigiViewControlPublisherV4, DtCigiViewControlPublisher >, makVre::DtSpSubClass< DtCigiViewDefinitionPublisher, DtCigiPublisherBase >, makVre::DtSpSubClass< DtCigiViewDefinitionPublisherV4, DtCigiViewDefinitionPublisher >, makVre::DtSpSubClass< SELF_T, DtCigiListenerBase >, and makVre::DtSpSubClass< SELF_T, DtCigiPublisherBase >.

Member Function Documentation

◆ self()

template<class SELF_T, class SUPER_T = DtSpObject>
Sptr makVre::DtSpSubClass< SELF_T, SUPER_T >::self ( )
inline

Gets a shared pointer to this object of the derived type.

Returns
A shared pointer to this object cast to the derived type

◆ Type()

template<class SELF_T, class SUPER_T = DtSpObject>
static std::string makVre::DtSpSubClass< SELF_T, SUPER_T >::Type ( )
inlinestatic

Gets the static type name of this class.

Returns
A string representing the type name

References makVre::DtSpObject::name().

◆ type()

template<class SELF_T, class SUPER_T = DtSpObject>
std::string makVre::DtSpSubClass< SELF_T, SUPER_T >::type ( ) const
inlineoverridevirtual

Gets the runtime type of this object.

Returns
A string representing the type of this object

Implements makVre::DtSpObject.

Reimplemented in makVre::DtSpSubClass< DtCigiDataTemplate< CIGI_T, FRIEND_T >, DtCigiDataBase >, makVre::DtSpSubClass< DtCigiEntityUnpublisherV4, DtCigiEntityUnpublisher >, makVre::DtSpSubClass< DtCigiFxPositionPublisherV4, DtCigiFxPositionPublisher >, makVre::DtSpSubClass< DtCigiFxPublisher, DtCigiEntityPublisherBase >, makVre::DtSpSubClass< DtCigiFxPublisherV4, DtCigiFxPublisher >, makVre::DtSpSubClass< DtCigiFxVelocityPublisherV4, DtCigiFxVelocityPublisher >, makVre::DtSpSubClass< DtCigiIgControlPublisherV4, DtCigiIgControlPublisher >, makVre::DtSpSubClass< DtCigiPublisherBase, DtCigiObjectBase >, makVre::DtSpSubClass< DtCigiPublisherBase, DtTreeClass< DtCigiPublisherBase, DtCigiObjectBase > >, makVre::DtSpSubClass< DtCigiPublisherGroup, DtCigiPublisherBase >, makVre::DtSpSubClass< DtCigiSimEntityArtPartPublisher, DtCigiSimEntityComponentPublisherBase >, makVre::DtSpSubClass< DtCigiSimEntityArtPartPublisherV4, DtCigiSimEntityArtPartPublisher >, makVre::DtSpSubClass< DtCigiSimEntityComponentPublisherBase, DtCigiPublisherBase >, makVre::DtSpSubClass< DtCigiSimEntityPositionPublisher, DtCigiSimEntityComponentPublisherBase >, makVre::DtSpSubClass< DtCigiSimEntityPositionPublisherV4, DtCigiSimEntityPositionPublisher >, makVre::DtSpSubClass< DtCigiSimEntityPublisher, DtCigiSimObjectPublisherBase >, makVre::DtSpSubClass< DtCigiSimEntityPublisherV4, DtCigiSimEntityPublisher >, makVre::DtSpSubClass< DtCigiSimEntityVelocityPublisher, DtCigiSimEntityComponentPublisherBase >, makVre::DtSpSubClass< DtCigiSimEntityVelocityPublisherV4, DtCigiSimEntityVelocityPublisher >, makVre::DtSpSubClass< DtCigiSimObjectPublisherBase, DtCigiEntityPublisherBase >, makVre::DtSpSubClass< DtCigiStartOfFrameListener, DtCigiListenerBase >, makVre::DtSpSubClass< DtCigiStartOfFrameListenerV4, DtCigiStartOfFrameListener >, makVre::DtSpSubClass< DtCigiTimePublisher, DtCigiPublisherBase >, makVre::DtSpSubClass< DtCigiTimePublisherV4, DtCigiTimePublisher >, makVre::DtSpSubClass< DtCigiViewControlPublisher, DtCigiPublisherBase >, makVre::DtSpSubClass< DtCigiViewControlPublisherV4, DtCigiViewControlPublisher >, makVre::DtSpSubClass< DtCigiViewDefinitionPublisher, DtCigiPublisherBase >, makVre::DtSpSubClass< DtCigiViewDefinitionPublisherV4, DtCigiViewDefinitionPublisher >, makVre::DtSpSubClass< SELF_T, DtCigiListenerBase >, and makVre::DtSpSubClass< SELF_T, DtCigiPublisherBase >.

References makVre::DtSpObject::name().

◆ create()

template<class SELF_T, class SUPER_T = DtSpObject>
static std::shared_ptr< SELF_T > makVre::DtSpSubClass< SELF_T, SUPER_T >::create ( )
inlinestatic

Creates an instance of this class or its registered extension.

This method allows for extension of base classes. Use CLASS::create() instead of new when you want to allow custom extensions to replace what class is actually realized. By default, CLASS::create() creates a new instance of CLASS. To override with a derived extension class, call CLASS::registerCreator<CUSTOM>() with the new custom class.

The custom class should inherit from CLASS.

The custom class will then be instantiated wherever CLASS::create() is used. Use cast<CUSTOM>(shared_ptr) for convenient dynamic cast to custom class type if needing to access custom extended class interface.

Returns
A shared pointer to the newly created instance

References creator(), DtASSERT, and LOG_FATAL.

◆ registerCreator()

template<class SELF_T, class SUPER_T = DtSpObject>
template<class CUSTOM_T>
static void makVre::DtSpSubClass< SELF_T, SUPER_T >::registerCreator ( )
inlinestatic

Registers a custom extended class to be created instead of this type.

Template Parameters
CUSTOM_TThe custom class type to register as the creator

References creator().

◆ creator()

template<class SELF_T, class SUPER_T = DtSpObject>
static std::shared_ptr< DtBaseCreator< SELF_T > > & makVre::DtSpSubClass< SELF_T, SUPER_T >::creator ( )
inlinestaticprotected

Gets the reference to the creator object.

Returns
A reference to the shared pointer containing the creator

Referenced by create(), and registerCreator().

◆ createVersion()

template<class SELF_T, class SUPER_T = DtSpObject>
static std::shared_ptr< SELF_T > makVre::DtSpSubClass< SELF_T, SUPER_T >::createVersion ( unsigned int version)
inlinestatic

Creates an instance of this class for a specific version.

This allows for version-specific implementations to be selected at runtime

Parameters
versionThe version number to create
Returns
A shared pointer to the newly created instance

References creatorVersion(), DtASSERT, and LOG_FATAL.

◆ registerCreatorVersion()

template<class SELF_T, class SUPER_T = DtSpObject>
template<class CUSTOM_T>
static void makVre::DtSpSubClass< SELF_T, SUPER_T >::registerCreatorVersion ( unsigned int version)
inlinestatic

Registers a custom class for a specific version.

Template Parameters
CUSTOM_TThe custom class type to register
Parameters
versionThe version number to associate with this creator

References creatorVersion().

◆ creatorVersion()

template<class SELF_T, class SUPER_T = DtSpObject>
static std::shared_ptr< DtBaseCreator< SELF_T > > & makVre::DtSpSubClass< SELF_T, SUPER_T >::creatorVersion ( unsigned int version)
inlinestaticprotected

Gets the reference to the creator object for a specific version.

Parameters
versionThe version number to get the creator for
Returns
A reference to the shared pointer containing the creator

Referenced by createVersion(), and registerCreatorVersion().


The documentation for this class was generated from the following file: