DCCL v3
test.proto
1 syntax = "proto2";
2 import "dccl/option_extensions.proto";
3 package dccl.test;
4 
5 
6 message EmbeddedMsg1
7 {
8  option (dccl.msg).codec="dccl.default3";
9 
10  optional double val = 1 [(dccl.field).min=0,
11  (dccl.field).max=100,
12  (dccl.field).precision=3];
13 
14 
15  optional EmbeddedMsg2 msg = 2;
16 }
17 
18 message EmbeddedMsg2
19 {
20  optional double val = 1 [(dccl.field).min=0,
21  (dccl.field).max=100,
22  (dccl.field).precision=2];
23 
24 }
25 
26 message TestMsg
27 {
28  option (dccl.msg).id = 1;
29  option (dccl.msg).max_bytes = 32;
30  option (dccl.msg).codec_version = 3;
31 
32  optional double d = 1 [(dccl.field).min=-100,
33  (dccl.field).max=126,
34  (dccl.field).precision=1,
35  (dccl.field).codec="dccl.default3"];
36 
37 
38 
39  repeated double d_repeat = 3 [(dccl.field).max_repeat=5,
40  (dccl.field).codec="test.grouptest"];
41  optional EmbeddedMsg1 msg = 2;
42 }
43 
44 message TestMsgGroup
45 {
46  option (dccl.msg).id = 2;
47  option (dccl.msg).max_bytes = 32;
48  option (dccl.msg).codec_group = "test.grouptest";
49  option (dccl.msg).codec_version = 3;
50 
51  optional double d = 1 [(dccl.field).min=-100,
52  (dccl.field).max=126,
53  (dccl.field).precision=1,
54  (dccl.field).codec="dccl.default3"];
55 
56  repeated double d_repeat = 3 [(dccl.field).max_repeat=5];
57  optional EmbeddedMsg1 msg = 2;
58 
59 }
60 
61 
62 message TestMsgVersion
63 {
64  option (dccl.msg).id = 3;
65  option (dccl.msg).max_bytes = 32;
66  option (dccl.msg).codec_version = 2;
67 
68  optional double d = 1 [(dccl.field).min=-100,
69  (dccl.field).max=126,
70  (dccl.field).precision=2];
71 
72  repeated double d_repeat = 3 [(dccl.field).min=12.0,
73  (dccl.field).max=13.6,
74  (dccl.field).precision=1,
75  (dccl.field).max_repeat=5];
76 
77  optional EmbeddedMsg1 msg = 2;
78 
79 }