| # Gaudi Framework, version v22r4 |

Home |  | Generated: Fri Sep 2 2011

Public Member Functions

# DefaultObjectCleaner< T > Struct Template Reference

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

`#include <GaudiKernel/TransientFastContainer.h>`

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

List of all members.

## 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.

## 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.

## Member Function Documentation

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.

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

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.

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

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.

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

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r4/GaudiKernel/GaudiKernel/TransientFastContainer.h

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines