class Serializer
Defined at line 135 of file ../../third_party/github.com/google/cppdap/src/include/dap/serialization.h
Serializer is the interface used to encode data to structured storage.
A Serializer is associated with a single storage object, whos type and value
is assigned by a call to serialize().
If serialize() is called multiple times on the same Serializer instance,
the last type and value is stored.
Methods that return a bool use this to indicate success.
Public Methods
bool serialize (boolean )
serialization methods for simple data types.
bool serialize (integer )
bool serialize (number )
bool serialize (const string & )
bool serialize (const dap::object & )
bool serialize (const any & )
bool array (size_t count, const std::function<bool (Serializer *)> & )
array() encodes count array elements to the array object referenced by this
Serializer. The std::function will be called count times, each time with a
Serializer that should be used to encode the n'th array element's data.
bool object (const std::function<bool (dap::FieldSerializer *)> & )
object() begins encoding the object referenced by this Serializer.
The std::function will be called with a FieldSerializer to serialize the
object's fields.
void remove ()
remove() deletes the object referenced by this Serializer.
remove() can be used to serialize optionals with no value assigned.
void ~Serializer ()
Defined at line 137 of file ../../third_party/github.com/google/cppdap/src/include/dap/serialization.h
template <typename T, typename = std::enable_if<TypeOf<T>::has_custom_serialization>>
bool serialize (const T & )
serialize() delegates to TypeOf
<T
>::type()->serialize().
Defined at line 193 of file ../../third_party/github.com/google/cppdap/src/include/dap/serialization.h
template <typename T>
bool serialize (const dap::array<T> & )
serialize() encodes the given array.
Defined at line 198 of file ../../third_party/github.com/google/cppdap/src/include/dap/serialization.h
template <typename T>
bool serialize (const dap::optional<T> & v)
serialize() encodes the given optional.
Defined at line 204 of file ../../third_party/github.com/google/cppdap/src/include/dap/serialization.h
template <typename T0, typename... Types>
bool serialize (const dap::variant<T0, Types...> & )
serialize() encodes the given variant.
Defined at line 213 of file ../../third_party/github.com/google/cppdap/src/include/dap/serialization.h
bool serialize (const char * v)
deserialize() encodes the given string.
Defined at line 217 of file ../../third_party/github.com/google/cppdap/src/include/dap/serialization.h
Protected Methods
const TypeInfo * get_any_type (const any & )
Defined at line 185 of file ../../third_party/github.com/google/cppdap/src/include/dap/serialization.h
const void * get_any_val (const any & )
Defined at line 188 of file ../../third_party/github.com/google/cppdap/src/include/dap/serialization.h