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

s11n::child_pointer_deep_copier< ListType > Class Template Reference

child_pointer_deep_copier is a functor to deep-copy a list of pointers into another list. More...

#include <functor.h>

List of all members.

Public Types

typedef ListType list_type
typedef ListType::value_type full_value_type
typedef PtrStrip< full_value_type
>::type 
value_type

Public Member Functions

 child_pointer_deep_copier (list_type &target)
 Target list must outlive this object.
bool operator() (const value_type *p)
 Inserts a copy of p into this object's list and returns true.

Classes

struct  PtrStrip
struct  PtrStrip< T * >


Detailed Description

template<typename ListType>
class s11n::child_pointer_deep_copier< ListType >

child_pointer_deep_copier is a functor to deep-copy a list of pointers into another list.

Designed for use with std::for_each and the like.

ListType must support:

push_back( value_type * ).

ACHTUNG: This is only useful for non-polymorphic copying.

It might be interesting to note that copying S11N_NS::data_node objects this way is "pseudo-polymorphic" - the copy itself is monomorphic but the data needed to deserialize the proper type from the node is maintained.

Definition at line 309 of file functor.h.


Member Function Documentation

template<typename ListType>
bool s11n::child_pointer_deep_copier< ListType >::operator() const value_type p  )  [inline]
 

Inserts a copy of p into this object's list and returns true.

Returns true if p is successfully copied.

If an exception thrown while copying this function has no effect, and the target node is not modified.

The target node takes ownership of the new copy of p.

Definition at line 334 of file functor.h.


The documentation for this class was generated from the following file:
Generated on Thu Jun 16 16:18:13 2005 for s11n by  doxygen 1.4.3-20050530