SOLA
Loading...
Searching...
No Matches
move_order.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_MATERIAL_FLOW_MOVE_ORDER_H_
18#define DAISI_MATERIAL_FLOW_MOVE_ORDER_H_
19
20#include "move_order_step.h"
21#include "solanet/serializer/serialize.h"
22
23namespace daisi::material_flow {
24
25class MoveOrder {
26public:
27 MoveOrder() = default;
28
29 explicit MoveOrder(MoveOrderStep move_order_step);
30 MoveOrder(std::string uuid, MoveOrderStep move_order_step);
31
32 const std::string &getUuid() const;
33 const MoveOrderStep &getMoveOrderStep() const;
34
35 bool operator==(const MoveOrder &other) const;
36
37 SERIALIZE(uuid_, move_order_step_);
38
39private:
40 std::string uuid_;
41 MoveOrderStep move_order_step_;
42};
43
44} // namespace daisi::material_flow
45
46namespace std {
47
48template <> struct hash<daisi::material_flow::MoveOrder> {
49 std::size_t operator()(const daisi::material_flow::MoveOrder &order) const {
50 string repr = order.getUuid();
51 return hash<string>()(repr);
52 }
53};
54
55} // namespace std
56
57#endif
Definition move_order.h:25
Definition move_order_step.h:28