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