BT_logger_generated.h
Go to the documentation of this file.
1 // automatically generated by the FlatBuffers compiler, do not modify
2 
3 #ifndef FLATBUFFERS_GENERATED_BTLOGGER_BT_SERIALIZATION_H_
4 #define FLATBUFFERS_GENERATED_BTLOGGER_BT_SERIALIZATION_H_
5 
7 
8 namespace BT_Serialization
9 {
10 struct Timestamp;
11 
12 struct KeyValue;
13 
14 struct TreeNode;
15 
16 struct BehaviorTree;
17 
18 struct StatusChange;
19 
20 struct StatusChangeLog;
21 
22 enum class Status : int8_t
23 {
24  IDLE = 0,
25  RUNNING = 1,
26  SUCCESS = 2,
27  FAILURE = 3,
28  MIN = IDLE,
29  MAX = FAILURE
30 };
31 
32 inline const Status (&EnumValuesStatus())[4]
33 {
34  static const Status values[] = {Status::IDLE, Status::RUNNING, Status::SUCCESS,
36  return values;
37 }
38 
39 inline const char* const* EnumNamesStatus()
40 {
41  static const char* const names[] = {"IDLE", "RUNNING", "SUCCESS", "FAILURE", nullptr};
42  return names;
43 }
44 
45 inline const char* EnumNameStatus(Status e)
46 {
47  const size_t index = static_cast<int>(e);
48  return EnumNamesStatus()[index];
49 }
50 
51 enum class Type : int8_t
52 {
53  UNDEFINED = 0,
54  ACTION = 1,
55  CONDITION = 2,
56  CONTROL = 3,
57  DECORATOR = 4,
58  SUBTREE = 5,
59  MIN = UNDEFINED,
60  MAX = SUBTREE
61 };
62 
63 inline const Type (&EnumValuesType())[6]
64 {
65  static const Type values[] = {Type::UNDEFINED, Type::ACTION, Type::CONDITION,
67  return values;
68 }
69 
70 inline const char* const* EnumNamesType()
71 {
72  static const char* const names[] = {"UNDEFINED", "ACTION", "CONDITION", "CONTROL",
73  "DECORATOR", "SUBTREE", nullptr};
74  return names;
75 }
76 
77 inline const char* EnumNameType(Type e)
78 {
79  const size_t index = static_cast<int>(e);
80  return EnumNamesType()[index];
81 }
82 
84 {
85  private:
86  uint64_t usec_since_epoch_;
87 
88  public:
89  Timestamp()
90  {
91  memset(this, 0, sizeof(Timestamp));
92  }
93  Timestamp(uint64_t _usec_since_epoch)
94  : usec_since_epoch_(flatbuffers::EndianScalar(_usec_since_epoch))
95  {
96  }
97  uint64_t usec_since_epoch() const
98  {
99  return flatbuffers::EndianScalar(usec_since_epoch_);
100  }
101 };
102 FLATBUFFERS_STRUCT_END(Timestamp, 8);
103 
105 {
106  private:
107  uint16_t uid_;
108  int8_t prev_status_;
109  int8_t status_;
110  int32_t padding0__;
111  Timestamp timestamp_;
112 
113  public:
114  StatusChange()
115  {
116  memset(this, 0, sizeof(StatusChange));
117  }
118  StatusChange(uint16_t _uid, Status _prev_status, Status _status, const Timestamp& _timestamp)
119  : uid_(flatbuffers::EndianScalar(_uid))
120  , prev_status_(flatbuffers::EndianScalar(static_cast<int8_t>(_prev_status)))
121  , status_(flatbuffers::EndianScalar(static_cast<int8_t>(_status)))
122  , padding0__(0)
123  , timestamp_(_timestamp)
124  {
125  (void)padding0__;
126  }
127  uint16_t uid() const
128  {
129  return flatbuffers::EndianScalar(uid_);
130  }
131  Status prev_status() const
132  {
133  return static_cast<Status>(flatbuffers::EndianScalar(prev_status_));
134  }
135  Status status() const
136  {
137  return static_cast<Status>(flatbuffers::EndianScalar(status_));
138  }
139  const Timestamp& timestamp() const
140  {
141  return timestamp_;
142  }
143 };
144 FLATBUFFERS_STRUCT_END(StatusChange, 16);
145 
146 struct KeyValue FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table
147 {
148  enum
149  {
150  VT_KEY = 4,
151  VT_VALUE = 6
152  };
153  const flatbuffers::String* key() const
154  {
155  return GetPointer<const flatbuffers::String*>(VT_KEY);
156  }
157  const flatbuffers::String* value() const
158  {
159  return GetPointer<const flatbuffers::String*>(VT_VALUE);
160  }
161  bool Verify(flatbuffers::Verifier& verifier) const
162  {
163  return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_KEY) &&
164  verifier.Verify(key()) && VerifyOffset(verifier, VT_VALUE) &&
165  verifier.Verify(value()) && verifier.EndTable();
166  }
167 };
168 
170 {
172  flatbuffers::uoffset_t start_;
174  {
175  fbb_.AddOffset(KeyValue::VT_KEY, key);
176  }
178  {
179  fbb_.AddOffset(KeyValue::VT_VALUE, value);
180  }
181  explicit KeyValueBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb)
182  {
183  start_ = fbb_.StartTable();
184  }
185  KeyValueBuilder& operator=(const KeyValueBuilder&);
187  {
188  const auto end = fbb_.EndTable(start_);
189  auto o = flatbuffers::Offset<KeyValue>(end);
190  return o;
191  }
192 };
193 
197 {
198  KeyValueBuilder builder_(_fbb);
199  builder_.add_value(value);
200  builder_.add_key(key);
201  return builder_.Finish();
202 }
203 
205  const char* key = nullptr,
206  const char* value = nullptr)
207 {
208  return BT_Serialization::CreateKeyValue(_fbb, key ? _fbb.CreateString(key) : 0,
209  value ? _fbb.CreateString(value) : 0);
210 }
211 
212 struct TreeNode FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table
213 {
214  enum
215  {
216  VT_UID = 4,
217  VT_CHILDREN_UID = 6,
218  VT_TYPE = 8,
219  VT_STATUS = 10,
220  VT_INSTANCE_NAME = 12,
221  VT_REGISTRATION_NAME = 14,
222  VT_PARAMS = 16
223  };
224  uint16_t uid() const
225  {
226  return GetField<uint16_t>(VT_UID, 0);
227  }
229  {
230  return GetPointer<const flatbuffers::Vector<uint16_t>*>(VT_CHILDREN_UID);
231  }
232  Type type() const
233  {
234  return static_cast<Type>(GetField<int8_t>(VT_TYPE, 0));
235  }
236  Status status() const
237  {
238  return static_cast<Status>(GetField<int8_t>(VT_STATUS, 0));
239  }
241  {
242  return GetPointer<const flatbuffers::String*>(VT_INSTANCE_NAME);
243  }
245  {
246  return GetPointer<const flatbuffers::String*>(VT_REGISTRATION_NAME);
247  }
249  {
250  return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<KeyValue>>*>(VT_PARAMS);
251  }
252  bool Verify(flatbuffers::Verifier& verifier) const
253  {
254  return VerifyTableStart(verifier) && VerifyField<uint16_t>(verifier, VT_UID) &&
255  VerifyOffset(verifier, VT_CHILDREN_UID) && verifier.Verify(children_uid()) &&
256  VerifyField<int8_t>(verifier, VT_TYPE) && VerifyField<int8_t>(verifier, VT_STATUS) &&
257  VerifyOffsetRequired(verifier, VT_INSTANCE_NAME) &&
258  verifier.Verify(instance_name()) &&
259  VerifyOffsetRequired(verifier, VT_REGISTRATION_NAME) &&
260  verifier.Verify(registration_name()) && VerifyOffset(verifier, VT_PARAMS) &&
261  verifier.Verify(params()) && verifier.VerifyVectorOfTables(params()) &&
262  verifier.EndTable();
263  }
264 };
265 
267 {
269  flatbuffers::uoffset_t start_;
270  void add_uid(uint16_t uid)
271  {
272  fbb_.AddElement<uint16_t>(TreeNode::VT_UID, uid, 0);
273  }
275  {
276  fbb_.AddOffset(TreeNode::VT_CHILDREN_UID, children_uid);
277  }
278  void add_type(Type type)
279  {
280  fbb_.AddElement<int8_t>(TreeNode::VT_TYPE, static_cast<int8_t>(type), 0);
281  }
282  void add_status(Status status)
283  {
284  fbb_.AddElement<int8_t>(TreeNode::VT_STATUS, static_cast<int8_t>(status), 0);
285  }
287  {
288  fbb_.AddOffset(TreeNode::VT_INSTANCE_NAME, instance_name);
289  }
291  {
292  fbb_.AddOffset(TreeNode::VT_REGISTRATION_NAME, registration_name);
293  }
295  {
296  fbb_.AddOffset(TreeNode::VT_PARAMS, params);
297  }
298  explicit TreeNodeBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb)
299  {
300  start_ = fbb_.StartTable();
301  }
302  TreeNodeBuilder& operator=(const TreeNodeBuilder&);
304  {
305  const auto end = fbb_.EndTable(start_);
306  auto o = flatbuffers::Offset<TreeNode>(end);
307  fbb_.Required(o, TreeNode::VT_INSTANCE_NAME);
308  fbb_.Required(o, TreeNode::VT_REGISTRATION_NAME);
309  return o;
310  }
311 };
312 
316  Type type = Type::UNDEFINED, Status status = Status::IDLE,
318  flatbuffers::Offset<flatbuffers::String> registration_name = 0,
320 {
321  TreeNodeBuilder builder_(_fbb);
322  builder_.add_params(params);
323  builder_.add_registration_name(registration_name);
324  builder_.add_instance_name(instance_name);
325  builder_.add_children_uid(children_uid);
326  builder_.add_uid(uid);
327  builder_.add_status(status);
328  builder_.add_type(type);
329  return builder_.Finish();
330 }
331 
334  const std::vector<uint16_t>* children_uid = nullptr,
335  Type type = Type::UNDEFINED, Status status = Status::IDLE,
336  const char* instance_name = nullptr, const char* registration_name = nullptr,
337  const std::vector<flatbuffers::Offset<KeyValue>>* params = nullptr)
338 {
340  _fbb, uid, children_uid ? _fbb.CreateVector<uint16_t>(*children_uid) : 0, type, status,
341  instance_name ? _fbb.CreateString(instance_name) : 0,
342  registration_name ? _fbb.CreateString(registration_name) : 0,
343  params ? _fbb.CreateVector<flatbuffers::Offset<KeyValue>>(*params) : 0);
344 }
345 
346 struct BehaviorTree FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table
347 {
348  enum
349  {
350  VT_ROOT_UID = 4,
351  VT_NODES = 6
352  };
353  uint16_t root_uid() const
354  {
355  return GetField<uint16_t>(VT_ROOT_UID, 0);
356  }
358  {
359  return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<TreeNode>>*>(VT_NODES);
360  }
361  bool Verify(flatbuffers::Verifier& verifier) const
362  {
363  return VerifyTableStart(verifier) && VerifyField<uint16_t>(verifier, VT_ROOT_UID) &&
364  VerifyOffset(verifier, VT_NODES) && verifier.Verify(nodes()) &&
365  verifier.VerifyVectorOfTables(nodes()) && verifier.EndTable();
366  }
367 };
368 
370 {
372  flatbuffers::uoffset_t start_;
373  void add_root_uid(uint16_t root_uid)
374  {
375  fbb_.AddElement<uint16_t>(BehaviorTree::VT_ROOT_UID, root_uid, 0);
376  }
378  {
379  fbb_.AddOffset(BehaviorTree::VT_NODES, nodes);
380  }
382  {
383  start_ = fbb_.StartTable();
384  }
385  BehaviorTreeBuilder& operator=(const BehaviorTreeBuilder&);
387  {
388  const auto end = fbb_.EndTable(start_);
389  auto o = flatbuffers::Offset<BehaviorTree>(end);
390  return o;
391  }
392 };
393 
395  flatbuffers::FlatBufferBuilder& _fbb, uint16_t root_uid = 0,
397 {
398  BehaviorTreeBuilder builder_(_fbb);
399  builder_.add_nodes(nodes);
400  builder_.add_root_uid(root_uid);
401  return builder_.Finish();
402 }
403 
406  const std::vector<flatbuffers::Offset<TreeNode>>* nodes = nullptr)
407 {
409  _fbb, root_uid, nodes ? _fbb.CreateVector<flatbuffers::Offset<TreeNode>>(*nodes) : 0);
410 }
411 
412 struct StatusChangeLog FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table
413 {
414  enum
415  {
416  VT_BEHAVIOR_TREE = 4,
417  VT_STATE_CHANGES = 6
418  };
419  const BehaviorTree* behavior_tree() const
420  {
421  return GetPointer<const BehaviorTree*>(VT_BEHAVIOR_TREE);
422  }
424  {
425  return GetPointer<const flatbuffers::Vector<const StatusChange*>*>(VT_STATE_CHANGES);
426  }
427  bool Verify(flatbuffers::Verifier& verifier) const
428  {
429  return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_BEHAVIOR_TREE) &&
430  verifier.VerifyTable(behavior_tree()) && VerifyOffset(verifier, VT_STATE_CHANGES) &&
431  verifier.Verify(state_changes()) && verifier.EndTable();
432  }
433 };
434 
436 {
438  flatbuffers::uoffset_t start_;
440  {
441  fbb_.AddOffset(StatusChangeLog::VT_BEHAVIOR_TREE, behavior_tree);
442  }
443  void
445  {
446  fbb_.AddOffset(StatusChangeLog::VT_STATE_CHANGES, state_changes);
447  }
449  {
450  start_ = fbb_.StartTable();
451  }
454  {
455  const auto end = fbb_.EndTable(start_);
457  return o;
458  }
459 };
460 
464 {
465  StatusChangeLogBuilder builder_(_fbb);
466  builder_.add_state_changes(state_changes);
467  builder_.add_behavior_tree(behavior_tree);
468  return builder_.Finish();
469 }
470 
473  const std::vector<StatusChange>* state_changes = nullptr)
474 {
476  _fbb, behavior_tree,
477  state_changes ? _fbb.CreateVectorOfStructs<StatusChange>(*state_changes) : 0);
478 }
479 
480 inline const BT_Serialization::BehaviorTree* GetBehaviorTree(const void* buf)
481 {
482  return flatbuffers::GetRoot<BT_Serialization::BehaviorTree>(buf);
483 }
484 
485 inline const BT_Serialization::BehaviorTree* GetSizePrefixedBehaviorTree(const void* buf)
486 {
487  return flatbuffers::GetSizePrefixedRoot<BT_Serialization::BehaviorTree>(buf);
488 }
489 
490 inline bool VerifyBehaviorTreeBuffer(flatbuffers::Verifier& verifier)
491 {
492  return verifier.VerifyBuffer<BT_Serialization::BehaviorTree>(nullptr);
493 }
494 
495 inline bool VerifySizePrefixedBehaviorTreeBuffer(flatbuffers::Verifier& verifier)
496 {
497  return verifier.VerifySizePrefixedBuffer<BT_Serialization::BehaviorTree>(nullptr);
498 }
499 
502 {
503  fbb.Finish(root);
504 }
505 
508 {
509  fbb.FinishSizePrefixed(root);
510 }
511 
512 } // namespace BT_Serialization
513 
514 #endif // FLATBUFFERS_GENERATED_BTLOGGER_BT_SERIALIZATION_H_
void add_value(flatbuffers::Offset< flatbuffers::String > value)
flatbuffers::Offset< KeyValue > CreateKeyValueDirect(flatbuffers::FlatBufferBuilder &_fbb, const char *key=nullptr, const char *value=nullptr)
void add_instance_name(flatbuffers::Offset< flatbuffers::String > instance_name)
bool VerifySizePrefixedBehaviorTreeBuffer(flatbuffers::Verifier &verifier)
const flatbuffers::Vector< const StatusChange * > * state_changes() const
void add_registration_name(flatbuffers::Offset< flatbuffers::String > registration_name)
const Status(& EnumValuesStatus())[4]
const flatbuffers::String * registration_name() const
const flatbuffers::String * instance_name() const
StatusChangeLogBuilder(flatbuffers::FlatBufferBuilder &_fbb)
void add_params(flatbuffers::Offset< flatbuffers::Vector< flatbuffers::Offset< KeyValue >>> params)
flatbuffers::Offset< KeyValue > CreateKeyValue(flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset< flatbuffers::String > key=0, flatbuffers::Offset< flatbuffers::String > value=0)
void Finish(Offset< T > root, const char *file_identifier=nullptr)
Finish serializing a buffer by writing the root offset.
Definition: flatbuffers.h:1554
bool Verify(flatbuffers::Verifier &verifier) const
KeyValueBuilder(flatbuffers::FlatBufferBuilder &_fbb)
void add_key(flatbuffers::Offset< flatbuffers::String > key)
const BT_Serialization::BehaviorTree * GetSizePrefixedBehaviorTree(const void *buf)
flatbuffers::Offset< TreeNode > CreateTreeNode(flatbuffers::FlatBufferBuilder &_fbb, uint16_t uid=0, flatbuffers::Offset< flatbuffers::Vector< uint16_t >> children_uid=0, Type type=Type::UNDEFINED, Status status=Status::IDLE, flatbuffers::Offset< flatbuffers::String > instance_name=0, flatbuffers::Offset< flatbuffers::String > registration_name=0, flatbuffers::Offset< flatbuffers::Vector< flatbuffers::Offset< KeyValue >>> params=0)
flatbuffers::Offset< StatusChangeLog > Finish()
void FinishBehaviorTreeBuffer(flatbuffers::FlatBufferBuilder &fbb, flatbuffers::Offset< BT_Serialization::BehaviorTree > root)
Offset< String > CreateString(const char *str, size_t len)
Store a string in the buffer, which can contain any binary data.
Definition: flatbuffers.h:1058
void add_nodes(flatbuffers::Offset< flatbuffers::Vector< flatbuffers::Offset< TreeNode >>> nodes)
flatbuffers::Offset< BehaviorTree > Finish()
const char *const * EnumNamesStatus()
const BehaviorTree * behavior_tree() const
flatbuffers::Offset< StatusChangeLog > CreateStatusChangeLogDirect(flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset< BehaviorTree > behavior_tree=0, const std::vector< StatusChange > *state_changes=nullptr)
flatbuffers::Offset< TreeNode > Finish()
Helper class to hold data needed in creation of a FlatBuffer. To serialize data, you typically call o...
Definition: flatbuffers.h:727
flatbuffers::Offset< TreeNode > CreateTreeNodeDirect(flatbuffers::FlatBufferBuilder &_fbb, uint16_t uid=0, const std::vector< uint16_t > *children_uid=nullptr, Type type=Type::UNDEFINED, Status status=Status::IDLE, const char *instance_name=nullptr, const char *registration_name=nullptr, const std::vector< flatbuffers::Offset< KeyValue >> *params=nullptr)
const flatbuffers::Vector< uint16_t > * children_uid() const
FLATBUFFERS_STRUCT_END(Timestamp, 8)
TreeNodeBuilder(flatbuffers::FlatBufferBuilder &_fbb)
flatbuffers::Offset< BehaviorTree > CreateBehaviorTreeDirect(flatbuffers::FlatBufferBuilder &_fbb, uint16_t root_uid=0, const std::vector< flatbuffers::Offset< TreeNode >> *nodes=nullptr)
flatbuffers::FlatBufferBuilder & fbb_
const flatbuffers::Vector< flatbuffers::Offset< KeyValue > > * params() const
void add_children_uid(flatbuffers::Offset< flatbuffers::Vector< uint16_t >> children_uid)
const BT_Serialization::BehaviorTree * GetBehaviorTree(const void *buf)
flatbuffers::FlatBufferBuilder & fbb_
FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Timestamp FLATBUFFERS_FINAL_CLASS
const Type(& EnumValuesType())[6]
Offset< Vector< const T * > > CreateVectorOfStructs(const T *v, size_t len)
Serialize an array of structs into a FlatBuffer vector.
Definition: flatbuffers.h:1302
const flatbuffers::Vector< flatbuffers::Offset< TreeNode > > * nodes() const
BehaviorTreeBuilder(flatbuffers::FlatBufferBuilder &_fbb)
Offset< Vector< T > > CreateVector(const T *v, size_t len)
Serialize an array into a FlatBuffer vector.
Definition: flatbuffers.h:1198
const char *const * EnumNamesType()
flatbuffers::Offset< BehaviorTree > CreateBehaviorTree(flatbuffers::FlatBufferBuilder &_fbb, uint16_t root_uid=0, flatbuffers::Offset< flatbuffers::Vector< flatbuffers::Offset< TreeNode >>> nodes=0)
void add_behavior_tree(flatbuffers::Offset< BehaviorTree > behavior_tree)
void FinishSizePrefixed(Offset< T > root, const char *file_identifier=nullptr)
Finish a buffer with a 32 bit size field pre-fixed (size of the buffer following the size field)...
Definition: flatbuffers.h:1566
flatbuffers::FlatBufferBuilder & fbb_
const flatbuffers::String * value() const
flatbuffers::Offset< KeyValue > Finish()
const char * EnumNameType(Type e)
flatbuffers::Offset< StatusChangeLog > CreateStatusChangeLog(flatbuffers::FlatBufferBuilder &_fbb, flatbuffers::Offset< BehaviorTree > behavior_tree=0, flatbuffers::Offset< flatbuffers::Vector< const StatusChange * >> state_changes=0)
bool VerifyBehaviorTreeBuffer(flatbuffers::Verifier &verifier)
flatbuffers::FlatBufferBuilder & fbb_
const char * EnumNameStatus(Status e)
void FinishSizePrefixedBehaviorTreeBuffer(flatbuffers::FlatBufferBuilder &fbb, flatbuffers::Offset< BT_Serialization::BehaviorTree > root)
const flatbuffers::String * key() const
void add_state_changes(flatbuffers::Offset< flatbuffers::Vector< const StatusChange * >> state_changes)


behaviortree_cpp
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Sun Feb 3 2019 03:14:32