s11n::default_cleanup_functor< SerializableType > Struct Template Reference

A default implementation for s11n_traits::cleanup_functor. More...

#include <traits.hpp>

List of all members.

Public Types

typedef type_traits
< SerializableType >
::type 
serializable_type

Public Member Functions

void operator() (serializable_type &) const throw ()
 Default implementation does nothing, though we should arguably assign to a default-constructed object.


Detailed Description

template<typename SerializableType>
struct s11n::default_cleanup_functor< SerializableType >

A default implementation for s11n_traits::cleanup_functor.

Compatible implementations and specializations must follow the conventions defined for this class.

This implementation is only suitable for cleaning up types which manage any child pointers which are assigned to them during deserialization. For example, std:: containers do not own their pointers, and therefor require a specialization of this type to clean them up.

SerializableType must be a Serializable and may be pointer-qualified.

The library manual goes into more detail about what this type is for.

The operations of this class are declared as throw() because of their logical role in the destruction process, and destructors are not generally allowed to throw.

Definition at line 340 of file traits.hpp.


Member Typedef Documentation

template<typename SerializableType>
typedef type_traits<SerializableType>::type s11n::default_cleanup_functor< SerializableType >::serializable_type

Definition at line 342 of file traits.hpp.


Member Function Documentation

template<typename SerializableType>
void s11n::default_cleanup_functor< SerializableType >::operator() ( serializable_type  )  const throw () [inline]

Default implementation does nothing, though we should arguably assign to a default-constructed object.

Specializations must do any cleanup they need to here. For example, container specializations must a) deallocate any heap-based entries and b) empty the list. Specializations are free to do a default-assign, as mentioned above, but are not required to. Specializations for containers must recursively use s11n_trait::cleanup_functor for the contained types, to ensure that they can properly clean up containers holding other containers.

Definition at line 359 of file traits.hpp.


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