chrono::ChClassRegistration< t > Class Template Reference

Description

template<class t>
class chrono::ChClassRegistration< t >

Macro to create a ChDetect_ArchiveINconstructor.

Class for registration data of classes whose objects can be created via a class factory.

#include <ChClassFactory.h>

Inheritance diagram for chrono::ChClassRegistration< t >:
Collaboration diagram for chrono::ChClassRegistration< t >:

Public Member Functions

 ChClassRegistration (const char *mtag_name)
 Creator (adds this to the global list of ChClassRegistration<t> objects). More...
 
virtual ~ChClassRegistration ()
 Destructor (removes this from the global list of ChClassRegistration<t> objects). More...
 
virtual void * create ()
 The signature of create method for derived classes. Calls new().
 
virtual void * create (ChArchiveIn &marchive)
 Call the ArchiveINconstructor(ChArchiveIn&) function if available (deserializes constructor params and return new()), otherwise just call new(). More...
 
virtual std::type_index get_type_index ()
 Get the type_info of the class.
 
virtual std::string & get_tag_name ()
 Get the name used for registering.
 

Protected Member Functions

template<class Tc = t>
enable_if< std::is_default_constructible< Tc >::value, void * >::type _create ()
 
template<class Tc = t>
enable_if< !std::is_default_constructible< Tc >::value, void * >::type _create ()
 
template<class Tc = t>
enable_if< ChDetect_ArchiveINconstructor< Tc >::value, void * >::type _archive_in_create (ChArchiveIn &marchive)
 
template<class Tc = t>
enable_if< !ChDetect_ArchiveINconstructor< Tc >::value, void * >::type _archive_in_create (ChArchiveIn &marchive)
 
std::string & _get_tag_name ()
 

Protected Attributes

std::string m_sTagName
 Name of the class for dynamic creation.
 

Constructor & Destructor Documentation

template<class t >
chrono::ChClassRegistration< t >::ChClassRegistration ( const char *  mtag_name)

Creator (adds this to the global list of ChClassRegistration<t> objects).

template<class t >
virtual chrono::ChClassRegistration< t >::~ChClassRegistration ( )
virtual

Destructor (removes this from the global list of ChClassRegistration<t> objects).

Member Function Documentation

template<class t >
virtual void* chrono::ChClassRegistration< t >::create ( ChArchiveIn marchive)
virtual

Call the ArchiveINconstructor(ChArchiveIn&) function if available (deserializes constructor params and return new()), otherwise just call new().

Implements chrono::ChClassRegistrationBase.