DCCL v5
Loading...
Searching...
No Matches
option_extensions.proto
1// Copyright 2010-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/>.
25syntax = "proto2";
26
27import "google/protobuf/descriptor.proto";
28
29// Email from liujisi@google.com on 10.02.2012: Feel free to use 1012 for all
30// types of options.
31//--------------------------------
32// Project: Dynamic Compact Control Language
33// Contact: Toby Schneider <tes@mit.edu>
34// Web site: https://launchpad.net/dccl
35// Extensions: 1012 (all types)
36//--------------------------------
37package dccl;
38
39extend .google.protobuf.FieldOptions
40{
41 optional DCCLFieldOptions field = 1012;
42}
43
44extend .google.protobuf.MessageOptions
45{
46 optional DCCLMessageOptions msg = 1012;
47}
48
49message DCCLFieldOptions
50{
51 // what encoder / decoder should we use?
52 optional string codec = 1 [default = "dccl.default2"];
53 // leave this field out of DCCL transmissions (has_field() will be false on
54 // receipt)
55 optional bool omit = 2 [default = false];
56 // set true for fields in the header (will *not* be encrypte)d
57 optional bool in_head = 3 [default = false];
58
59 // double, float
60 optional int32 precision = 4 [default = 0]; // Deprecated
61 optional double resolution = 12 [default = 1];
62 // int, double, float
63 optional double min = 5;
64 optional double max = 6;
65
66 // time ("1 day" can encode times 12h before or after the receiver's time)
67 optional uint32 num_days = 7 [default = 1];
68
69 // static
70 optional string static_value = 8 [default = ""];
71
72 // string, bytes
73 optional uint32 max_length = 9;
74 optional uint32 min_length = 14 [default = 0];
75
76 // any `repeated` field
77 optional uint32 max_repeat = 10;
78 optional uint32 min_repeat = 13 [default = 0];
79
80 // enum
81 optional bool packed_enum = 11 [default = true];
82
83 optional string description = 20;
84
85 message Units
86 {
87 // units
88 optional string base_dimensions = 1;
89 optional string derived_dimensions = 2;
90 optional string system = 3 [default = "si"];
91 optional bool relative_temperature = 4 [default = false];
92 optional string unit = 5;
93 optional string prefix = 6;
94 message CustomUnit
95 {
96 required string unit = 1;
97 optional string header = 2;
98 }
99 optional CustomUnit custom = 7;
100 }
101 optional Units units = 30;
102
103 // runtime contents-based conditionals
104 message Conditions
105 {
106 optional string required_if = 1;
107 optional string omit_if = 2;
108 optional string only_if = 3;
109 optional string min = 10;
110 optional string max = 11;
111 }
112
113 optional Conditions dynamic_conditions = 40;
114
115 // ccl = 1000
116 // arithmetic = 1001
117 extensions 1000 to max;
118}
119
120message DCCLMessageOptions
121{
122 optional int32 id = 1;
123 optional uint32 max_bytes = 2;
124
125 optional string codec = 3;
126
127 optional string codec_group = 4;
128 optional int32 codec_version = 5;
129
130 optional bool omit_id = 10 [default = false];
131
132 optional string unit_system = 30 [default = "si"];
133
134 // runtime contents-based conditionals
135 message Conditions
136 {
137 optional string max_bytes = 1;
138 }
139
140 optional Conditions dynamic_conditions = 40;
141}