DCCL v3
test.proto
1 
2 import "dccl/option_extensions.proto";
3 
4 package dccl.test;
5 
6 enum Enum1
7 {
8  ENUM_A = 1;
9  ENUM_B = 2;
10  ENUM_C = 3;
11 }
12 
13 message EmbeddedMsg1
14 {
15  optional double val = 1 [(dccl.field).min=0,
16  (dccl.field).max=126,
17  (dccl.field).precision=3];
18  optional EmbeddedMsg2 msg = 2;
19 }
20 
21 message EmbeddedMsg2
22 {
23  optional double val = 1 [(dccl.field).min=0,
24  (dccl.field).max=126,
25  (dccl.field).precision=2];
26  optional string sval = 2 [(dccl.field).max_length=10];
27  optional Enum1 enum_default = 3;
28 }
29 
30 message TestMsg
31 {
32  option (dccl.msg).id = 2;
33  option (dccl.msg).max_bytes = 512;
34  option (dccl.msg).codec_version = 3;
35 
36  // test default enc/dec
37  optional double double_default_optional = 1 [(dccl.field).min=-100,
38  (dccl.field).max=126,
39  (dccl.field).precision=2,
40  (dccl.field).in_head=true];
41  optional float float_default_optional = 2 [(dccl.field).min=-20,
42  (dccl.field).max=150,
43  (dccl.field).precision=3];
44  optional int32 int32_default_optional = 3 [(dccl.field).min=-20,
45  (dccl.field).max=3000];
46  optional int64 int64_default_optional = 4 [(dccl.field).min=-710,
47  (dccl.field).max=3000];
48  optional uint32 uint32_default_optional = 5 [(dccl.field).min=0,
49  (dccl.field).max=3000];
50  optional uint64 uint64_default_optional = 6 [(dccl.field).min=5,
51  (dccl.field).max=3000];
52  optional sint32 sint32_default_optional = 7 [(dccl.field).min=-60,
53  (dccl.field).max=3000];
54  optional sint64 sint64_default_optional = 8 [(dccl.field).min=-70,
55  (dccl.field).max=3000];
56  optional fixed32 fixed32_default_optional = 9 [(dccl.field).min=0,
57  (dccl.field).max=400];
58  optional fixed64 fixed64_default_optional = 10 [(dccl.field).min=0,
59  (dccl.field).max=3000];
60  optional sfixed32 sfixed32_default_optional = 11 [(dccl.field).min=11,
61  (dccl.field).max=3000];
62  optional sfixed64 sfixed64_default_optional = 12 [(dccl.field).min=-12,
63  (dccl.field).max=3000];
64 
65  optional bool bool_default_optional = 13;
66 
67  optional string string_default_optional = 14 [(dccl.field).max_length=8];
68  optional bytes bytes_default_optional = 15 [(dccl.field).max_length=9];
69 
70  optional Enum1 enum_default_optional = 16;
71 
72  optional EmbeddedMsg1 msg_default_optional = 17;
73 
74 
75  required double double_default_required = 21 [(dccl.field).min=-100,
76  (dccl.field).max=126,
77  (dccl.field).precision=2,
78  (dccl.field).in_head=true];
79  required float float_default_required = 22 [(dccl.field).min=-20,
80  (dccl.field).max=150,
81  (dccl.field).precision=3];
82  required int32 int32_default_required = 23 [(dccl.field).min=-20,
83  (dccl.field).max=3000];
84  required int64 int64_default_required = 24 [(dccl.field).min=-710,
85  (dccl.field).max=3000];
86  required uint32 uint32_default_required = 25 [(dccl.field).min=0,
87  (dccl.field).max=3000];
88  required uint64 uint64_default_required = 26 [(dccl.field).min=5,
89  (dccl.field).max=3000];
90  required sint32 sint32_default_required = 27 [(dccl.field).min=-60,
91  (dccl.field).max=3000];
92  required sint64 sint64_default_required = 28 [(dccl.field).min=-70,
93  (dccl.field).max=3000];
94  required fixed32 fixed32_default_required = 29 [(dccl.field).min=0,
95  (dccl.field).max=400];
96  required fixed64 fixed64_default_required = 30 [(dccl.field).min=0,
97  (dccl.field).max=3000];
98  required sfixed32 sfixed32_default_required = 31 [(dccl.field).min=11,
99  (dccl.field).max=3000];
100  required sfixed64 sfixed64_default_required = 32 [(dccl.field).min=-120,
101  (dccl.field).max=3000];
102 
103  required bool bool_default_required = 33;
104 
105  required string string_default_required = 34 [(dccl.field).max_length=8];
106  required bytes bytes_default_required = 35 [(dccl.field).max_length=9];
107 
108  required Enum1 enum_default_required = 36;
109 
110  required EmbeddedMsg1 msg_default_required = 37;
111 
112  repeated double double_default_repeat = 101 [(dccl.field).min=0,
113  (dccl.field).max=100,
114  (dccl.field).precision=3,
115  (dccl.field).max_repeat=4];
116  repeated float float_default_repeat = 102 [(dccl.field).min=0,
117  (dccl.field).max=100,
118  (dccl.field).precision=3,
119  (dccl.field).max_repeat=4];
120 
121  repeated int32 int32_default_repeat = 103 [(dccl.field).min=0,
122  (dccl.field).max=100,
123  (dccl.field).max_repeat=4];
124  repeated int64 int64_default_repeat = 104 [(dccl.field).min=-100,
125  (dccl.field).max=100,
126  (dccl.field).max_repeat=4];
127  repeated uint32 uint32_default_repeat = 105 [(dccl.field).min=0,
128  (dccl.field).max=100,
129  (dccl.field).max_repeat=4];
130  repeated uint64 uint64_default_repeat = 106 [(dccl.field).min=0,
131  (dccl.field).max=100,
132  (dccl.field).max_repeat=4];
133  repeated sint32 sint32_default_repeat = 107 [(dccl.field).min=-60,
134  (dccl.field).max=100,
135  (dccl.field).max_repeat=4];
136  repeated sint64 sint64_default_repeat = 108 [(dccl.field).min=-600,
137  (dccl.field).max=100,
138  (dccl.field).max_repeat=4];
139  repeated fixed32 fixed32_default_repeat = 109 [(dccl.field).min=0,
140  (dccl.field).max=100,
141  (dccl.field).max_repeat=4];
142  repeated fixed64 fixed64_default_repeat = 110 [(dccl.field).min=0,
143  (dccl.field).max=100,
144  (dccl.field).max_repeat=4];
145  repeated sfixed32 sfixed32_default_repeat = 111 [(dccl.field).min=0,
146  (dccl.field).max=100,
147  (dccl.field).max_repeat=4];
148  repeated sfixed64 sfixed64_default_repeat = 112 [(dccl.field).min=-500,
149  (dccl.field).max=100,
150  (dccl.field).max_repeat=4];
151 
152  repeated bool bool_default_repeat = 113 [(dccl.field).max_repeat=4];
153 
154  repeated string string_default_repeat = 114 [(dccl.field).max_length=4, (dccl.field).max_repeat=4];
155  repeated bytes bytes_default_repeat = 115 [(dccl.field).max_length=4, (dccl.field).max_repeat=4];
156 
157  repeated Enum1 enum_default_repeat = 116 [(dccl.field).max_repeat=4];
158 
159  repeated EmbeddedMsg1 msg_default_repeat = 117 [(dccl.field).max_repeat=4];
160 }
161