s11n::cleaner_upper Struct Reference

Intended for use with for_each(), this type cleans up Serializables using cleanup_serializable(). More...

#include <serialize.hpp>

List of all members.

Public Member Functions

template<typename T>
void operator() (T &t) throw ()
 Calls cleanup_serializable<T>(t).
template<typename T>
void operator() (T *&t) throw ()
 Calls cleanup_serializable<T>(t).


Detailed Description

Intended for use with for_each(), this type cleans up Serializables using cleanup_serializable().

Usage:

std::for_each( container.begin(), container.end(), cleaner_upper() );

where the container is parameterized to hold Serializables.

Provided that the contained type(s) conform to cleanup_ptr's requirements, this will recursively clean up sub-sub-...subcontainers.

Note that Serializable containers should have a cleanup functor installed as part of their registration, making this class unnecessary for most cases: simply calling cleanup_serializable() will recursively walk/clean such containers. The underlying cleanup algos might use this type, however (at least one of them does).

Added in 1.1.3.

This type is usable as a Finalizer for s11n::refcount::rcptr, by the way.

Definition at line 225 of file serialize.hpp.


Member Function Documentation

template<typename T>
void s11n::cleaner_upper::operator() ( T &  t  )  throw () [inline]

Calls cleanup_serializable<T>(t).

Definition at line 231 of file serialize.hpp.

template<typename T>
void s11n::cleaner_upper::operator() ( T *&  t  )  throw () [inline]

Calls cleanup_serializable<T>(t).

Definition at line 239 of file serialize.hpp.


The documentation for this struct was generated from the following file:
Generated on Sun Apr 27 13:16:04 2008 for libs11n by  doxygen 1.5.3