self_msgproto 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,151 @@
1
+ // automatically generated by the FlatBuffers compiler, do not modify
2
+
3
+
4
+ #ifndef FLATBUFFERS_GENERATED_AUTH_SELFMESSAGING_H_
5
+ #define FLATBUFFERS_GENERATED_AUTH_SELFMESSAGING_H_
6
+
7
+ #include "flatbuffers/flatbuffers.h"
8
+
9
+ #include "types_generated.h"
10
+
11
+ namespace SelfMessaging {
12
+
13
+ struct Auth;
14
+ struct AuthBuilder;
15
+
16
+ struct Auth FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
17
+ typedef AuthBuilder Builder;
18
+ enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
19
+ VT_ID = 4,
20
+ VT_MSGTYPE = 6,
21
+ VT_TOKEN = 8,
22
+ VT_DEVICE = 10,
23
+ VT_OFFSET = 12
24
+ };
25
+ const flatbuffers::String *id() const {
26
+ return GetPointer<const flatbuffers::String *>(VT_ID);
27
+ }
28
+ SelfMessaging::MsgType msgtype() const {
29
+ return static_cast<SelfMessaging::MsgType>(GetField<int8_t>(VT_MSGTYPE, 0));
30
+ }
31
+ const flatbuffers::String *token() const {
32
+ return GetPointer<const flatbuffers::String *>(VT_TOKEN);
33
+ }
34
+ const flatbuffers::String *device() const {
35
+ return GetPointer<const flatbuffers::String *>(VT_DEVICE);
36
+ }
37
+ int64_t offset() const {
38
+ return GetField<int64_t>(VT_OFFSET, 0);
39
+ }
40
+ bool Verify(flatbuffers::Verifier &verifier) const {
41
+ return VerifyTableStart(verifier) &&
42
+ VerifyOffset(verifier, VT_ID) &&
43
+ verifier.VerifyString(id()) &&
44
+ VerifyField<int8_t>(verifier, VT_MSGTYPE) &&
45
+ VerifyOffset(verifier, VT_TOKEN) &&
46
+ verifier.VerifyString(token()) &&
47
+ VerifyOffset(verifier, VT_DEVICE) &&
48
+ verifier.VerifyString(device()) &&
49
+ VerifyField<int64_t>(verifier, VT_OFFSET) &&
50
+ verifier.EndTable();
51
+ }
52
+ };
53
+
54
+ struct AuthBuilder {
55
+ typedef Auth Table;
56
+ flatbuffers::FlatBufferBuilder &fbb_;
57
+ flatbuffers::uoffset_t start_;
58
+ void add_id(flatbuffers::Offset<flatbuffers::String> id) {
59
+ fbb_.AddOffset(Auth::VT_ID, id);
60
+ }
61
+ void add_msgtype(SelfMessaging::MsgType msgtype) {
62
+ fbb_.AddElement<int8_t>(Auth::VT_MSGTYPE, static_cast<int8_t>(msgtype), 0);
63
+ }
64
+ void add_token(flatbuffers::Offset<flatbuffers::String> token) {
65
+ fbb_.AddOffset(Auth::VT_TOKEN, token);
66
+ }
67
+ void add_device(flatbuffers::Offset<flatbuffers::String> device) {
68
+ fbb_.AddOffset(Auth::VT_DEVICE, device);
69
+ }
70
+ void add_offset(int64_t offset) {
71
+ fbb_.AddElement<int64_t>(Auth::VT_OFFSET, offset, 0);
72
+ }
73
+ explicit AuthBuilder(flatbuffers::FlatBufferBuilder &_fbb)
74
+ : fbb_(_fbb) {
75
+ start_ = fbb_.StartTable();
76
+ }
77
+ flatbuffers::Offset<Auth> Finish() {
78
+ const auto end = fbb_.EndTable(start_);
79
+ auto o = flatbuffers::Offset<Auth>(end);
80
+ return o;
81
+ }
82
+ };
83
+
84
+ inline flatbuffers::Offset<Auth> CreateAuth(
85
+ flatbuffers::FlatBufferBuilder &_fbb,
86
+ flatbuffers::Offset<flatbuffers::String> id = 0,
87
+ SelfMessaging::MsgType msgtype = SelfMessaging::MsgType_MSG,
88
+ flatbuffers::Offset<flatbuffers::String> token = 0,
89
+ flatbuffers::Offset<flatbuffers::String> device = 0,
90
+ int64_t offset = 0) {
91
+ AuthBuilder builder_(_fbb);
92
+ builder_.add_offset(offset);
93
+ builder_.add_device(device);
94
+ builder_.add_token(token);
95
+ builder_.add_id(id);
96
+ builder_.add_msgtype(msgtype);
97
+ return builder_.Finish();
98
+ }
99
+
100
+ inline flatbuffers::Offset<Auth> CreateAuthDirect(
101
+ flatbuffers::FlatBufferBuilder &_fbb,
102
+ const char *id = nullptr,
103
+ SelfMessaging::MsgType msgtype = SelfMessaging::MsgType_MSG,
104
+ const char *token = nullptr,
105
+ const char *device = nullptr,
106
+ int64_t offset = 0) {
107
+ auto id__ = id ? _fbb.CreateString(id) : 0;
108
+ auto token__ = token ? _fbb.CreateString(token) : 0;
109
+ auto device__ = device ? _fbb.CreateString(device) : 0;
110
+ return SelfMessaging::CreateAuth(
111
+ _fbb,
112
+ id__,
113
+ msgtype,
114
+ token__,
115
+ device__,
116
+ offset);
117
+ }
118
+
119
+ inline const SelfMessaging::Auth *GetAuth(const void *buf) {
120
+ return flatbuffers::GetRoot<SelfMessaging::Auth>(buf);
121
+ }
122
+
123
+ inline const SelfMessaging::Auth *GetSizePrefixedAuth(const void *buf) {
124
+ return flatbuffers::GetSizePrefixedRoot<SelfMessaging::Auth>(buf);
125
+ }
126
+
127
+ inline bool VerifyAuthBuffer(
128
+ flatbuffers::Verifier &verifier) {
129
+ return verifier.VerifyBuffer<SelfMessaging::Auth>(nullptr);
130
+ }
131
+
132
+ inline bool VerifySizePrefixedAuthBuffer(
133
+ flatbuffers::Verifier &verifier) {
134
+ return verifier.VerifySizePrefixedBuffer<SelfMessaging::Auth>(nullptr);
135
+ }
136
+
137
+ inline void FinishAuthBuffer(
138
+ flatbuffers::FlatBufferBuilder &fbb,
139
+ flatbuffers::Offset<SelfMessaging::Auth> root) {
140
+ fbb.Finish(root);
141
+ }
142
+
143
+ inline void FinishSizePrefixedAuthBuffer(
144
+ flatbuffers::FlatBufferBuilder &fbb,
145
+ flatbuffers::Offset<SelfMessaging::Auth> root) {
146
+ fbb.FinishSizePrefixed(root);
147
+ }
148
+
149
+ } // namespace SelfMessaging
150
+
151
+ #endif // FLATBUFFERS_GENERATED_AUTH_SELFMESSAGING_H_
@@ -0,0 +1,111 @@
1
+ // automatically generated by the FlatBuffers compiler, do not modify
2
+
3
+
4
+ #ifndef FLATBUFFERS_GENERATED_HEADER_SELFMESSAGING_H_
5
+ #define FLATBUFFERS_GENERATED_HEADER_SELFMESSAGING_H_
6
+
7
+ #include "flatbuffers/flatbuffers.h"
8
+
9
+ #include "types_generated.h"
10
+
11
+ namespace SelfMessaging {
12
+
13
+ struct Header;
14
+ struct HeaderBuilder;
15
+
16
+ struct Header FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
17
+ typedef HeaderBuilder Builder;
18
+ enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
19
+ VT_ID = 4,
20
+ VT_MSGTYPE = 6
21
+ };
22
+ const flatbuffers::String *id() const {
23
+ return GetPointer<const flatbuffers::String *>(VT_ID);
24
+ }
25
+ SelfMessaging::MsgType msgtype() const {
26
+ return static_cast<SelfMessaging::MsgType>(GetField<int8_t>(VT_MSGTYPE, 0));
27
+ }
28
+ bool Verify(flatbuffers::Verifier &verifier) const {
29
+ return VerifyTableStart(verifier) &&
30
+ VerifyOffset(verifier, VT_ID) &&
31
+ verifier.VerifyString(id()) &&
32
+ VerifyField<int8_t>(verifier, VT_MSGTYPE) &&
33
+ verifier.EndTable();
34
+ }
35
+ };
36
+
37
+ struct HeaderBuilder {
38
+ typedef Header Table;
39
+ flatbuffers::FlatBufferBuilder &fbb_;
40
+ flatbuffers::uoffset_t start_;
41
+ void add_id(flatbuffers::Offset<flatbuffers::String> id) {
42
+ fbb_.AddOffset(Header::VT_ID, id);
43
+ }
44
+ void add_msgtype(SelfMessaging::MsgType msgtype) {
45
+ fbb_.AddElement<int8_t>(Header::VT_MSGTYPE, static_cast<int8_t>(msgtype), 0);
46
+ }
47
+ explicit HeaderBuilder(flatbuffers::FlatBufferBuilder &_fbb)
48
+ : fbb_(_fbb) {
49
+ start_ = fbb_.StartTable();
50
+ }
51
+ flatbuffers::Offset<Header> Finish() {
52
+ const auto end = fbb_.EndTable(start_);
53
+ auto o = flatbuffers::Offset<Header>(end);
54
+ return o;
55
+ }
56
+ };
57
+
58
+ inline flatbuffers::Offset<Header> CreateHeader(
59
+ flatbuffers::FlatBufferBuilder &_fbb,
60
+ flatbuffers::Offset<flatbuffers::String> id = 0,
61
+ SelfMessaging::MsgType msgtype = SelfMessaging::MsgType_MSG) {
62
+ HeaderBuilder builder_(_fbb);
63
+ builder_.add_id(id);
64
+ builder_.add_msgtype(msgtype);
65
+ return builder_.Finish();
66
+ }
67
+
68
+ inline flatbuffers::Offset<Header> CreateHeaderDirect(
69
+ flatbuffers::FlatBufferBuilder &_fbb,
70
+ const char *id = nullptr,
71
+ SelfMessaging::MsgType msgtype = SelfMessaging::MsgType_MSG) {
72
+ auto id__ = id ? _fbb.CreateString(id) : 0;
73
+ return SelfMessaging::CreateHeader(
74
+ _fbb,
75
+ id__,
76
+ msgtype);
77
+ }
78
+
79
+ inline const SelfMessaging::Header *GetHeader(const void *buf) {
80
+ return flatbuffers::GetRoot<SelfMessaging::Header>(buf);
81
+ }
82
+
83
+ inline const SelfMessaging::Header *GetSizePrefixedHeader(const void *buf) {
84
+ return flatbuffers::GetSizePrefixedRoot<SelfMessaging::Header>(buf);
85
+ }
86
+
87
+ inline bool VerifyHeaderBuffer(
88
+ flatbuffers::Verifier &verifier) {
89
+ return verifier.VerifyBuffer<SelfMessaging::Header>(nullptr);
90
+ }
91
+
92
+ inline bool VerifySizePrefixedHeaderBuffer(
93
+ flatbuffers::Verifier &verifier) {
94
+ return verifier.VerifySizePrefixedBuffer<SelfMessaging::Header>(nullptr);
95
+ }
96
+
97
+ inline void FinishHeaderBuffer(
98
+ flatbuffers::FlatBufferBuilder &fbb,
99
+ flatbuffers::Offset<SelfMessaging::Header> root) {
100
+ fbb.Finish(root);
101
+ }
102
+
103
+ inline void FinishSizePrefixedHeaderBuffer(
104
+ flatbuffers::FlatBufferBuilder &fbb,
105
+ flatbuffers::Offset<SelfMessaging::Header> root) {
106
+ fbb.FinishSizePrefixed(root);
107
+ }
108
+
109
+ } // namespace SelfMessaging
110
+
111
+ #endif // FLATBUFFERS_GENERATED_HEADER_SELFMESSAGING_H_
@@ -0,0 +1,234 @@
1
+ // automatically generated by the FlatBuffers compiler, do not modify
2
+
3
+
4
+ #ifndef FLATBUFFERS_GENERATED_MESSAGE_SELFMESSAGING_H_
5
+ #define FLATBUFFERS_GENERATED_MESSAGE_SELFMESSAGING_H_
6
+
7
+ #include "flatbuffers/flatbuffers.h"
8
+
9
+ #include "types_generated.h"
10
+
11
+ namespace SelfMessaging {
12
+
13
+ struct Metadata;
14
+
15
+ struct Message;
16
+ struct MessageBuilder;
17
+
18
+ FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Metadata FLATBUFFERS_FINAL_CLASS {
19
+ private:
20
+ int64_t timestamp_;
21
+ int64_t offset_;
22
+
23
+ public:
24
+ Metadata()
25
+ : timestamp_(0),
26
+ offset_(0) {
27
+ }
28
+ Metadata(int64_t _timestamp, int64_t _offset)
29
+ : timestamp_(flatbuffers::EndianScalar(_timestamp)),
30
+ offset_(flatbuffers::EndianScalar(_offset)) {
31
+ }
32
+ int64_t timestamp() const {
33
+ return flatbuffers::EndianScalar(timestamp_);
34
+ }
35
+ void mutate_timestamp(int64_t _timestamp) {
36
+ flatbuffers::WriteScalar(&timestamp_, _timestamp);
37
+ }
38
+ int64_t offset() const {
39
+ return flatbuffers::EndianScalar(offset_);
40
+ }
41
+ void mutate_offset(int64_t _offset) {
42
+ flatbuffers::WriteScalar(&offset_, _offset);
43
+ }
44
+ };
45
+ FLATBUFFERS_STRUCT_END(Metadata, 16);
46
+
47
+ struct Message FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
48
+ typedef MessageBuilder Builder;
49
+ enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
50
+ VT_ID = 4,
51
+ VT_MSGTYPE = 6,
52
+ VT_SUBTYPE = 8,
53
+ VT_SENDER = 10,
54
+ VT_RECIPIENT = 12,
55
+ VT_METADATA = 14,
56
+ VT_CIPHERTEXT = 16
57
+ };
58
+ const flatbuffers::String *id() const {
59
+ return GetPointer<const flatbuffers::String *>(VT_ID);
60
+ }
61
+ flatbuffers::String *mutable_id() {
62
+ return GetPointer<flatbuffers::String *>(VT_ID);
63
+ }
64
+ SelfMessaging::MsgType msgtype() const {
65
+ return static_cast<SelfMessaging::MsgType>(GetField<int8_t>(VT_MSGTYPE, 0));
66
+ }
67
+ bool mutate_msgtype(SelfMessaging::MsgType _msgtype) {
68
+ return SetField<int8_t>(VT_MSGTYPE, static_cast<int8_t>(_msgtype), 0);
69
+ }
70
+ SelfMessaging::MsgSubType subtype() const {
71
+ return static_cast<SelfMessaging::MsgSubType>(GetField<uint16_t>(VT_SUBTYPE, 0));
72
+ }
73
+ bool mutate_subtype(SelfMessaging::MsgSubType _subtype) {
74
+ return SetField<uint16_t>(VT_SUBTYPE, static_cast<uint16_t>(_subtype), 0);
75
+ }
76
+ const flatbuffers::String *sender() const {
77
+ return GetPointer<const flatbuffers::String *>(VT_SENDER);
78
+ }
79
+ flatbuffers::String *mutable_sender() {
80
+ return GetPointer<flatbuffers::String *>(VT_SENDER);
81
+ }
82
+ const flatbuffers::String *recipient() const {
83
+ return GetPointer<const flatbuffers::String *>(VT_RECIPIENT);
84
+ }
85
+ flatbuffers::String *mutable_recipient() {
86
+ return GetPointer<flatbuffers::String *>(VT_RECIPIENT);
87
+ }
88
+ const SelfMessaging::Metadata *metadata() const {
89
+ return GetStruct<const SelfMessaging::Metadata *>(VT_METADATA);
90
+ }
91
+ SelfMessaging::Metadata *mutable_metadata() {
92
+ return GetStruct<SelfMessaging::Metadata *>(VT_METADATA);
93
+ }
94
+ const flatbuffers::Vector<uint8_t> *ciphertext() const {
95
+ return GetPointer<const flatbuffers::Vector<uint8_t> *>(VT_CIPHERTEXT);
96
+ }
97
+ flatbuffers::Vector<uint8_t> *mutable_ciphertext() {
98
+ return GetPointer<flatbuffers::Vector<uint8_t> *>(VT_CIPHERTEXT);
99
+ }
100
+ bool Verify(flatbuffers::Verifier &verifier) const {
101
+ return VerifyTableStart(verifier) &&
102
+ VerifyOffset(verifier, VT_ID) &&
103
+ verifier.VerifyString(id()) &&
104
+ VerifyField<int8_t>(verifier, VT_MSGTYPE) &&
105
+ VerifyField<uint16_t>(verifier, VT_SUBTYPE) &&
106
+ VerifyOffset(verifier, VT_SENDER) &&
107
+ verifier.VerifyString(sender()) &&
108
+ VerifyOffset(verifier, VT_RECIPIENT) &&
109
+ verifier.VerifyString(recipient()) &&
110
+ VerifyFieldRequired<SelfMessaging::Metadata>(verifier, VT_METADATA) &&
111
+ VerifyOffset(verifier, VT_CIPHERTEXT) &&
112
+ verifier.VerifyVector(ciphertext()) &&
113
+ verifier.EndTable();
114
+ }
115
+ };
116
+
117
+ struct MessageBuilder {
118
+ typedef Message Table;
119
+ flatbuffers::FlatBufferBuilder &fbb_;
120
+ flatbuffers::uoffset_t start_;
121
+ void add_id(flatbuffers::Offset<flatbuffers::String> id) {
122
+ fbb_.AddOffset(Message::VT_ID, id);
123
+ }
124
+ void add_msgtype(SelfMessaging::MsgType msgtype) {
125
+ fbb_.AddElement<int8_t>(Message::VT_MSGTYPE, static_cast<int8_t>(msgtype), 0);
126
+ }
127
+ void add_subtype(SelfMessaging::MsgSubType subtype) {
128
+ fbb_.AddElement<uint16_t>(Message::VT_SUBTYPE, static_cast<uint16_t>(subtype), 0);
129
+ }
130
+ void add_sender(flatbuffers::Offset<flatbuffers::String> sender) {
131
+ fbb_.AddOffset(Message::VT_SENDER, sender);
132
+ }
133
+ void add_recipient(flatbuffers::Offset<flatbuffers::String> recipient) {
134
+ fbb_.AddOffset(Message::VT_RECIPIENT, recipient);
135
+ }
136
+ void add_metadata(const SelfMessaging::Metadata *metadata) {
137
+ fbb_.AddStruct(Message::VT_METADATA, metadata);
138
+ }
139
+ void add_ciphertext(flatbuffers::Offset<flatbuffers::Vector<uint8_t>> ciphertext) {
140
+ fbb_.AddOffset(Message::VT_CIPHERTEXT, ciphertext);
141
+ }
142
+ explicit MessageBuilder(flatbuffers::FlatBufferBuilder &_fbb)
143
+ : fbb_(_fbb) {
144
+ start_ = fbb_.StartTable();
145
+ }
146
+ flatbuffers::Offset<Message> Finish() {
147
+ const auto end = fbb_.EndTable(start_);
148
+ auto o = flatbuffers::Offset<Message>(end);
149
+ fbb_.Required(o, Message::VT_METADATA);
150
+ return o;
151
+ }
152
+ };
153
+
154
+ inline flatbuffers::Offset<Message> CreateMessage(
155
+ flatbuffers::FlatBufferBuilder &_fbb,
156
+ flatbuffers::Offset<flatbuffers::String> id = 0,
157
+ SelfMessaging::MsgType msgtype = SelfMessaging::MsgType_MSG,
158
+ SelfMessaging::MsgSubType subtype = SelfMessaging::MsgSubType_Unknown,
159
+ flatbuffers::Offset<flatbuffers::String> sender = 0,
160
+ flatbuffers::Offset<flatbuffers::String> recipient = 0,
161
+ const SelfMessaging::Metadata *metadata = 0,
162
+ flatbuffers::Offset<flatbuffers::Vector<uint8_t>> ciphertext = 0) {
163
+ MessageBuilder builder_(_fbb);
164
+ builder_.add_ciphertext(ciphertext);
165
+ builder_.add_metadata(metadata);
166
+ builder_.add_recipient(recipient);
167
+ builder_.add_sender(sender);
168
+ builder_.add_id(id);
169
+ builder_.add_subtype(subtype);
170
+ builder_.add_msgtype(msgtype);
171
+ return builder_.Finish();
172
+ }
173
+
174
+ inline flatbuffers::Offset<Message> CreateMessageDirect(
175
+ flatbuffers::FlatBufferBuilder &_fbb,
176
+ const char *id = nullptr,
177
+ SelfMessaging::MsgType msgtype = SelfMessaging::MsgType_MSG,
178
+ SelfMessaging::MsgSubType subtype = SelfMessaging::MsgSubType_Unknown,
179
+ const char *sender = nullptr,
180
+ const char *recipient = nullptr,
181
+ const SelfMessaging::Metadata *metadata = 0,
182
+ const std::vector<uint8_t> *ciphertext = nullptr) {
183
+ auto id__ = id ? _fbb.CreateString(id) : 0;
184
+ auto sender__ = sender ? _fbb.CreateString(sender) : 0;
185
+ auto recipient__ = recipient ? _fbb.CreateString(recipient) : 0;
186
+ auto ciphertext__ = ciphertext ? _fbb.CreateVector<uint8_t>(*ciphertext) : 0;
187
+ return SelfMessaging::CreateMessage(
188
+ _fbb,
189
+ id__,
190
+ msgtype,
191
+ subtype,
192
+ sender__,
193
+ recipient__,
194
+ metadata,
195
+ ciphertext__);
196
+ }
197
+
198
+ inline const SelfMessaging::Message *GetMessage(const void *buf) {
199
+ return flatbuffers::GetRoot<SelfMessaging::Message>(buf);
200
+ }
201
+
202
+ inline const SelfMessaging::Message *GetSizePrefixedMessage(const void *buf) {
203
+ return flatbuffers::GetSizePrefixedRoot<SelfMessaging::Message>(buf);
204
+ }
205
+
206
+ inline Message *GetMutableMessage(void *buf) {
207
+ return flatbuffers::GetMutableRoot<Message>(buf);
208
+ }
209
+
210
+ inline bool VerifyMessageBuffer(
211
+ flatbuffers::Verifier &verifier) {
212
+ return verifier.VerifyBuffer<SelfMessaging::Message>(nullptr);
213
+ }
214
+
215
+ inline bool VerifySizePrefixedMessageBuffer(
216
+ flatbuffers::Verifier &verifier) {
217
+ return verifier.VerifySizePrefixedBuffer<SelfMessaging::Message>(nullptr);
218
+ }
219
+
220
+ inline void FinishMessageBuffer(
221
+ flatbuffers::FlatBufferBuilder &fbb,
222
+ flatbuffers::Offset<SelfMessaging::Message> root) {
223
+ fbb.Finish(root);
224
+ }
225
+
226
+ inline void FinishSizePrefixedMessageBuffer(
227
+ flatbuffers::FlatBufferBuilder &fbb,
228
+ flatbuffers::Offset<SelfMessaging::Message> root) {
229
+ fbb.FinishSizePrefixed(root);
230
+ }
231
+
232
+ } // namespace SelfMessaging
233
+
234
+ #endif // FLATBUFFERS_GENERATED_MESSAGE_SELFMESSAGING_H_