Gaudi Framework, version v21r6

Home   Generated: 11 Nov 2009

DefaultObjectCleaner< T > Struct Template Reference

#include <GaudiKernel/TransientFastContainer.h>

Inheritance diagram for DefaultObjectCleaner< T >:

Inheritance graph
[legend]
Collaboration diagram for DefaultObjectCleaner< T >:

Collaboration graph
[legend]

List of all members.


Detailed Description

template<class T>
struct DefaultObjectCleaner< T >

Basic implementation for the object cleaner functor used by TransientFastContainer when returning a recycled object.

Author:
Marco Clemencic
Date:
2006-05-02

Definition at line 43 of file TransientFastContainer.h.


Public Member Functions

T * operator() (T *obj) const
 Get a pointer to an object of type T, clean the content of the object (by calling the placement destructor and constructor) and returns the same pointer.
T * operator() (T *obj, const T &rhs) const
 Get a pointer to an object of type T, clean the content of the object (by calling the placement destructor), copy the content of the provided object and returns the same pointer.
T * destruct (T *obj) const
 Call the destructor of the object before passing back its pointer.

Member Function Documentation

template<class T>
T* DefaultObjectCleaner< T >::operator() ( T *  obj  )  const [inline]

Get a pointer to an object of type T, clean the content of the object (by calling the placement destructor and constructor) and returns the same pointer.

Definition at line 46 of file TransientFastContainer.h.

00046                                        {
00047     obj->T::~T(); // call the destructor without deallocating memory
00048     return new(obj) T(); // call the constructor on the memory
00049   }

template<class T>
T* DefaultObjectCleaner< T >::operator() ( T *  obj,
const T &  rhs 
) const [inline]

Get a pointer to an object of type T, clean the content of the object (by calling the placement destructor), copy the content of the provided object and returns the same pointer.

Definition at line 53 of file TransientFastContainer.h.

00053                                                      {
00054     obj->T::~T(); // call the destructor without deallocating memory
00055     return new(obj) T(rhs); // call the copy constructor on the memory
00056   }

template<class T>
T* DefaultObjectCleaner< T >::destruct ( T *  obj  )  const [inline]

Call the destructor of the object before passing back its pointer.

Definition at line 58 of file TransientFastContainer.h.

00058                                    {
00059     obj->T::~T(); // call the destructor without deallocating memory
00060     return obj; // just return the pointer to the non-initialized chunk
00061   }


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

Generated at Wed Nov 11 16:32:44 2009 for Gaudi Framework, version v21r6 by Doxygen version 1.5.6 written by Dimitri van Heesch, © 1997-2004