DCCL v3
test.proto
1 
2 import "dccl/option_extensions.proto";
3 package dccl.test;
4 
5 message NumericMsg
6 {
7  option (dccl.msg).id = 10;
8  option (dccl.msg).max_bytes = 32;
9  option (dccl.msg).codec_version = 3;
10 
11  optional double a = 1 [(dccl.field).max = 180,
12  (dccl.field).min = -180,
13  (dccl.field).precision = 12,
14  (dccl.field).in_head=true];
15 
16  optional double b = 2 [(dccl.field).max = 18,
17  (dccl.field).min = -18,
18  (dccl.field).precision = 4];
19 
20  // max is 2^64 rounded to 1e5
21  required uint64 u1 = 3 [(dccl.field).max = 18446744073709500000,
22  (dccl.field).min = 0,
23  (dccl.field).precision = -5];
24 
25  // max is 2^64 rounded to 1e5
26  required uint64 u2 = 4 [(dccl.field).max = 18446744073709500000,
27  (dccl.field).min = 0,
28  (dccl.field).precision = -5];
29 
30 }
31 
32 message NegativePrecisionNumericMsg
33 {
34  option (dccl.msg).id = 10;
35  option (dccl.msg).max_bytes = 32;
36  option (dccl.msg).codec_version = 3;
37 
38  optional double a = 1 [(dccl.field).min = -20,
39  (dccl.field).max = 20,
40  (dccl.field).precision = -1];
41 
42  optional int32 b = 2 [(dccl.field).min = -500000,
43  (dccl.field).max = 500000,
44  (dccl.field).precision = -3];
45 }
46 
47 
48 message TooBigNumericMsg
49 {
50  option (dccl.msg).id = 11;
51  option (dccl.msg).max_bytes = 32;
52  option (dccl.msg).codec_version = 3;
53 
54  optional double a = 1 [(dccl.field).max = 180,
55  (dccl.field).min = -180,
56  (dccl.field).precision = 15];
57 }