DCCL v4
test.proto
1 // Copyright 2019-2023:
2 // GobySoft, LLC (2013-)
3 // Community contributors (see AUTHORS file)
4 // File authors:
5 // Toby Schneider <toby@gobysoft.org>
6 //
7 //
8 // This file is part of the Dynamic Compact Control Language Library
9 // ("DCCL").
10 //
11 // DCCL is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU Lesser General Public License as published by
13 // the Free Software Foundation, either version 2.1 of the License, or
14 // (at your option) any later version.
15 //
16 // DCCL is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU Lesser General Public License for more details.
20 //
21 // You should have received a copy of the GNU Lesser General Public License
22 // along with DCCL. If not, see <http://www.gnu.org/licenses/>.
23 syntax = "proto2";
24 import "dccl/option_extensions.proto";
25 package dccl.test;
26 
27 enum Enum1
28 {
29  ENUM_A = 1;
30  ENUM_B = 2;
31  ENUM_C = 3;
32 }
33 
34 message NativeProtobufTest
35 {
36  option (dccl.msg).id = 1;
37  option (dccl.msg).max_bytes = 1024;
38 
39  option (dccl.msg).codec_version = 4;
40  option (dccl.msg).codec_group = "dccl.native_protobuf";
41 
42  optional double double_default_optional = 1;
43  optional float float_default_optional = 2;
44  optional int32 int32_default_optional = 3;
45  optional int64 int64_default_optional = 4;
46  optional uint32 uint32_default_optional = 5;
47  optional uint64 uint64_default_optional = 6;
48  optional sint32 sint32_default_optional = 7;
49  optional sint64 sint64_default_optional = 8;
50  optional fixed32 fixed32_default_optional = 9;
51  optional fixed64 fixed64_default_optional = 10;
52  optional sfixed32 sfixed32_default_optional = 11;
53  optional sfixed64 sfixed64_default_optional = 12;
54 
55  optional bool bool_default_optional = 13;
56  optional Enum1 enum_default_optional = 16;
57 
58  required double double_default_required = 21;
59  required float float_default_required = 22;
60  required int32 int32_default_required = 23;
61  required int64 int64_default_required = 24;
62  required uint32 uint32_default_required = 25;
63  required uint64 uint64_default_required = 26;
64  required sint32 sint32_default_required = 27;
65  required sint64 sint64_default_required = 28;
66  required fixed32 fixed32_default_required = 29;
67  required fixed64 fixed64_default_required = 30;
68  required sfixed32 sfixed32_default_required = 31;
69  required sfixed64 sfixed64_default_required = 32;
70 
71  required bool bool_default_required = 33;
72  optional Enum1 enum_default_required = 34;
73 
74  repeated double double_default_repeat = 101 [(dccl.field).max_repeat = 4];
75  repeated int32 int32_default_repeat = 103 [(dccl.field).max_repeat = 4];
76 }