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

s11n::Detail::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 <algo.hpp>

List of all members.

Public Types

typedef ListType list_type
typedef ListType::value_type full_value_type
typedef ::s11n::type_traits<
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) throw ()
 Inserts a copy of p into this object's list and returns true.


Detailed Description

template<typename ListType>
class s11n::Detail::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.

Assuming T is the type contained in ListType, stripped of any pointer part, then the following must hold:

T * t = new T( *p );

Where p is a passed to this type's operator().

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

It might be interesting to note that copying monomorphic s11n::s11n_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 352 of file algo.hpp.


Member Typedef Documentation

template<typename ListType>
typedef ListType::value_type s11n::Detail::child_pointer_deep_copier< ListType >::full_value_type
 

Definition at line 356 of file algo.hpp.

template<typename ListType>
typedef ListType s11n::Detail::child_pointer_deep_copier< ListType >::list_type
 

Definition at line 355 of file algo.hpp.

template<typename ListType>
typedef ::s11n::type_traits<full_value_type>::type s11n::Detail::child_pointer_deep_copier< ListType >::value_type
 

Definition at line 357 of file algo.hpp.


Constructor & Destructor Documentation

template<typename ListType>
s11n::Detail::child_pointer_deep_copier< ListType >::child_pointer_deep_copier list_type target  )  [inline]
 

Target list must outlive this object.

Definition at line 361 of file algo.hpp.


Member Function Documentation

template<typename ListType>
bool s11n::Detail::child_pointer_deep_copier< ListType >::operator() const value_type p  )  throw () [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 will catch it and not modify the underlying container. In that case, false is returned.

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

Definition at line 375 of file algo.hpp.


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