Message.hpp
1 #pragma once
2 #include <State/Address.hpp>
3 #include <State/Value.hpp>
4 namespace State
5 {
14 struct SCORE_LIB_STATE_EXPORT Message
15 {
16  bool operator==(const Message& m) const noexcept
17  {
18  return address == m.address && value == m.value;
19  }
20 
21  bool operator!=(const Message& m) const noexcept
22  {
23  return address != m.address || value != m.value;
24  }
25 
26  // bool operator<(const Message& m) const noexcept { return
27  // address.toString() < m.address.toString(); }
28 
29  QString toString() const;
30 
31  AddressAccessor address;
32  Value value;
33 };
34 
35 SCORE_LIB_STATE_EXPORT
36 QDebug operator<<(QDebug s, const Message& mess);
37 
38 using MessageList = std::vector<Message>;
39 inline bool operator<(const State::MessageList&, const State::MessageList&)
40 {
41  return false;
42 }
43 }
44 
45 SCORE_SERIALIZE_DATASTREAM_DECLARE(SCORE_LIB_STATE_EXPORT, State::Message)
46 SCORE_SERIALIZE_DATASTREAM_DECLARE(SCORE_LIB_STATE_EXPORT, State::MessageList)
47 Q_DECLARE_METATYPE(State::Message)
48 //Q_DECLARE_METATYPE(State::MessageList)
49 W_REGISTER_ARGTYPE(State::Message)
50 //W_REGISTER_ARGTYPE(State::MessageList)
Utilities for OSSIA data structures.
Definition: DeviceInterface.hpp:33
Definition: Address.hpp:108
The Message struct.
Definition: Message.hpp:15