DCCL v4
test_arithmetic.proto
1 // Copyright 2012-2023:
2 // GobySoft, LLC (2013-)
3 // Massachusetts Institute of Technology (2007-2014)
4 // Community contributors (see AUTHORS file)
5 // File authors:
6 // Toby Schneider <toby@gobysoft.org>
7 // Chris Murphy <cmurphy@aphysci.com>
8 //
9 //
10 // This file is part of the Dynamic Compact Control Language Library
11 // ("DCCL").
12 //
13 // DCCL is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU Lesser General Public License as published by
15 // the Free Software Foundation, either version 2.1 of the License, or
16 // (at your option) any later version.
17 //
18 // DCCL is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU Lesser General Public License for more details.
22 //
23 // You should have received a copy of the GNU Lesser General Public License
24 // along with DCCL. If not, see <http://www.gnu.org/licenses/>.
25 syntax = "proto2";
26 import "dccl/option_extensions.proto";
27 import "dccl/arithmetic/protobuf/arithmetic_extensions.proto";
28 package dccl.test.arith;
29 
30 enum Enum1
31 {
32  ENUM_A = 1;
33  ENUM_B = 2;
34  ENUM_C = 3;
35 }
36 
37 enum Enum2
38 {
39  ENUM2_A = 1;
40  ENUM2_B = 2;
41  ENUM2_C = 3;
42  ENUM2_D = 4;
43  ENUM2_E = 5;
44 }
45 
46 message ArithmeticDoubleTestMsg
47 {
48  option (dccl.msg).id = 1;
49  option (dccl.msg).max_bytes = 512;
50  option (dccl.msg).codec_version = 4;
51 
52  repeated double value = 101 [
53  (dccl.field).codec = "dccl.arithmetic",
54  (dccl.field).(arithmetic).model = "model",
55  (dccl.field).(arithmetic).debug_assert = true,
56  (dccl.field).max_repeat = 4
57  ];
58 }
59 message ArithmeticEnumTestMsg
60 {
61  option (dccl.msg).id = 2;
62  option (dccl.msg).max_bytes = 512;
63  option (dccl.msg).codec_version = 4;
64 
65  repeated Enum1 value = 114 [
66  (dccl.field).codec = "dccl.arithmetic",
67  (dccl.field).(arithmetic).model = "model",
68  (dccl.field).(arithmetic).debug_assert = true,
69  (dccl.field).max_repeat = 4
70  ];
71 }
72 
73 message ArithmeticSingleEnumTestMsg
74 {
75  option (dccl.msg).id = 3;
76  option (dccl.msg).max_bytes = 512;
77  option (dccl.msg).codec_version = 4;
78 
79  required Enum1 value = 114 [
80  (dccl.field).codec = "dccl.arithmetic",
81  (dccl.field).(arithmetic).model = "model",
82  (dccl.field).(arithmetic).debug_assert = true
83  ];
84 }
85 
86 message ArithmeticEnum2TestMsg
87 {
88  option (dccl.msg).id = 4;
89  option (dccl.msg).max_bytes = 512;
90  option (dccl.msg).codec_version = 4;
91 
92  repeated Enum2 value = 114 [
93  (dccl.field).codec = "dccl.arithmetic",
94  (dccl.field).(arithmetic).model = "model",
95  (dccl.field).(arithmetic).debug_assert = true,
96  (dccl.field).max_repeat = 8
97  ];
98 }
99 
100 message ArithmeticDouble2TestMsg
101 {
102  option (dccl.msg).id = 5;
103  option (dccl.msg).max_bytes = 10000;
104  option (dccl.msg).codec_version = 4;
105 
106  repeated int32 value = 101 [
107  (dccl.field).codec = "dccl.arithmetic",
108  (dccl.field).(arithmetic).model = "model",
109  (dccl.field).(arithmetic).debug_assert = true,
110  (dccl.field).max_repeat = 100
111  ];
112 }
113 
114 message ArithmeticDouble3TestMsg
115 {
116  option (dccl.msg).id = 6;
117  option (dccl.msg).max_bytes = 10000;
118  option (dccl.msg).codec_version = 4;
119 
120  repeated int32 value = 101 [
121  (dccl.field).codec = "dccl.arithmetic",
122  (dccl.field).(arithmetic).model = "model",
123  (dccl.field).max_repeat = 4,
124  (dccl.field).(arithmetic).debug_assert = true
125  ];
126 }
127 
128 // repeated float float_arithmetic_repeat = 102 [(dccl.field).(arithmetic).model
129 // = "float_model",
130 // (dccl.field).max_repeat=4];
131 
132 // repeated int32 int32_arithmetic_repeat = 103 [(dccl.field).(arithmetic).model
133 // = "int_model",
134 // (dccl.field).max_repeat=4];
135 
136 // repeated bool bool_arithmetic_repeat = 113 [(dccl.field).(arithmetic).model =
137 // "bool_model",
138 // (dccl.field).max_repeat=4];