32#include "json/genericMapper.hpp"
33#include "json/constants.hpp"
34#include "json/mappingOptions.hpp"
35#include "json/mappingFunctions.hpp"
36#include "json/readerContext.hpp"
84 std::map<std::string, anch::json::DeserializeFn<T>> _readers;
111 virtual ~ObjectMapper();
127 ObjectMapper<T>& registerField(
const std::string& key, P T::* value);
140 template<
typename MT,
typename P>
141 ObjectMapper<T>& registerField(
const std::string& key, P T::* value);
154 template<
typename P,
typename MT = P>
155 ObjectMapper<T>& registerField(
const std::string& key, std::function<P(
const T&)> getter);
168 template<
typename P,
typename MT = P>
169 ObjectMapper<T>& registerField(
const std::string& key, std::function<
void(T&,
const P&)> setter);
183 template<
typename P,
typename MT = P>
184 ObjectMapper<T>& registerField(
const std::string& key, std::function<P(
const T&)> getter, std::function<
void(T&,
const P&)> setter);
207 const std::optional<std::string>& field =
EMPTY_FIELD);
222 const std::optional<std::string>& field =
EMPTY_FIELD);
237 const std::optional<std::string>& field =
EMPTY_FIELD);
252 const std::optional<std::string>& field =
EMPTY_FIELD);
267 const std::optional<std::string>& field =
EMPTY_FIELD);
282 const std::optional<std::string>& field =
EMPTY_FIELD);
297 const std::optional<std::string>& field =
EMPTY_FIELD);
324#include "json/impl/mapper.hpp"
JSON mapper factory.
Definition factory.hpp:52
Generic mapper.
Definition genericMapper.hpp:45
JSON complex object mapper.
Definition mapper.hpp:73
bool serialize(const std::optional< T > &value, std::ostream &out, const anch::json::MappingOptions &options, const std::optional< std::string > &field=EMPTY_FIELD)
bool serialize(const T &value, std::ostream &out, const anch::json::MappingOptions &options, const std::optional< std::string > &field=EMPTY_FIELD)
ObjectMapper(ObjectMapper &&other)=delete
bool serialize(const std::list< T > &value, std::ostream &out, const anch::json::MappingOptions &options, const std::optional< std::string > &field=EMPTY_FIELD)
bool serialize(const T *const value, std::ostream &out, const anch::json::MappingOptions &options, const std::optional< std::string > &field=EMPTY_FIELD)
bool serialize(const std::map< std::string, T > &value, std::ostream &out, const anch::json::MappingOptions &options, const std::optional< std::string > &field=EMPTY_FIELD)
bool serialize(const std::set< T > &value, std::ostream &out, const anch::json::MappingOptions &options, const std::optional< std::string > &field=EMPTY_FIELD)
bool deserialize(T &value, anch::json::ReaderContext &context) const
bool serialize(const std::vector< T > &value, std::ostream &out, const anch::json::MappingOptions &options, const std::optional< std::string > &field=EMPTY_FIELD)
ObjectMapper(const ObjectMapper &other)=delete
JSON reader context.
Definition readerContext.hpp:42
JSON namespace.
Definition constants.hpp:25
const std::optional< std::string > EMPTY_FIELD
void registerObject(anch::json::ObjectMapper< T > &mapper)
JSON mapping options.
Definition mappingOptions.hpp:35