JSON complex object mapper. More...
#include <mapper.hpp>
Public Member Functions | |
ObjectMapper (const ObjectMapper &other)=delete | |
ObjectMapper (ObjectMapper &&other)=delete | |
void | serializeValue (const T &value, anch::json::WriterContext &context) const |
bool | deserializeValue (T &value, anch::json::ReaderContext &context) const |
Public Member Functions inherited from anch::json::GenericMapper< ObjectMapper< T >, T > | |
void | serialize (const T &value, anch::json::WriterContext &context) const |
bool | deserialize (T &value, anch::json::ReaderContext &context) const |
Friends | |
template<typename U> | |
void | anch::json::registerObject (ObjectMapper< U > &) |
Additional Inherited Members | |
Protected Member Functions inherited from anch::json::GenericMapper< ObjectMapper< T >, T > | |
GenericMapper () | |
virtual | ~GenericMapper () |
JSON complex object mapper.
This is a generic template header implementation.
Type has to be a class or a structure. The fields have to be registered through the registerObject function implementation for the specific type.
T | the object type |
|
delete |
Forbids ObjectMapper copy constructor
|
delete |
Forbids ObjectMapper move constructor
bool anch::json::ObjectMapper< T >::deserializeValue | ( | T & | value, |
anch::json::ReaderContext & | context ) const |
Deserialize JSON
value | the value to write in |
context | the mapper context |
false
when null
found, true
otherwise void anch::json::ObjectMapper< T >::serializeValue | ( | const T & | value, |
anch::json::WriterContext & | context ) const |
Serialize value
value | the reference attribute to serialize |
context | the writer context |