EventAnalysis
1.3.0
|
Wrapper for data objects. More...
#include <ObjectWrapperT.h>
Public Member Functions | |
ObjectWrapperTImpl (observer_ptr< DataType > dataObjPtr) | |
Constructor. More... | |
ObjectWrapperTImpl (std::shared_ptr< DataType > dataObjPtr) | |
Constructor. More... | |
ObjectWrapperTImpl (std::unique_ptr< DataType > dataObjPtr) | |
Constructor. More... | |
ObjectWrapperTImpl (const ObjectWrapperTImpl< DataType > &) | |
Copy constructor. More... | |
observer_ptr< DataType > | GetObj () |
Data object getter method. More... | |
bool | IsPolymorphic () |
Test for polymorphic wrapped object. More... | |
bool | IsConst () |
Test for const wrapped object. More... | |
const std::type_info & | GetObjType () |
Returns the type of the wrapped object. More... | |
void | WrapNothing () |
Remove the wrapped object. More... | |
bool | WrapsSomething () |
Checks if the wrapper wraps something. More... | |
void * | GetObjAddress () |
Getter for raw pointer to the wrapped object. More... | |
bool | WrapObject (void *address, const std::type_info &type, bool own, bool isPolymorphic, bool isConst) |
Wrap the object at the given address. More... | |
![]() | |
virtual | ~ObjectWrapperBase () |
Destructor. More... | |
virtual std::unique_ptr< ObjectWrapperBase > | CloneObject ()=0 |
Clones the wrapped object and wraps it. More... | |
virtual std::unique_ptr< ObjectWrapperBase > | CloneWrapper ()=0 |
Clones the wrapper. More... | |
Protected Attributes | |
observer_ptr< DataType > | _dataObjPtr |
std::shared_ptr< DataType > | _dataObjSharedPtr |
Additional Inherited Members | |
![]() | |
ObjectWrapperBase () | |
Constructor. More... | |
Wrapper for data objects.
This class is a template child of ObjectWrapperBase. It implements the wrapping for the template type. The class wraps objects by wrapping their addresses, so no object copy is done. It may or may not own the wrapped objects. This class contains the common implementation of the two template versions of #ObjectWrapperT; it must never be instantiated or used explicitly.
EA::ObjectWrapperTImpl< DataType >::ObjectWrapperTImpl | ( | observer_ptr< DataType > | dataObjPtr | ) |
Constructor.
Constructs a wrapper holding a pointer to data object passed as first argument. The wrapper will not own the object.
dataObjPtr | pointer to the data object to be wrapped. |
EA::ObjectWrapperTImpl< DataType >::ObjectWrapperTImpl | ( | std::shared_ptr< DataType > | dataObjPtr | ) |
Constructor.
Constructs a wrapper holding a pointer to data object passed as first argument. The wrapper will share the ownership of the object through the shared_ptr.
dataObjPtr | pointer to the data object to be wrapped. |
EA::ObjectWrapperTImpl< DataType >::ObjectWrapperTImpl | ( | std::unique_ptr< DataType > | dataObjPtr | ) |
Constructor.
Constructs a wrapper holding a pointer to data object passed as first argument. The wrapper will own the pointed object
dataObjPtr | pointer to the data object to be wrapped. |
EA::ObjectWrapperTImpl< DataType >::ObjectWrapperTImpl | ( | const ObjectWrapperTImpl< DataType > & | original | ) |
Copy constructor.
observer_ptr< DataType > EA::ObjectWrapperTImpl< DataType >::GetObj | ( | ) |
Data object getter method.
|
inlinevirtual |
Getter for raw pointer to the wrapped object.
Implements EA::ObjectWrapperBase.
|
inlinevirtual |
Returns the type of the wrapped object.
Implements EA::ObjectWrapperBase.
|
virtual |
Test for const wrapped object.
Implements EA::ObjectWrapperBase.
|
virtual |
Test for polymorphic wrapped object.
Implements EA::ObjectWrapperBase.
|
inlinevirtual |
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.
Implements EA::ObjectWrapperBase.
|
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.
address | The address of the object to be wrapped. |
type | The type of the object at the given address. |
own | If true then the wrapper will own the wrapped object. |
isPolymorhic | Set to true for objects of polymorphic classes. |
isCopnst | Set to true for constant objects. |
Implements EA::ObjectWrapperBase.
|
inlinevirtual |
Checks if the wrapper wraps something.
Implements EA::ObjectWrapperBase.
|
protected |
|
protected |