SOLA
Loading...
Searching...
No Matches
message.h
1// Copyright The SOLA Contributors
2//
3// Licensed under the MIT License.
4// For details on the licensing terms, see the LICENSE file.
5// SPDX-License-Identifier: MIT
6
7#ifndef NATTER_MESSAGE_H_
8#define NATTER_MESSAGE_H_
9
10#include <string>
11
12#include "solanet/uuid.h"
13
14namespace natter {
15
19struct Message {
20 Message(std::string topic, solanet::UUID sender_id, solanet::UUID message_id, std::string content,
21 uint32_t round)
22 : topic(std::move(topic)),
23 sender_id(sender_id),
24 message_id(message_id),
25 content(std::move(content)),
26 round(round) {}
27
28 std::string topic{};
29 solanet::UUID sender_id{};
30 solanet::UUID message_id{};
31 std::string content{};
32 uint32_t round{};
33
34 bool operator==(const Message &other) const {
35 return topic == other.topic && sender_id == other.sender_id && message_id == other.message_id &&
36 content == other.content && round == other.round;
37 }
38};
39} // namespace natter
40
41#endif // NATTER_MESSAGE_H_
Definition message.h:19