AnCH Framework 0.1
Another C++ Hack Framework
Loading...
Searching...
No Matches
anch::json::ObjectMapper< T > Class Template Reference

JSON complex object mapper. More...

#include <mapper.hpp>

Inheritance diagram for anch::json::ObjectMapper< T >:
Collaboration diagram for anch::json::ObjectMapper< T >:

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 ()

Detailed Description

template<typename T>
class anch::json::ObjectMapper< T >

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.

Template Parameters
Tthe object type
Author
Vincent Lachenal
Since
0.1

Constructor & Destructor Documentation

◆ ObjectMapper() [1/2]

template<typename T>
anch::json::ObjectMapper< T >::ObjectMapper ( const ObjectMapper< T > & other)
delete

Forbids ObjectMapper copy constructor

◆ ObjectMapper() [2/2]

template<typename T>
anch::json::ObjectMapper< T >::ObjectMapper ( ObjectMapper< T > && other)
delete

Forbids ObjectMapper move constructor

Member Function Documentation

◆ deserializeValue()

template<typename T>
bool anch::json::ObjectMapper< T >::deserializeValue ( T & value,
anch::json::ReaderContext & context ) const

Deserialize JSON

Parameters
valuethe value to write in
contextthe mapper context
Returns
false when null found, true otherwise

◆ serializeValue()

template<typename T>
void anch::json::ObjectMapper< T >::serializeValue ( const T & value,
anch::json::WriterContext & context ) const

Serialize value

Parameters
valuethe reference attribute to serialize
contextthe writer context

The documentation for this class was generated from the following file: