ATLAS Offline Software
|
Proxy class for storing any kind of object. More...
#include <FakeProxy.h>
Public Member Functions | |
FakeProxy (void *object, const std::type_info &ti) | |
Constructor taking ownership of an object. More... | |
~FakeProxy () | |
Destructor deleting the encapsulated object. More... | |
void | clear () |
Clear the contents of this variable. More... | |
Static Public Member Functions | |
::TClass * | getClass (const std::type_info &ti) |
Access the dictionary of a specific object. More... | |
static void * | newPrimitive (const std::type_info &ti) |
Create a new instance of a primitive. More... | |
static void | deletePrimitive (void *ptr, const std::type_info &ti) |
Delete a primitive. More... | |
Private Types | |
enum | ClearType { UNKNOWN, ZERO, CLEAR } |
Variable clearing method. More... | |
Private Attributes | |
ClearType | m_clearType |
The variable clearing type for this object. More... | |
void * | m_object |
The owned object. More... | |
const std::type_info & | m_type |
The type of the owned object. More... | |
::TMethodCall | m_clear |
Method calling clear on the object. More... | |
::TClass * | m_dict |
Dictionary for class types. More... | |
Proxy class for storing any kind of object.
This proxy is used to create and take ownership of object types that will not be written out to the D3PD file, but the block filler tools still need them to exist in memory. The class can handle both primitive and class types.
Definition at line 33 of file FakeProxy.h.
|
private |
Variable clearing method.
Primitive types are just zeroed out, while for class types the code checks if they have a clear()
function. If they do, it will be used to clear the variable.
Enumerator | |
---|---|
UNKNOWN | Can't clear the variable. |
ZERO | Clear the variable by filling it with zeroes. |
CLEAR | Clear the variable by calling clear() on it. |
Definition at line 58 of file FakeProxy.h.
D3PD::FakeProxy::FakeProxy | ( | void * | object, |
const std::type_info & | ti | ||
) |
Constructor taking ownership of an object.
The constructor figures out how the variable will need to be cleared later on event by event.
It issues a warning if it didn't manage to do so. (It's not an error condition not to be able to clear the variable...)
object | Pointer to the object the proxy is to take posession of |
ti | The type info of the object |
Definition at line 28 of file FakeProxy.cxx.
D3PD::FakeProxy::~FakeProxy | ( | ) |
Destructor deleting the encapsulated object.
The destructor tries to free the memory allocated by the object in the correct way.
Definition at line 48 of file FakeProxy.cxx.
void D3PD::FakeProxy::clear | ( | ) |
Clear the contents of this variable.
This function also uses the dictionary of the object to try to clear it.
For primitive types we don't do anything for now...
Definition at line 61 of file FakeProxy.cxx.
|
static |
Delete a primitive.
This function is used to delete previously created primitive types from memory.
ptr | Pointer to the primitive object |
ti | The type info for the primitive type |
Definition at line 140 of file FakeProxy.cxx.
|
static |
Access the dictionary of a specific object.
I took this implementation basically from D3PD::RootD3PD, as I needed the same functionality here as well.
ti | The type info of the type in question |
Definition at line 79 of file FakeProxy.cxx.
|
static |
Create a new instance of a primitive.
This function is used to create a new primitive type in memory.
ti | The type info for the primitive type |
Definition at line 101 of file FakeProxy.cxx.
|
private |
Method calling clear on the object.
Definition at line 67 of file FakeProxy.h.
|
private |
The variable clearing type for this object.
Definition at line 63 of file FakeProxy.h.
|
private |
Dictionary for class types.
Definition at line 68 of file FakeProxy.h.
|
private |
The owned object.
Definition at line 65 of file FakeProxy.h.
|
private |
The type of the owned object.
Definition at line 66 of file FakeProxy.h.