AnCH Framework
0.1
Another C++ Hack Framework
Loading...
Searching...
No Matches
genericMapper.hpp
1
/*
2
ANCH Framework: ANother C++ Hack is a C++ framework based on C++11 standard
3
Copyright (C) 2020 Vincent Lachenal
4
5
This file is part of ANCH Framework.
6
7
ANCH Framework is free software: you can redistribute it and/or modify
8
it under the terms of the GNU Lesser General Public License as published by
9
the Free Software Foundation, either version 3 of the License, or
10
(at your option) any later version.
11
12
ANCH Framework is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU Lesser General Public License for more details.
16
17
You should have received a copy of the GNU Lesser General Public License
18
along with ANCH Framework. If not, see <http://www.gnu.org/licenses/>.
19
*/
20
#pragma once
21
22
#include <string>
23
#include <vector>
24
#include <map>
25
#include <optional>
26
#include <list>
27
#include <set>
28
#include <map>
29
30
#include "json/readerContext.hpp"
31
32
namespace
anch::json
{
33
44
template
<
typename
M,
typename
T>
45
class
GenericMapper
{
46
47
// Constructors +
48
protected
:
52
GenericMapper
();
53
54
public
:
60
GenericMapper
(
const
GenericMapper<M,T>
& other) =
delete
;
61
67
GenericMapper
(
GenericMapper<M,T>
&& other) =
delete
;
68
// Constructors -
69
70
// Destructor +
71
protected
:
75
virtual
~GenericMapper
();
76
// Destructor -
77
78
// Methods +
79
public
:
88
bool
deserialize
(std::optional<T>& value,
anch::json::ReaderContext
& context)
const
;
89
98
bool
deserialize
(T* value,
anch::json::ReaderContext
& context)
const
;
99
106
bool
deserialize
(std::vector<T>& value,
anch::json::ReaderContext
& context)
const
;
107
114
bool
deserialize
(std::list<T>& value,
anch::json::ReaderContext
& context)
const
;
115
122
bool
deserialize
(std::set<T>& value,
anch::json::ReaderContext
& context)
const
;
123
130
bool
deserialize
(std::map<std::string,T>& value,
anch::json::ReaderContext
& context)
const
;
131
// Methods -
132
133
};
134
135
}
136
137
#include "json/impl/genericMapper.hpp"
anch::json::GenericMapper::GenericMapper
GenericMapper(GenericMapper< M, T > &&other)=delete
anch::json::GenericMapper::GenericMapper
GenericMapper(const GenericMapper< M, T > &other)=delete
anch::json::GenericMapper::deserialize
bool deserialize(std::list< T > &value, anch::json::ReaderContext &context) const
anch::json::GenericMapper::deserialize
bool deserialize(std::vector< T > &value, anch::json::ReaderContext &context) const
anch::json::GenericMapper::deserialize
bool deserialize(std::map< std::string, T > &value, anch::json::ReaderContext &context) const
anch::json::GenericMapper::deserialize
bool deserialize(T *value, anch::json::ReaderContext &context) const
anch::json::GenericMapper::deserialize
bool deserialize(std::optional< T > &value, anch::json::ReaderContext &context) const
anch::json::GenericMapper::~GenericMapper
virtual ~GenericMapper()
anch::json::GenericMapper::GenericMapper
GenericMapper()
anch::json::GenericMapper::deserialize
bool deserialize(std::set< T > &value, anch::json::ReaderContext &context) const
anch::json::ReaderContext
JSON reader context.
Definition
readerContext.hpp:42
anch::json
JSON namespace.
Definition
constants.hpp:25
anch-json
inc
json
genericMapper.hpp
Generated by
1.14.0