#include <functional.hpp>
Public Types | |
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, 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 (non-polymorphically!) and deserializes it. | |
Public Attributes | |
type | iterator |
BinaryFunctorT | functor |
The optional BinaryFunctorT 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. Note that only monomorphic Serializables are properly handled by this type!
BinaryFunctorT must conform to the interface defined by deserialize_binary_f.
Example, assuming NTR is a node_traits type:
std::vector<MyType> myvector; std::for_each( NTR::children(node).begin(), NTR::children(node).end(), deser_to_outiter_f<MyType>( std::back_inserter(myvector) ) );
Definition at line 817 of file functional.hpp.
typedef OutIterator s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, BinaryFunctorT >::type |
Definition at line 820 of file functional.hpp.
typedef SerializableType s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, BinaryFunctorT >::serializable_type |
Definition at line 823 of file functional.hpp.
s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, BinaryFunctorT >::deserialize_to_output_iter_f | ( | type | target | ) | [inline, explicit] |
s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, BinaryFunctorT >::deserialize_to_output_iter_f | ( | type | target, | |
BinaryFunctorT | f | |||
) | [inline] |
Sets this object's output iterator and copies the given functor.
Definition at line 837 of file functional.hpp.
bool s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, BinaryFunctorT >::operator() | ( | NodeType *const & | src | ) | [inline] |
creates a new object of serializable_type (non-polymorphically!) 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 854 of file functional.hpp.
References s11n::cleanup_ptr< SerializableT >::get(), and s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, BinaryFunctorT >::iterator.
type s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, BinaryFunctorT >::iterator |
Definition at line 821 of file functional.hpp.
Referenced by s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, BinaryFunctorT >::operator()().
BinaryFunctorT s11n::deserialize_to_output_iter_f< SerializableType, OutIterator, BinaryFunctorT >::functor |
Definition at line 822 of file functional.hpp.