Goby v2
translator.proto
1 
2 import "goby/common/protobuf/option_extensions.proto";
3 
4 package goby.moos.protobuf;
5 
6 message TranslatorEntry
7 {
8  required string protobuf_name = 1
9  [(goby.field).description =
10  "Fully qualified name (including package, if any) of a DCCL "
11  "protobuf message to tag this parser to."];
12 
13  message Trigger
14  {
15  enum Type
16  {
17  TRIGGER_PUBLISH = 1;
18  TRIGGER_TIME = 2;
19  }
20  optional Type type = 1 [default = TRIGGER_PUBLISH];
21  optional string moos_var = 2;
22  optional uint32 period = 3;
23  optional string mandatory_content = 4;
24  }
25  optional Trigger trigger = 2;
26 
27  enum ParserSerializerTechnique
28  {
29  TECHNIQUE_PROTOBUF_TEXT_FORMAT = 1;
30  TECHNIQUE_PROTOBUF_NATIVE_ENCODED = 2;
31  TECHNIQUE_COMMA_SEPARATED_KEY_EQUALS_VALUE_PAIRS = 3;
32  TECHNIQUE_FORMAT = 4;
33  TECHNIQUE_PREFIXED_PROTOBUF_TEXT_FORMAT = 5;
34  TECHNIQUE_PROTOBUF_NATIVE_HEX = 6;
35  TECHNIQUE_PREFIXED_PROTOBUF_NATIVE_HEX = 7;
36  TECHNIQUE_PREFIXED_PROTOBUF_NATIVE_ENCODED = 8;
37  }
38 
39  message CreateParser
40  {
41  optional ParserSerializerTechnique technique = 1
42  [default = TECHNIQUE_PROTOBUF_TEXT_FORMAT];
43  required string moos_var = 2;
44  optional string format = 3; // only for TECHNIQUE_FORMAT
45  optional string repeated_delimiter = 4
46  [default = ","]; // only for TECHNIQUE_FORMAT
47 
48  message Algorithm
49  {
50  required string name = 1;
51  required int32 primary_field = 2;
52  }
53  repeated Algorithm algorithm =
54  5; // only for TECHNIQUE_FORMAT and
55  // TECHNIQUE_COMMA_SEPARATED_KEY_EQUALS_VALUE_PAIRS
56  }
57 
58  repeated CreateParser create = 3;
59 
60  message PublishSerializer
61  {
62  optional ParserSerializerTechnique technique = 1
63  [default = TECHNIQUE_PROTOBUF_TEXT_FORMAT];
64  required string moos_var = 2;
65  optional string format = 3; // only for TECHNIQUE_FORMAT
66  optional string repeated_delimiter = 4
67  [default = ","]; // only for TECHNIQUE_FORMAT
68 
69  message Algorithm
70  {
71  required string name = 1;
72  required int32 output_virtual_field =
73  2; // provide a field number that's not actually in the message
74  // but can be used for format strings
75  required int32 primary_field = 3;
76  repeated int32 reference_field = 4;
77  }
78 
79  repeated Algorithm algorithm =
80  5; // only for TECHNIQUE_FORMAT and
81  // TECHNIQUE_COMMA_SEPARATED_KEY_EQUALS_VALUE_PAIRS
82  }
83  repeated PublishSerializer publish = 4;
84 
85  optional bool use_short_enum = 5 [default = false];
86 }