Generic mapper. More...
#include <genericMapper.hpp>
Public Member Functions | |
GenericMapper (const GenericMapper< M, T > &other)=delete | |
GenericMapper (GenericMapper< M, T > &&other)=delete | |
void | serialize (const T &value, anch::json::WriterContext &context) const |
void | serialize (const std::optional< T > &value, anch::json::WriterContext &context) const |
void | serialize (const T *const value, anch::json::WriterContext &context) const |
void | serialize (const std::shared_ptr< T > &value, anch::json::WriterContext &context) const |
void | serialize (const std::vector< T > &value, anch::json::WriterContext &context) const |
void | serialize (const std::list< T > &value, anch::json::WriterContext &context) const |
void | serialize (const std::set< T > &value, anch::json::WriterContext &context) const |
void | serialize (const std::map< std::string, T > &value, anch::json::WriterContext &context) const |
bool | serialize (const std::string &field, const T &value, anch::json::WriterContext &context) const |
bool | serialize (const std::string &field, const std::optional< T > &value, anch::json::WriterContext &context) const |
bool | serialize (const std::string &field, const T *const value, anch::json::WriterContext &context) const |
bool | serialize (const std::string &field, const std::shared_ptr< T > &value, anch::json::WriterContext &context) const |
bool | serialize (const std::string &field, const std::vector< T > &value, anch::json::WriterContext &context) const |
bool | serialize (const std::string &field, const std::list< T > &value, anch::json::WriterContext &context) const |
bool | serialize (const std::string &field, const std::set< T > &value, anch::json::WriterContext &context) const |
bool | serialize (const std::string &field, const std::map< std::string, T > &value, anch::json::WriterContext &context) const |
bool | deserialize (T &value, anch::json::ReaderContext &context) const |
bool | deserialize (std::optional< T > &value, anch::json::ReaderContext &context) const |
bool | deserialize (T *value, anch::json::ReaderContext &context) const |
bool | deserialize (std::shared_ptr< T > &value, anch::json::ReaderContext &context) const |
bool | deserialize (std::vector< T > &value, anch::json::ReaderContext &context) const |
bool | deserialize (std::list< T > &value, anch::json::ReaderContext &context) const |
bool | deserialize (std::set< T > &value, anch::json::ReaderContext &context) const |
bool | deserialize (anch::Flux< T > &value, anch::json::ReaderContext &context) const |
bool | deserialize (std::map< std::string, T > &value, anch::json::ReaderContext &context) const |
Protected Member Functions | |
GenericMapper () | |
virtual | ~GenericMapper () |
Generic mapper.
Based on C++ CRT. It provides generic functions for collections mapping.
M | the inherited class type (mapper) |
T | the type to map |
|
protected |
GenericMapper defaullt protected constructor
|
delete |
Forbids GenericMapper copy constructor
other | the GenericMapper not to copy |
|
delete |
Forbids GenericMapper move constructor
other | the GenericMapper not to move |
|
protectedvirtual |
GenericMapper destructor
bool anch::json::GenericMapper< M, T >::deserialize | ( | anch::Flux< T > & | value, |
anch::json::ReaderContext & | context ) const |
Deserialize JSON value
value | the value to set |
context | the mapping context |
bool anch::json::GenericMapper< M, T >::deserialize | ( | std::list< T > & | value, |
anch::json::ReaderContext & | context ) const |
Deserialize JSON value
value | the value to set |
context | the mapping context |
bool anch::json::GenericMapper< M, T >::deserialize | ( | std::map< std::string, T > & | value, |
anch::json::ReaderContext & | context ) const |
Deserialize JSON value
value | the value to set |
context | the mapping context |
bool anch::json::GenericMapper< M, T >::deserialize | ( | std::optional< T > & | value, |
anch::json::ReaderContext & | context ) const |
Deserialize JSON value
value | the value to set |
context | the mapping context |
null
, false
otherwise bool anch::json::GenericMapper< M, T >::deserialize | ( | std::set< T > & | value, |
anch::json::ReaderContext & | context ) const |
Deserialize JSON value
value | the value to set |
context | the mapping context |
bool anch::json::GenericMapper< M, T >::deserialize | ( | std::shared_ptr< T > & | value, |
anch::json::ReaderContext & | context ) const |
Deserialize JSON value
value | the value to set |
context | the mapping context |
null
, false
otherwise bool anch::json::GenericMapper< M, T >::deserialize | ( | std::vector< T > & | value, |
anch::json::ReaderContext & | context ) const |
Deserialize JSON value
value | the value to set |
context | the mapping context |
bool anch::json::GenericMapper< M, T >::deserialize | ( | T & | value, |
anch::json::ReaderContext & | context ) const |
Deserialize JSON value
value | the value to set |
context | the mapping context |
null
, false
otherwise bool anch::json::GenericMapper< M, T >::deserialize | ( | T * | value, |
anch::json::ReaderContext & | context ) const |
Deserialize JSON value
value | the value to set |
context | the mapping context |
null
, false
otherwise void anch::json::GenericMapper< M, T >::serialize | ( | const std::list< T > & | value, |
anch::json::WriterContext & | context ) const |
Serialize array values according to empty option
value | the value |
context | the context |
void anch::json::GenericMapper< M, T >::serialize | ( | const std::map< std::string, T > & | value, |
anch::json::WriterContext & | context ) const |
Serialize map values according to empty option
value | the value |
context | the context |
void anch::json::GenericMapper< M, T >::serialize | ( | const std::optional< T > & | value, |
anch::json::WriterContext & | context ) const |
Serialize value according to optional/null option
value | the value |
context | the context |
void anch::json::GenericMapper< M, T >::serialize | ( | const std::set< T > & | value, |
anch::json::WriterContext & | context ) const |
Serialize array values according to empty option
value | the value |
context | the context |
void anch::json::GenericMapper< M, T >::serialize | ( | const std::shared_ptr< T > & | value, |
anch::json::WriterContext & | context ) const |
Serialize value according to optional/null option
value | the value |
context | the context |
bool anch::json::GenericMapper< M, T >::serialize | ( | const std::string & | field, |
const std::list< T > & | value, | ||
anch::json::WriterContext & | context ) const |
Serialize array values according to empty option
field | the field's name |
value | the value |
context | the context |
true
when field has been write, false
otherwise bool anch::json::GenericMapper< M, T >::serialize | ( | const std::string & | field, |
const std::map< std::string, T > & | value, | ||
anch::json::WriterContext & | context ) const |
Serialize map values according to empty option
field | the field's name |
value | the value |
context | the context |
true
when field has been write, false
otherwise bool anch::json::GenericMapper< M, T >::serialize | ( | const std::string & | field, |
const std::optional< T > & | value, | ||
anch::json::WriterContext & | context ) const |
Serialize value according to optional/null option
field | the field's name |
value | the value |
context | the context |
true
when field has been write, false
otherwise bool anch::json::GenericMapper< M, T >::serialize | ( | const std::string & | field, |
const std::set< T > & | value, | ||
anch::json::WriterContext & | context ) const |
Serialize array values according to empty option
field | the field's name |
value | the value |
context | the context |
true
when field has been write, false
otherwise bool anch::json::GenericMapper< M, T >::serialize | ( | const std::string & | field, |
const std::shared_ptr< T > & | value, | ||
anch::json::WriterContext & | context ) const |
Serialize value according to optional/null option
field | the field's name |
value | the value |
context | the context |
true
when field has been write, false
otherwise bool anch::json::GenericMapper< M, T >::serialize | ( | const std::string & | field, |
const std::vector< T > & | value, | ||
anch::json::WriterContext & | context ) const |
Serialize array values according to empty option
field | the field's name |
value | the value |
context | the context |
true
when field has been write, false
otherwise bool anch::json::GenericMapper< M, T >::serialize | ( | const std::string & | field, |
const T & | value, | ||
anch::json::WriterContext & | context ) const |
Serialize value
field | the field's name |
value | the value |
context | the context |
true
when field has been write, false
otherwise bool anch::json::GenericMapper< M, T >::serialize | ( | const std::string & | field, |
const T *const | value, | ||
anch::json::WriterContext & | context ) const |
Serialize value according to optional/null option
field | the field's name |
value | the value |
context | the context |
true
when field has been write, false
otherwise void anch::json::GenericMapper< M, T >::serialize | ( | const std::vector< T > & | value, |
anch::json::WriterContext & | context ) const |
Serialize array values according to empty option
value | the value |
context | the context |
void anch::json::GenericMapper< M, T >::serialize | ( | const T & | value, |
anch::json::WriterContext & | context ) const |
Serialize value
value | the value |
context | the context |
void anch::json::GenericMapper< M, T >::serialize | ( | const T *const | value, |
anch::json::WriterContext & | context ) const |
Serialize value according to optional/null option
value | the value |
context | the context |