DCCL v3
test.proto
1 
2 import "dccl/option_extensions.proto";
3 package dccl.test;
4 
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 
35  // test default enc/dec
36  optional double double_default_optional = 1 [(dccl.field).min=-100,
37  (dccl.field).max=126,
38  (dccl.field).precision=2,
39  (dccl.field).in_head=true];
40  optional float float_default_optional = 2 [(dccl.field).min=-20,
41  (dccl.field).max=150,
42  (dccl.field).precision=3];
43  optional int32 int32_default_optional = 3 [(dccl.field).min=-20,
44  (dccl.field).max=3000];
45  optional int64 int64_default_optional = 4 [(dccl.field).min=-710,
46  (dccl.field).max=3000];
47  optional uint32 uint32_default_optional = 5 [(dccl.field).min=0,
48  (dccl.field).max=3000];
49  optional uint64 uint64_default_optional = 6 [(dccl.field).min=5,
50  (dccl.field).max=3000];
51  optional sint32 sint32_default_optional = 7 [(dccl.field).min=-60,
52  (dccl.field).max=3000];
53  optional sint64 sint64_default_optional = 8 [(dccl.field).min=-70,
54  (dccl.field).max=3000];
55  optional fixed32 fixed32_default_optional = 9 [(dccl.field).min=0,
56  (dccl.field).max=400];
57  optional fixed64 fixed64_default_optional = 10 [(dccl.field).min=0,
58  (dccl.field).max=3000];
59  optional sfixed32 sfixed32_default_optional = 11 [(dccl.field).min=11,
60  (dccl.field).max=3000];
61  optional sfixed64 sfixed64_default_optional = 12 [(dccl.field).min=-12,
62  (dccl.field).max=3000];
63 
64  optional bool bool_default_optional = 13;
65 
66  optional string string_default_optional = 14 [(dccl.field).max_length=8];
67  optional bytes bytes_default_optional = 15 [(dccl.field).max_length=9];
68 
69  optional Enum1 enum_default_optional = 16;
70 
71  optional EmbeddedMsg1 msg_default_optional = 17;
72 
73 
74  required double double_default_required = 21 [(dccl.field).min=-100,
75  (dccl.field).max=126,
76  (dccl.field).precision=2,
77  (dccl.field).in_head=true];
78  required float float_default_required = 22 [(dccl.field).min=-20,
79  (dccl.field).max=150,
80  (dccl.field).precision=3];
81  required int32 int32_default_required = 23 [(dccl.field).min=-20,
82  (dccl.field).max=3000];
83  required int64 int64_default_required = 24 [(dccl.field).min=-710,
84  (dccl.field).max=3000];
85  required uint32 uint32_default_required = 25 [(dccl.field).min=0,
86  (dccl.field).max=3000];
87  required uint64 uint64_default_required = 26 [(dccl.field).min=5,
88  (dccl.field).max=3000];
89  required sint32 sint32_default_required = 27 [(dccl.field).min=-60,
90  (dccl.field).max=3000];
91  required sint64 sint64_default_required = 28 [(dccl.field).min=-70,
92  (dccl.field).max=3000];
93  required fixed32 fixed32_default_required = 29 [(dccl.field).min=0,
94  (dccl.field).max=400];
95  required fixed64 fixed64_default_required = 30 [(dccl.field).min=0,
96  (dccl.field).max=3000];
97  required sfixed32 sfixed32_default_required = 31 [(dccl.field).min=11,
98  (dccl.field).max=3000];
99  required sfixed64 sfixed64_default_required = 32 [(dccl.field).min=-120,
100  (dccl.field).max=3000];
101 
102  required bool bool_default_required = 33;
103 
104  required string string_default_required = 34 [(dccl.field).max_length=8];
105  required bytes bytes_default_required = 35 [(dccl.field).max_length=9];
106 
107  required Enum1 enum_default_required = 36;
108 
109  required EmbeddedMsg1 msg_default_required = 37;
110 
111  repeated double double_default_repeat = 101 [(dccl.field).min=0,
112  (dccl.field).max=100,
113  (dccl.field).precision=3,
114  (dccl.field).max_repeat=4];
115  repeated float float_default_repeat = 102 [(dccl.field).min=0,
116  (dccl.field).max=100,
117  (dccl.field).precision=3,
118  (dccl.field).max_repeat=4];
119 
120  repeated int32 int32_default_repeat = 103 [(dccl.field).min=0,
121  (dccl.field).max=100,
122  (dccl.field).max_repeat=4];
123  repeated int64 int64_default_repeat = 104 [(dccl.field).min=-100,
124  (dccl.field).max=100,
125  (dccl.field).max_repeat=4];
126  repeated uint32 uint32_default_repeat = 105 [(dccl.field).min=0,
127  (dccl.field).max=100,
128  (dccl.field).max_repeat=4,
129  (dccl.field).in_head=true];
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