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

s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT > Struct Template Reference

A functor to allow us to easily walk a list of S-Nodes and deserialize each one into a target container. More...

#include <experimental.hpp>

List of all members.

Public Types

typedef OutIterator type
typedef SerializableType serializable_type
typedef OutIterator type
typedef SerializableType serializable_type

Public Member Functions

 deserialize_to_output_iter_f (type target)
 Sets this object's output iterator.
 deserialize_to_output_iter_f (type target, FunctorT f)
 Sets this object's output iterator and copies the given functor.
template<typename NodeType>
bool operator() (NodeType *const &src)
 Creates a new object of serializable_type and deserializes it.
 deserialize_to_output_iter_f (type target)
 Sets this object's output iterator.
 deserialize_to_output_iter_f (type target, BinaryFunctorT f)
 Sets this object's output iterator and copies the given functor.
template<typename NodeType>
bool operator() (NodeType *const &src)
 Creates a new object of serializable_type and deserializes it.

Public Attributes

type iterator
FunctorT functor
BinaryFunctorT functor


Detailed Description

template<typename SerializableType, typename OutIterator, typename FunctorT = deserialize_f>
struct s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >

A functor to allow us to easily walk a list of S-Nodes and deserialize each one into a target container.

The optional FunctorT defines the functor to use to deserialize each object. The default simply routes through the s11n::deserialize() API.

SerializableType is unforuntately required: we can't derive it from the output iterator.

SerializableType MAY NOT yet be pointer-qualified. That's on the to-fix list somewhere. It would inherently cause a leak or be very incorrect in some uses, though, like using an ostream_iterator(). It could be made to function, but would not be leak-proof.

Also, we create and copy SerializableTypes here, so that type should be cheap to do that with.

FunctorT must conform to the interface defined by deserialize_f.

Example, assuming NTR is a node_traits type:

	   std::for_each( NTR::children(node).begin(),
		          NTR::children(node).end(),
		          deser_to_outiter_f<MyType>( std::back_inserter(myvector) ) );
	   

Definition at line 475 of file experimental.hpp.


Member Typedef Documentation

template<typename SerializableType, typename OutIterator, typename FunctorT = deserialize_f>
typedef SerializableType s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::serializable_type
 

Definition at line 809 of file functional.hpp.

template<typename SerializableType, typename OutIterator, typename FunctorT = deserialize_f>
typedef SerializableType s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::serializable_type
 

Definition at line 480 of file experimental.hpp.

template<typename SerializableType, typename OutIterator, typename FunctorT = deserialize_f>
typedef OutIterator s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::type
 

Definition at line 806 of file functional.hpp.

template<typename SerializableType, typename OutIterator, typename FunctorT = deserialize_f>
typedef OutIterator s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::type
 

Definition at line 477 of file experimental.hpp.


Constructor & Destructor Documentation

template<typename SerializableType, typename OutIterator, typename FunctorT = deserialize_f>
s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::deserialize_to_output_iter_f type  target  )  [inline, explicit]
 

Sets this object's output iterator.

Definition at line 487 of file experimental.hpp.

References s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::functor, and s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::iterator.

template<typename SerializableType, typename OutIterator, typename FunctorT = deserialize_f>
s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::deserialize_to_output_iter_f type  target,
FunctorT  f
[inline]
 

Sets this object's output iterator and copies the given functor.

Definition at line 494 of file experimental.hpp.

References s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::functor, and s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::iterator.

template<typename SerializableType, typename OutIterator, typename FunctorT = deserialize_f>
s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::deserialize_to_output_iter_f type  target  )  [inline, explicit]
 

Sets this object's output iterator.

Definition at line 816 of file functional.hpp.

References s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::functor, and s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::iterator.

template<typename SerializableType, typename OutIterator, typename FunctorT = deserialize_f>
s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::deserialize_to_output_iter_f type  target,
BinaryFunctorT  f
[inline]
 

Sets this object's output iterator and copies the given functor.

Definition at line 823 of file functional.hpp.

References s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::functor, and s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::iterator.


Member Function Documentation

template<typename SerializableType, typename OutIterator, typename FunctorT = deserialize_f>
template<typename NodeType>
bool s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::operator() NodeType *const &  src  )  [inline]
 

Creates a new object of serializable_type and deserializes it.

On success iterator is assigned and incremented and true is returned. On error false is returned or an exception is propagated.

If src is (!src), false is returned.

Note that the odd pointerness of the argument is because node children lists contain pointers and are const in a deserialize context.

Definition at line 838 of file functional.hpp.

References s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::functor, and s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::iterator.

template<typename SerializableType, typename OutIterator, typename FunctorT = deserialize_f>
template<typename NodeType>
bool s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::operator() NodeType *const &  src  )  [inline]
 

Creates a new object of serializable_type and deserializes it.

On success iterator is assigned and incremented and true is returned. On error false is returned or an exception is propagated.

If src is (!src), false is returned.

Definition at line 505 of file experimental.hpp.

References s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::functor, and s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::iterator.


Member Data Documentation

template<typename SerializableType, typename OutIterator, typename FunctorT = deserialize_f>
BinaryFunctorT s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::functor
 

Definition at line 808 of file functional.hpp.

template<typename SerializableType, typename OutIterator, typename FunctorT = deserialize_f>
FunctorT s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::functor [mutable]
 

Definition at line 479 of file experimental.hpp.

Referenced by s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::deserialize_to_output_iter_f(), and s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::operator()().

template<typename SerializableType, typename OutIterator, typename FunctorT = deserialize_f>
type s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::iterator
 

Definition at line 807 of file functional.hpp.

Referenced by s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::deserialize_to_output_iter_f(), and s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, FunctorT >::operator()().


The documentation for this struct was generated from the following files:
Generated on Thu Sep 29 20:01:15 2005 for libs11n-1.1.3-dev by  doxygen 1.4.1