SOLA
Loading...
Searching...
No Matches
serializer.h
1// Copyright 2023 The SOLA authors
2//
3// This file is part of DAISI.
4//
5// DAISI is free software: you can redistribute it and/or modify it under the terms of the GNU
6// General Public License as published by the Free Software Foundation; version 2.
7//
8// DAISI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
9// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
10// Public License for more details.
11//
12// You should have received a copy of the GNU General Public License along with DAISI. If not, see
13// <https://www.gnu.org/licenses/>.
14//
15// SPDX-License-Identifier: GPL-2.0-only
16
17#ifndef DAISI_PATH_PLANNING_MESSAGE_SERIALIZER_H_
18#define DAISI_PATH_PLANNING_MESSAGE_SERIALIZER_H_
19
20#include "path_planning/consensus/paxos/message/types.h"
21#include "solanet/serializer/serialize.h"
22#include "types_all.h"
23
24namespace daisi::path_planning::message {
25
32template <typename T> std::string serialize(const T &msg);
33
40template <typename T> T deserialize(const std::string &msg);
41
42// Explicit template instantiation declaration
43
44extern template std::string serialize<consensus::PaxosMessage>(const consensus::PaxosMessage &msg);
45extern template consensus::PaxosMessage deserialize<consensus::PaxosMessage>(
46 const std::string &msg);
47
48extern template std::string serialize<StationAGVMessage>(const StationAGVMessage &msg);
49extern template StationAGVMessage deserialize<StationAGVMessage>(const std::string &msg);
50
51extern template std::string serialize<MiscMessage>(const MiscMessage &msg);
52extern template MiscMessage deserialize<MiscMessage>(const std::string &msg);
53
54extern template std::string serialize<FieldMessage>(const FieldMessage &msg);
55extern template FieldMessage deserialize<FieldMessage>(const std::string &msg);
56
57extern template std::string serialize<consensus::Request>(const consensus::Request &msg);
58extern template consensus::Request deserialize<consensus::Request>(const std::string &msg);
59
60extern template std::string serialize<consensus::Response>(const consensus::Response &msg);
61extern template consensus::Response deserialize<consensus::Response>(const std::string &msg);
62
63extern template std::string serialize<consensus::ReplicationMessage>(
64 const consensus::ReplicationMessage &msg);
65extern template consensus::ReplicationMessage deserialize<consensus::ReplicationMessage>(
66 const std::string &msg);
67
68} // namespace daisi::path_planning::message
69
70#endif // DAISI_PATH_PLANNING_MESSAGE_SERIALIZER_H_