child_pointer_deep_copier is a functor to deep-copy a list of pointers into another list. More...
#include <algo.hpp>
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. |
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:
push_back( T * )
.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.
typedef ListType::value_type s11n::Detail::child_pointer_deep_copier< ListType >::full_value_type |
typedef ListType s11n::Detail::child_pointer_deep_copier< ListType >::list_type |
typedef ::s11n::type_traits<full_value_type>::type s11n::Detail::child_pointer_deep_copier< ListType >::value_type |
s11n::Detail::child_pointer_deep_copier< ListType >::child_pointer_deep_copier | ( | list_type & | target | ) | [inline] |
bool s11n::Detail::child_pointer_deep_copier< ListType >::operator() | ( | const value_type * | p | ) | throw () [inline] |