SerializationPackers.hpp
Go to the documentation of this file.
1/*
2 Copyright 2019 Equinor AS.
3
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef SERIALIZATION_PACKERS_HPP
20#define SERIALIZATION_PACKERS_HPP
21
22#include <opm/common/utility/MemPacker.hpp>
23
24#include <boost/date_time/gregorian/gregorian_types.hpp>
25
26// Additional packers for serializers using the mempacker.
27
28namespace Opm {
29namespace Serialization {
30namespace detail {
31
32template<>
33struct Packing<false,boost::gregorian::date>
34{
35 static std::size_t packSize(const boost::gregorian::date& data);
36
37 static void pack(const boost::gregorian::date& data,
38 std::vector<char>& buffer, int& position);
39
40 static void unpack(boost::gregorian::date& data,
41 std::vector<char>& buffer, int& position);
42};
43
44}
45
46} // end namespace Serialization
47} // end namespace Opm
48
49#endif // SERIALIZATION_PACKERS_HPP
Definition: BlackoilPhases.hpp:27
Definition: PropertyTree.hpp:27
static std::size_t packSize(const boost::gregorian::date &data)
static void unpack(boost::gregorian::date &data, std::vector< char > &buffer, int &position)
static void pack(const boost::gregorian::date &data, std::vector< char > &buffer, int &position)