EventAnalysis  1.3.0
Public Member Functions | Protected Member Functions | List of all members
EA::ObjectWrapperBase Class Referenceabstract

Mother class for data wrapper template class. More...

#include <ObjectWrapperBase.h>

Inheritance diagram for EA::ObjectWrapperBase:
EA::ObjectWrapperTImpl< DataType > EA::ObjectWrapperTImpl< void > EA::ObjectWrapperT< DataType, typename > EA::ObjectWrapperT< DataType, typename std::enable_if< smart_is_copy_constructible< DataType >::value >::type >

Public Member Functions

virtual ~ObjectWrapperBase ()
 Destructor. More...
 
virtual std::unique_ptr< ObjectWrapperBaseCloneObject ()=0
 Clones the wrapped object and wraps it. More...
 
virtual std::unique_ptr< ObjectWrapperBaseCloneWrapper ()=0
 Clones the wrapper. More...
 
virtual const std::type_info & GetObjType ()=0
 Returns the type of the wrapped object. More...
 
virtual void WrapNothing ()=0
 Remove the wrapped object. More...
 
virtual bool WrapsSomething ()=0
 Checks if the wrapper wraps something. More...
 
virtual void * GetObjAddress ()=0
 Getter for raw pointer to the wrapped object. More...
 
virtual bool WrapObject (void *address, const std::type_info &type, bool own, bool isPolymorphic, bool isConst)=0
 Wrap the object at the given address. More...
 
virtual bool IsPolymorphic ()=0
 Test for polymorphic wrapped object. More...
 
virtual bool IsConst ()=0
 Test for const wrapped object. More...
 

Protected Member Functions

 ObjectWrapperBase ()
 Constructor. More...
 

Detailed Description

Mother class for data wrapper template class.

This class is the base class for data wrappers used by the DataMap class. It is used to provide a common base class wrapper for every kind of object, in order to create containers of different objects, using the type erasure pattern.

Constructor & Destructor Documentation

◆ ~ObjectWrapperBase()

virtual EA::ObjectWrapperBase::~ObjectWrapperBase ( )
inlinevirtual

Destructor.

◆ ObjectWrapperBase()

EA::ObjectWrapperBase::ObjectWrapperBase ( )
inlineprotected

Constructor.

Member Function Documentation

◆ CloneObject()

virtual std::unique_ptr<ObjectWrapperBase> EA::ObjectWrapperBase::CloneObject ( )
pure virtual

Clones the wrapped object and wraps it.

Creates a wrapper wrapping a clone of the wrapped object.

Returns
pointer to the wrapper wrapping the cloned object.

Implemented in EA::ObjectWrapperT< DataType, typename std::enable_if< smart_is_copy_constructible< DataType >::value >::type >, and EA::ObjectWrapperT< DataType, typename >.

◆ CloneWrapper()

virtual std::unique_ptr<ObjectWrapperBase> EA::ObjectWrapperBase::CloneWrapper ( )
pure virtual

Clones the wrapper.

Creates a new wrapper wrapping the same object.

Returns
pointer to the clone wrapper.

Implemented in EA::ObjectWrapperT< DataType, typename std::enable_if< smart_is_copy_constructible< DataType >::value >::type >, and EA::ObjectWrapperT< DataType, typename >.

◆ GetObjAddress()

virtual void* EA::ObjectWrapperBase::GetObjAddress ( )
pure virtual

Getter for raw pointer to the wrapped object.

Returns
the address of the wrapped object.

Implemented in EA::ObjectWrapperTImpl< void >, and EA::ObjectWrapperTImpl< DataType >.

◆ GetObjType()

virtual const std::type_info& EA::ObjectWrapperBase::GetObjType ( )
pure virtual

Returns the type of the wrapped object.

Implemented in template derived classes #ObjectWrapperT.

Returns
the type of the wrapped object.

Implemented in EA::ObjectWrapperTImpl< void >, and EA::ObjectWrapperTImpl< DataType >.

◆ IsConst()

virtual bool EA::ObjectWrapperBase::IsConst ( )
pure virtual

Test for const wrapped object.

Returns
true if the wrapped object is constant.

Implemented in EA::ObjectWrapperTImpl< void >, and EA::ObjectWrapperTImpl< DataType >.

◆ IsPolymorphic()

virtual bool EA::ObjectWrapperBase::IsPolymorphic ( )
pure virtual

Test for polymorphic wrapped object.

Returns
true if the wrapped object is of a polymorphic class.

Implemented in EA::ObjectWrapperTImpl< void >, and EA::ObjectWrapperTImpl< DataType >.

◆ WrapNothing()

virtual void EA::ObjectWrapperBase::WrapNothing ( )
pure virtual

Remove the wrapped object.

Makes the wrapper wrap no object. An eventual previously wrapped object will be deleted if the object is owned by the wrapper.

Implemented in EA::ObjectWrapperTImpl< void >, and EA::ObjectWrapperTImpl< DataType >.

◆ WrapObject()

virtual bool EA::ObjectWrapperBase::WrapObject ( void *  address,
const std::type_info &  type,
bool  own,
bool  isPolymorphic,
bool  isConst 
)
pure virtual

Wrap the object at the given address.

Set the wrapped object. This method should be used only in those rare cases where the object is available only through a void*. Type check is enforced through the #type argument.

Parameters
addressThe address of the object to be wrapped.
typeThe type of the object at the given address.
ownIf true then the wrapper will own the wrapped object.
isPolymorhicSet to true for objects of polymorphic classes.
isCopnstSet to true for constant objects.
Returns
true if the object at the given address has been correctly wrapped.

Implemented in EA::ObjectWrapperTImpl< void >, and EA::ObjectWrapperTImpl< DataType >.

◆ WrapsSomething()

virtual bool EA::ObjectWrapperBase::WrapsSomething ( )
pure virtual

Checks if the wrapper wraps something.

Returns
true if the wrapped pointer is not nullptr.

Implemented in EA::ObjectWrapperTImpl< void >, and EA::ObjectWrapperTImpl< DataType >.


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