24 #ifndef DCCLCCLCOMPATIBILITY20120426H
25 #define DCCLCCLCOMPATIBILITY20120426H
27 #include "../codecs2/field_codec_default.h"
28 #include "../field_codec_id.h"
29 #include "dccl/ccl/protobuf/ccl.pb.h"
30 #include "dccl/ccl/protobuf/ccl_extensions.pb.h"
42 const unsigned char DCCL_CCL_HEADER = 32;
51 if ((wire_value & 0xFFFF0000) == CCL_DCCL_ID_PREFIX)
54 return dccl::Bitset(dccl::BITS_IN_BYTE, wire_value & 0x0000FFFF);
68 if (ccl_id == DCCL_CCL_HEADER)
72 (*bits) >>= dccl::BITS_IN_BYTE;
79 return CCL_DCCL_ID_PREFIX + ccl_id;
83 unsigned size()
override {
return size(0); }
87 if ((field_value & 0xFFFF0000) == CCL_DCCL_ID_PREFIX)
90 return dccl::BITS_IN_BYTE;
98 unsigned max_size()
override
103 unsigned min_size()
override {
return dccl::BITS_IN_BYTE; }
109 CCL_DCCL_ID_PREFIX = 0x0CC10000
119 unsigned size()
override;
122 LATLON_COMPRESSED_BYTE_SIZE = 3
142 double max()
override {
return (1 << dccl::BITS_IN_BYTE) - 1; }
143 double min()
override {
return 0; }
144 void validate()
override {}
155 static dccl::uint64 to_uint64_time(
const std::time_t& time_date);
161 unsigned size()
override;
165 MICROSECONDS_IN_SECOND = 1000000
169 TIME_DATE_COMPRESSED_BYTE_SIZE = 3
179 unsigned size()
override {
return dccl::BITS_IN_BYTE; }
188 unsigned size()
override {
return HI_RES_ALTITUDE_COMPRESSED_BYTE_SIZE * dccl::BITS_IN_BYTE; }
191 HI_RES_ALTITUDE_COMPRESSED_BYTE_SIZE = 2
201 unsigned size()
override
206 void validate()
override
210 "missing (dccl.field).ccl.bit_size");
220 unsigned size()
override {
return dccl::BITS_IN_BYTE; }
229 unsigned size()
override {
return dccl::BITS_IN_BYTE; }
231 void validate()
override
235 "missing (dccl.field).ccl.thrust_mode_tag");
245 unsigned size()
override {
return dccl::BITS_IN_BYTE; }
254 unsigned size()
override {
return GFI_PITCH_OIL_COMPRESSED_BYTE_SIZE * dccl::BITS_IN_BYTE; }
257 GFI_PITCH_OIL_COMPRESSED_BYTE_SIZE = 2
267 unsigned size()
override {
return dccl::BITS_IN_BYTE; }
276 unsigned size()
override {
return dccl::BITS_IN_BYTE; }
285 unsigned size()
override {
return dccl::BITS_IN_BYTE; }
Bitset encode() override
Encode an empty field.
unsigned size() override
Calculate the size (in bits) of an empty field.
google::protobuf::uint64 uint64
an unsigned 64 bit integer
unsigned long to_ulong() const
Returns the value of the Bitset as an unsigned long integer. Equivalent to to<unsigned long>().
void get_more_bits(size_type num_bits)
Retrieve more bits from the parent Bitset.
Dynamic Compact Control Language namespace.
Base class for static-typed field encoders/decoders that use a fixed number of bits on the wire regar...
unsigned min_size() override
Calculate minimum size of the field in bits.
google::protobuf::uint32 uint32
an unsigned 32 bit integer
void require(bool b, const std::string &description)
Essentially an assertion to be used in the validate() virtual method.
The Dynamic CCL enCODer/DECoder. This is the main class you will use to load, encode and decode DCCL ...
unsigned max_size() override
Calculate maximum size of the field in bits.
uint32 decode(Bitset *bits) override
Decode a field. If the field is empty (i.e. was encoded using the zero-argument encode()),...
Bitset encode() override
Encode an empty field.
A variable size container of bits (subclassed from std::deque<bool>) with an optional hierarchy....
Provides the default 1 byte or 2 byte DCCL ID codec.
Bitset & prepend(const Bitset &bits)
Adds the bitset to the little end.
Provides a basic bounded arbitrary length numeric (double, float, uint32, uint64, int32,...
WireType decode(Bitset *bits) override
Decode a field. If the field is empty (i.e. was encoded using the zero-argument encode()),...
dccl::DCCLFieldOptions dccl_field_options() const
Get the DCCL field option extension value for the current field.