SOLA
Loading...
Searching...
No Matches
amr_load_carrier.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_CPPS_AMR_MODEL_AMR_LOAD_CARRIER_H_
18#define DAISI_CPPS_AMR_MODEL_AMR_LOAD_CARRIER_H_
19
20#include <cstdint>
21#include <string>
22#include <unordered_map>
23
24#include "solanet/serializer/serialize.h"
25
26namespace daisi::cpps::amr {
27
28// TODO: add documentation
30public:
31 enum Types : uint8_t {
32 kEuroPalett,
33 kEuroBox,
34 kPackage,
35 kNoLoadCarrierType,
36 };
37
38 LoadCarrier() = default;
39 explicit LoadCarrier(const Types &type);
40 explicit LoadCarrier(const std::string &type_name);
41
42 friend bool operator==(const LoadCarrier &l1, const LoadCarrier &l2);
43 friend bool operator!=(const LoadCarrier &l1, const LoadCarrier &l2);
44 friend bool operator<(const LoadCarrier &l1, const LoadCarrier &l2);
45 friend bool operator<=(const LoadCarrier &l1, const LoadCarrier &l2);
46 friend bool operator>(const LoadCarrier &l1, const LoadCarrier &l2);
47 friend bool operator>=(const LoadCarrier &l1, const LoadCarrier &l2);
48
49 friend std::ostream &operator<<(std::ostream &os, const LoadCarrier &l);
50
51 std::string getTypeAsString() const;
52 bool isValid() const;
53
54 SERIALIZE(type_);
55
56private:
57 Types type_ = Types::kNoLoadCarrierType;
58
59 static std::unordered_map<std::string, Types> string_to_type_;
60
61 static Types getTypeFromString(const std::string &type_name);
62};
63
64} // namespace daisi::cpps::amr
65#endif
Definition amr_load_carrier.h:29