Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members

s11n::data_node_child_deserializer< ListType > Struct Template Reference

A helper functor deserialize a set of data_nodes. More...

#include <data_node_functor.h>

List of all members.

Public Types

typedef ListType list_type
 The ListType templatized type.

typedef pointer_stripper<
typename list_type::value_type
>::value_type 
value_type
 value_type is equivalent to a SerializableType.


Public Member Functions

 data_node_child_deserializer (list_type &dest, bool tolerant=false)
 Creates an object for deserializing Serializables into a target list.

template<typename NodeType> bool operator() (const NodeType *src)
 Tries to deserialize a (value_type *) from src.


Public Attributes

bool result
 For use as a "return value catcher" for std::for_each().


Detailed Description

template<typename ListType>
struct s11n::data_node_child_deserializer< ListType >

A helper functor deserialize a set of data_nodes.

Designed for use with std::for_each().

ListType must be compatible with std::list<SomeSerializableType *>.

Definition at line 132 of file data_node_functor.h.


Member Typedef Documentation

template<typename ListType>
typedef ListType s11n::data_node_child_deserializer< ListType >::list_type
 

The ListType templatized type.

Must support:

push_back(value_type *);

Definition at line 139 of file data_node_functor.h.


Constructor & Destructor Documentation

template<typename ListType>
s11n::data_node_child_deserializer< ListType >::data_node_child_deserializer list_type dest,
bool  tolerant = false
[inline]
 

Creates an object for deserializing Serializables into a target list.

If tolerant is true then this object will always try to deserialize new items passed to it's operator(). If it is false (the default) it will stop processing after a single failure.

Preconditions:

  • dest must outlive this object. More correctly, this object's operator() must not be called after either dest is destroyed.

Definition at line 163 of file data_node_functor.h.

References s11n::data_node_child_deserializer< ListType >::result.


Member Function Documentation

template<typename ListType>
template<typename NodeType>
bool s11n::data_node_child_deserializer< ListType >::operator() const NodeType *  src  )  [inline]
 

Tries to deserialize a (value_type *) from src.

On error it returns 0, else it inserts the new child into this object's destination container and returns true.

Postconditions:

  • If successful, this object's destination container owns the returned pointers.

Definition at line 180 of file data_node_functor.h.

References s11n::data_node_child_deserializer< ListType >::operator()(), and s11n::data_node_child_deserializer< ListType >::result.

Referenced by s11n::data_node_child_deserializer< ListType >::operator()().


Member Data Documentation

template<typename ListType>
bool s11n::data_node_child_deserializer< ListType >::result
 

For use as a "return value catcher" for std::for_each().

If tolerant is true then this will only reveal the value of the most-recently-processed node.

Definition at line 199 of file data_node_functor.h.

Referenced by s11n::data_node_child_deserializer< ListType >::data_node_child_deserializer(), and s11n::data_node_child_deserializer< ListType >::operator()().


The documentation for this struct was generated from the following file:
Generated on Tue Jul 20 10:46:48 2004 for s11n by doxygen 1.3.7