#include <stdio.h>
#include <valarray>
#include <s11n.net/s11n/variant.hpp>
Go to the source code of this file.
Namespaces | |
namespace | s11n |
namespace | s11n::va |
Defines | |
#define | s11n_VALARRAY_HPP_INCLUDED 1 |
Functions | |
template<typename NodeT, typename VAT> | |
bool | serialize_valarray (NodeT &dest, const VAT &src) |
Serializes src to dest. | |
template<typename NodeT, typename VAT> | |
bool | deserialize_valarray (const NodeT &src, VAT &dest) |
Deserializes dest from src. |
|
Definition at line 7 of file valarray.hpp. |
|
Deserializes dest from src. Returns true on success, false on error. VAT must be a std::valarray type with a numeric value_type. Always returns true. Definition at line 83 of file valarray.hpp. Referenced by s11n::va::valarray_serializable_proxy::operator()(). |
|
Serializes src to dest. Returns true on success, false on error. VAT must be a std::valarray type with a numeric value_type. Always returns true. Each entry is stored as a key/value pair in src, which means this algorithm works with all iostreamable contained types. Since valarray is intended for use with numbers, this should be appropriate for all cases. To avoid entering numeric keys into dest, which don't work with XML serializers, and to keep proper ordering of the keys, it synthesizes sequential numbers, preceded by an 'x', for use as keys. The number of digits in the keys is calculated based off of src.size(). This function never returns false, but will throw if src has more than some arbitrarily large number of items (at least 64 bits worth), due to a minor detail you can read about in the source code. ACHTUNG: precision of doubles in limited to whatever default is used by s11n for lexical casting via iostreams. Definition at line 50 of file valarray.hpp. Referenced by s11n::va::valarray_serializable_proxy::operator()(). |