22 #ifndef DCCLCCLCOMPATIBILITY20120426H
23 #define DCCLCCLCOMPATIBILITY20120426H
25 #include "dccl/codecs2/field_codec_default.h"
26 #include "dccl/field_codec_id.h"
27 #include "dccl/ccl/protobuf/ccl.pb.h"
28 #include "dccl/ccl/protobuf/ccl_extensions.pb.h"
40 const unsigned char DCCL_CCL_HEADER = 32;
50 if((wire_value & 0xFFFF0000) == CCL_DCCL_ID_PREFIX)
53 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;
88 if((field_value & 0xFFFF0000) == CCL_DCCL_ID_PREFIX)
91 return dccl::BITS_IN_BYTE;
95 return dccl::BITS_IN_BYTE +
104 {
return dccl::BITS_IN_BYTE; }
108 enum { CCL_DCCL_ID_PREFIX = 0x0CC10000 };
118 enum { LATLON_COMPRESSED_BYTE_SIZE = 3 };
137 return SCALE_FACTOR *
141 double max() {
return (1 << dccl::BITS_IN_BYTE) - 1; }
142 double min() {
return 0; }
145 enum { SCALE_FACTOR = 4 };
153 static dccl::uint64 to_uint64_time(
const boost::posix_time::ptime& time_date);
161 enum { MICROSECONDS_IN_SECOND = 1000000 };
162 enum { TIME_DATE_COMPRESSED_BYTE_SIZE = 3 };
173 unsigned size() {
return dccl::BITS_IN_BYTE; }
185 return HI_RES_ALTITUDE_COMPRESSED_BYTE_SIZE*dccl::BITS_IN_BYTE;
187 enum { HI_RES_ALTITUDE_COMPRESSED_BYTE_SIZE = 2 };
216 unsigned size() {
return dccl::BITS_IN_BYTE; }
225 unsigned size() {
return dccl::BITS_IN_BYTE; }
241 unsigned size() {
return dccl::BITS_IN_BYTE; }
250 unsigned size() {
return GFI_PITCH_OIL_COMPRESSED_BYTE_SIZE*dccl::BITS_IN_BYTE; }
251 enum { GFI_PITCH_OIL_COMPRESSED_BYTE_SIZE =2};
261 unsigned size() {
return dccl::BITS_IN_BYTE; }
270 unsigned size() {
return dccl::BITS_IN_BYTE; }
279 unsigned size() {
return dccl::BITS_IN_BYTE; }
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.
google::protobuf::uint64 uint64
an unsigned 64 bit integer
Base class for static-typed field encoders/decoders that use a fixed number of bits on the wire regar...
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 ...
virtual unsigned size()
Calculate the size (in bits) of an empty field.
A variable size container of bits (subclassed from std::deque<bool>) with an optional hierarchy....
virtual unsigned max_size()
Calculate maximum size of the field in bits.
Provides the default 1 byte or 2 byte DCCL ID codec.
virtual Bitset encode()
Encode an empty field.
Bitset & prepend(const Bitset &bits)
Adds the bitset to the little end.
virtual uint32 decode(Bitset *bits)
Decode a field. If the field is empty (i.e. was encoded using the zero-argument encode()),...
virtual WireType decode(Bitset *bits)
Decode a field. If the field is empty (i.e. was encoded using the zero-argument encode()),...
virtual unsigned min_size()
Calculate minimum size of the field in bits.
Provides a basic bounded arbitrary length numeric (double, float, uint32, uint64, int32,...
dccl::DCCLFieldOptions dccl_field_options() const
Get the DCCL field option extension value for the current field.
Bitset encode()
Encode an empty field.