Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

s11nlite::save_nullary_base_f< T, OutputT > Struct Template Reference

An "implementation detail" nullary functor type to simplify implementations of save_xxx_nullary_f. More...

#include <s11nlite.hpp>

Inheritance diagram for s11nlite::save_nullary_base_f< T, OutputT >:

Inheritance graph
[legend]
Collaboration diagram for s11nlite::save_nullary_base_f< T, OutputT >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 save_nullary_base_f (T const &src, OutputT dest)
 Both src and dest are expected to outlive this object, unless of source OutputT is a value type, in which case we copy dest at ctor time, instead of taking a (const &), to avoid us accidentally storing a reference to a temporary which probably won't exist when operator() is called.
bool operator() () const
 Returns s11nlite::save( this->source, this->destination ).

Public Attributes

T const & source
OutputT destination

Detailed Description

template<typename T, typename OutputT>
struct s11nlite::save_nullary_base_f< T, OutputT >

An "implementation detail" nullary functor type to simplify implementations of save_xxx_nullary_f.

It is not intended for standalone use, but as a base type for save_xxx_nullary_f functors.

T must be one of:

OutputT is expected to be one of:

If s11nlite::save() is ever overloaded, e.g., to take your own custom output destination type, then that type will also theoretically work here

See save() for important notes about when you should NOT use this. In particular, this functor should not normally be used with std::for_each(), as save() expects to store ONE object in each target. Loading objects saved this way won't work: only the first one is likely to be read by load-time. Exceptions to this caveat include network streams or debug channels.

Added in version 1.1.3.

Definition at line 576 of file s11nlite.hpp.


Constructor & Destructor Documentation

template<typename T, typename OutputT>
s11nlite::save_nullary_base_f< T, OutputT >::save_nullary_base_f T const &  src,
OutputT  dest
[inline]
 

Both src and dest are expected to outlive this object, unless of source OutputT is a value type, in which case we copy dest at ctor time, instead of taking a (const &), to avoid us accidentally storing a reference to a temporary which probably won't exist when operator() is called.

Definition at line 588 of file s11nlite.hpp.


Member Function Documentation

template<typename T, typename OutputT>
bool s11nlite::save_nullary_base_f< T, OutputT >::operator()  )  const [inline]
 

Returns s11nlite::save( this->source, this->destination ).

Definition at line 594 of file s11nlite.hpp.


Member Data Documentation

template<typename T, typename OutputT>
OutputT s11nlite::save_nullary_base_f< T, OutputT >::destination
 

Definition at line 579 of file s11nlite.hpp.

template<typename T, typename OutputT>
T const& s11nlite::save_nullary_base_f< T, OutputT >::source
 

Definition at line 578 of file s11nlite.hpp.


The documentation for this struct was generated from the following file:
Generated on Sat Dec 10 13:43:16 2005 for libs11n-1.2.1 by  doxygen 1.4.4