cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
cmnClassServices< _dynamicCreation, _class, _argType > Class Template Reference

Class services. More...

#include <cmnClassServices.h>

Inheritance diagram for cmnClassServices< _dynamicCreation, _class, _argType >:
cmnClassServicesBase

Public Types

typedef cmnClassServicesBase BaseType
 
typedef cmnGenericObjectgeneric_pointer
 
- Public Types inherited from cmnClassServicesBase
typedef cmnGenericObjectgeneric_pointer
 

Public Member Functions

 cmnClassServices (const std::string &className, const std::type_info *typeInfo, const cmnClassServicesBase *parentServices, const std::string &libraryName, cmnLogMask mask=CMN_LOG_ALLOW_DEFAULT)
 
virtual cmnGenericObjectCreate (void) const
 
virtual cmnGenericObjectCreate (const cmnGenericObject &other) const
 
virtual cmnGenericObjectCreateWithArg (const cmnGenericObject &arg) const
 
virtual bool Create (cmnGenericObject *existing, const cmnGenericObject &other) const
 
virtual cmnGenericObjectCreateArray (size_t size) const
 
virtual cmnGenericObjectCreateArray (size_t size, const cmnGenericObject &other) const
 
virtual bool DeleteArray (generic_pointer &data, size_t &size) const
 
virtual bool Delete (cmnGenericObject *existing) const
 
virtual size_t GetSize (void) const
 
bool HasDynamicCreation (void) const
 
bool DefaultConstructorAvailable (void) const
 
bool CopyConstructorAvailable (void) const
 
bool OneArgConstructorAvailable (void) const
 
const cmnClassServicesBaseGetConstructorArgServices (void) const
 
- Public Member Functions inherited from cmnClassServicesBase
 cmnClassServicesBase (const std::string &className, const std::type_info *typeInfo, const cmnClassServicesBase *parentServices, const std::string &libraryName, cmnLogMask mask=CMN_LOG_ALLOW_DEFAULT)
 
virtual ~cmnClassServicesBase ()
 
const std::string & GetName (void) const
 
const std::type_info * TypeInfoPointer (void) const
 
const cmnLogMaskGetLogMask (void) const
 
const cmnLogMaskGetLoD (void) const
 
void SetLogMask (cmnLogMask mask)
 
void CISST_DEPRECATED SetLoD (cmnLogMask mask)
 
const cmnClassServicesBaseGetParentServices (void) const
 
bool IsDerivedFrom (const cmnClassServicesBase *parentServices) const
 
template<class _Parent >
bool IsDerivedFrom (void) const
 
const std::string & GetLibraryName (void) const
 

Detailed Description

template<int _dynamicCreation, class _class, class _argType = _class>
class cmnClassServices< _dynamicCreation, _class, _argType >

Class services.

If dynamic creation is enabled, class must have public default constructor and copy constructor.

See Also
cmnClassRegister cmnClassServicesBase

Member Typedef Documentation

template<int _dynamicCreation, class _class , class _argType = _class>
typedef cmnClassServicesBase cmnClassServices< _dynamicCreation, _class, _argType >::BaseType

Type of the base class, i.e. cmnClassServicesBase.

template<int _dynamicCreation, class _class , class _argType = _class>
typedef cmnGenericObject* cmnClassServices< _dynamicCreation, _class, _argType >::generic_pointer

Constructor & Destructor Documentation

template<int _dynamicCreation, class _class , class _argType = _class>
cmnClassServices< _dynamicCreation, _class, _argType >::cmnClassServices ( const std::string &  className,
const std::type_info *  typeInfo,
const cmnClassServicesBase parentServices,
const std::string &  libraryName,
cmnLogMask  mask = CMN_LOG_ALLOW_DEFAULT 
)
inline

Constructor. Sets the name of the class and the Level of Detail setting for the class.

Parameters
classNameThe name to be associated with the class.
typeInfoType information as defined by typeid() (see C++ RTTI)
maskThe log mask to be used with this class.

Member Function Documentation

template<int _dynamicCreation, class _class , class _argType = _class>
bool cmnClassServices< _dynamicCreation, _class, _argType >::CopyConstructorAvailable ( void  ) const
inlinevirtual

Implements cmnClassServicesBase.

template<int _dynamicCreation, class _class , class _argType = _class>
virtual cmnGenericObject* cmnClassServices< _dynamicCreation, _class, _argType >::Create ( void  ) const
inlinevirtual

Create a new empty object of the same type as represented by this object. This can be used whenever an object needs to be dynamically created (e.g. deserialization, object factory). This method uses the C++ "new" operator and the programmers should remember to use a matching "delete" if needed.

Returns
a pointer to the newly created object or null if object cannot be created. This could happen when the class services where created with CMN_NO_DYNAMIC_CREATION.

Implements cmnClassServicesBase.

template<int _dynamicCreation, class _class , class _argType = _class>
virtual cmnGenericObject* cmnClassServices< _dynamicCreation, _class, _argType >::Create ( const cmnGenericObject other) const
inlinevirtual

Create a new empty object of the same type as represented by this object using the copy constructor. This can be used whenever an object needs to be dynamically created (e.g. deserialization, object factory). This method uses the C++ "new" operator and the programmers should remember to use a matching "delete" if needed.

Parameters
otherA object derived from cmnGenericObject which should be of the same type as the type represented by this cmnClassServices object.
Returns
a pointer to the newly created object or null if object cannot be created. This could happen when the class services where created with CMN_NO_DYNAMIC_CREATION or if the object provided is not of the right type and the copy constructor can not be called.

Implements cmnClassServicesBase.

template<int _dynamicCreation, class _class , class _argType = _class>
virtual bool cmnClassServices< _dynamicCreation, _class, _argType >::Create ( cmnGenericObject existing,
const cmnGenericObject other 
) const
inlinevirtual

Placement new using copy constructor

Implements cmnClassServicesBase.

template<int _dynamicCreation, class _class , class _argType = _class>
virtual cmnGenericObject* cmnClassServices< _dynamicCreation, _class, _argType >::CreateArray ( size_t  size) const
inlinevirtual

Create a new empty array of objects of the same type as represented by this object. This can be used whenever an object needs to be dynamically created (e.g. deserialization, object factory). This method uses the C++ "new[size]" operator and the programmers should remember to use a matching "delete" if needed.

Returns
a pointer to the newly created object or null if object cannot be created. This could happen when the class services where created with CMN_NO_DYNAMIC_CREATION.

Implements cmnClassServicesBase.

template<int _dynamicCreation, class _class , class _argType = _class>
virtual cmnGenericObject* cmnClassServices< _dynamicCreation, _class, _argType >::CreateArray ( size_t  size,
const cmnGenericObject other 
) const
inlinevirtual

Create an array and fill with an existing object

Implements cmnClassServicesBase.

template<int _dynamicCreation, class _class , class _argType = _class>
virtual cmnGenericObject* cmnClassServices< _dynamicCreation, _class, _argType >::CreateWithArg ( const cmnGenericObject arg) const
inlinevirtual

Create with argument

Implements cmnClassServicesBase.

template<int _dynamicCreation, class _class , class _argType = _class>
bool cmnClassServices< _dynamicCreation, _class, _argType >::DefaultConstructorAvailable ( void  ) const
inlinevirtual

returns information about what types of constructors are available

Implements cmnClassServicesBase.

template<int _dynamicCreation, class _class , class _argType = _class>
virtual bool cmnClassServices< _dynamicCreation, _class, _argType >::Delete ( cmnGenericObject existing) const
inlinevirtual

Call destructor explicitly

Implements cmnClassServicesBase.

template<int _dynamicCreation, class _class , class _argType = _class>
virtual bool cmnClassServices< _dynamicCreation, _class, _argType >::DeleteArray ( generic_pointer data,
size_t &  size 
) const
inlinevirtual

Implements cmnClassServicesBase.

template<int _dynamicCreation, class _class , class _argType = _class>
const cmnClassServicesBase* cmnClassServices< _dynamicCreation, _class, _argType >::GetConstructorArgServices ( void  ) const
inlinevirtual

return class services for constructor argument (0 if no class services or does not exist)

Implements cmnClassServicesBase.

template<int _dynamicCreation, class _class , class _argType = _class>
virtual size_t cmnClassServices< _dynamicCreation, _class, _argType >::GetSize ( void  ) const
inlinevirtual

Get the size of the class

Implements cmnClassServicesBase.

template<int _dynamicCreation, class _class , class _argType = _class>
bool cmnClassServices< _dynamicCreation, _class, _argType >::HasDynamicCreation ( void  ) const
inlinevirtual

Returns whether dynamic creation is available

Implements cmnClassServicesBase.

template<int _dynamicCreation, class _class , class _argType = _class>
bool cmnClassServices< _dynamicCreation, _class, _argType >::OneArgConstructorAvailable ( void  ) const
inlinevirtual

Implements cmnClassServicesBase.


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