SOLA
Loading...
Searching...
No Matches
winner_response.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_LOGICAL_MESSAGE_AUCTION_BASED_WINNER_RESPONSE_H_
18#define DAISI_CPPS_LOGICAL_MESSAGE_AUCTION_BASED_WINNER_RESPONSE_H_
19
20#include <string>
21
22#include "solanet/serializer/serialize.h"
23#include "solanet/uuid.h"
24#include "solanet/uuid_generator.h"
25
26namespace daisi::cpps::logical {
27
29public:
30 WinnerResponse() = default;
31 WinnerResponse(std::string task_uuid, std::string participant_connection, bool accept)
32 : task_uuid_(std::move(task_uuid)),
33 participant_connection_(std::move(participant_connection)),
34 accept_(accept){};
35
36 const std::string &getTaskUuid() const { return task_uuid_; }
37
38 const std::string &getParticipantConnection() const { return participant_connection_; }
39
40 bool doesAccept() const { return accept_; }
41
42 solanet::UUID getUUID() const { return uuid_; }
43
44 SERIALIZE(uuid_, task_uuid_, accept_, participant_connection_);
45
46private:
47 solanet::UUID uuid_ = solanet::generateUUID();
48
49 std::string task_uuid_;
50
51 std::string participant_connection_;
52
53 bool accept_ = false;
54};
55
56} // namespace daisi::cpps::logical
57
58#endif
Definition winner_response.h:28
Modified Round Robin Algorithm that centrally assigns tasks of incoming material flows to the corresp...
Definition algorithm_config.h:22