32#include "json/constants.hpp"
33#include "json/mappingOptions.hpp"
34#include "json/mappingFunctions.hpp"
35#include "json/readerContext.hpp"
83 std::map<std::string, anch::json::DeserializeFn<T>> _readers;
110 virtual ~ObjectMapper();
126 ObjectMapper<T>& registerField(
const std::string& key, P T::* value);
139 template<
typename MT,
typename P>
140 ObjectMapper<T>& registerField(
const std::string& key, P T::* value);
153 template<
typename P,
typename MT = P>
154 ObjectMapper<T>& registerField(
const std::string& key, std::function<P(
const T&)> getter);
167 template<
typename P,
typename MT = P>
168 ObjectMapper<T>& registerField(
const std::string& key, std::function<
void(T&,
const P&)> setter);
182 template<
typename P,
typename MT = P>
183 ObjectMapper<T>& registerField(
const std::string& key, std::function<P(
const T&)> getter, std::function<
void(T&,
const P&)> setter);
199 const std::optional<std::string>& field =
EMPTY_FIELD);
214 const std::optional<std::string>& field =
EMPTY_FIELD);
229 const std::optional<std::string>& field =
EMPTY_FIELD);
244 const std::optional<std::string>& field =
EMPTY_FIELD);
259 const std::optional<std::string>& field =
EMPTY_FIELD);
274 const std::optional<std::string>& field =
EMPTY_FIELD);
289 const std::optional<std::string>& field =
EMPTY_FIELD);
385#include "json/impl/mapper.hpp"
JSON mapper factory.
Definition factory.hpp:52
JSON complex object mapper.
Definition mapper.hpp:72
bool serialize(const std::optional< T > &value, std::ostream &out, const anch::json::MappingOptions &options, const std::optional< std::string > &field=EMPTY_FIELD)
bool deserialize(std::set< T > &value, anch::json::ReaderContext &context)
bool serialize(const T &value, std::ostream &out, const anch::json::MappingOptions &options, const std::optional< std::string > &field=EMPTY_FIELD)
bool deserialize(std::optional< T > &value, anch::json::ReaderContext &context)
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 deserialize(std::list< T > &value, anch::json::ReaderContext &context)
bool deserialize(T *value, anch::json::ReaderContext &context)
bool deserialize(std::map< std::string, T > &value, anch::json::ReaderContext &context)
bool deserialize(std::vector< T > &value, anch::json::ReaderContext &context)
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 serialize(const std::vector< 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)
ObjectMapper(const ObjectMapper &other)=delete
JSON mapper 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