DCCL v4
Loading...
Searching...
No Matches
dccl Namespace Reference

Dynamic Compact Control Language namespace. More...

Namespaces

namespace  arith
 DCCL Arithmetic Encoder Library namespace.
 
namespace  internal
 Namespace for objects used internally by DCCL.
 
namespace  legacyccl
 DCCL Implementation of the REMUS CCL Language Library namespace.
 
namespace  native_protobuf
 Implements the default Google Protocol Buffers encoder for a variety of numeric types.
 
namespace  test
 Unit test namespace.
 
namespace  tool
 'dccl' command line tool namespace
 
namespace  v2
 Goby/DCCL version 2 default field codecs.
 
namespace  v3
 DCCL version 3 default field codecs.
 
namespace  v4
 DCCL version 4 default field codecs.
 

Classes

class  Bitset
 A variable size container of bits (subclassed from std::deque<bool>) with an optional hierarchy. Similar to set::bitset but can be resized at runtime and has the ability to have parent Bitsets that can give bits to their children. More...
 
class  Codec
 The Dynamic CCL enCODer/DECoder. This is the main class you will use to load, encode and decode DCCL messages. Many users will not need any other DCCL classes than this one. More...
 
class  DCCLFieldOptions
 
class  DCCLFieldOptions_Conditions
 
class  DCCLFieldOptions_Units
 
class  DCCLMessageOptions
 
class  DefaultIdentifierCodec
 Provides the default 1 byte or 2 byte DCCL ID codec. More...
 
class  DynamicConditions
 
class  DynamicProtobufManager
 Helper class for creating google::protobuf::Message objects that are not statically compiled into the application. More...
 
class  Exception
 Exception class for DCCL. More...
 
class  FieldCodecBase
 Provides a base class for defining DCCL field encoders / decoders. Most users who wish to define custom encoders/decoders will use the RepeatedTypedFieldCodec, TypedFieldCodec or its children (e.g. TypedFixedFieldCodec) instead of directly inheriting from this class. More...
 
class  FieldCodecManager
 
class  FieldCodecManagerLocal
 A class for managing the various field codecs. Here you can add and remove field codecs. The DCCL Codec and DefaultMessageCodec use the find() methods to locate the appropriate field codec. More...
 
class  FieldCodecSelector
 A class that goes between FieldCodecBase and TypedFieldCodec to determine if the pre_encode() and post_decode() methods (which convert between WireType and FieldType) must be implemented or not. More...
 
class  FieldCodecSelector< WireType, FieldType, std::enable_if_t< std::is_same< WireType, FieldType >::value > >
 A class that goes between FieldCodecBase and TypedFieldCodec to determine if the pre_encode() and post_decode() methods must be implemented or not. The specialization is selected if WireType == FieldType and implements these functions as a pass-through. More...
 
class  Logger
 The DCCL Logger class. Do not instantiate this class directly. Rather, use the dccl::dlog object. More...
 
class  NullValueException
 Exception used to signal null (non-existent) value within field codecs during decode. More...
 
class  Option
 Represents a command line option. More...
 
class  OutOfRangeException
 
class  RepeatedTypedFieldCodec
 Base class for "repeated" (multiple value) static-typed (no dccl::any) field encoders/decoders. Use TypedFixedFieldCodec if your codec is fixed length (always uses the same number of bits on the wire). Use TypedFieldCodec if your fields are always singular ("optional" or "required"). Singular fields are default implemented in this codec by calls to the equivalent repeated function with an empty or single valued vector. More...
 
class  TypedFieldCodec
 Base class for static-typed (no dccl::any) field encoders/decoders. Most single-valued user defined variable length codecs will start with this class. Use TypedFixedFieldCodec if your codec is fixed length (always uses the same number of bits on the wire) or RepeatedTypedFieldCodec if your codec has special behavior for repeated (vector) fields. More...
 
class  TypedFixedFieldCodec
 Base class for static-typed field encoders/decoders that use a fixed number of bits on the wire regardless of the value of the field. Use TypedFieldCodec if your encoder is variable length. See TypedFieldCodec for an explanation of the template parameters (FieldType and WireType). More...
 

Typedefs

using any = boost::any
 
using bad_any_cast = boost::bad_any_cast
 
typedef google::protobuf::uint32 uint32
 an unsigned 32 bit integer
 
using int32 = google::protobuf::int32
 a signed 32 bit integer
 
using uint64 = google::protobuf::uint64
 an unsigned 64 bit integer
 
using int64 = google::protobuf::int64
 a signed 64 bit integer
 

Enumerations

enum  MessagePart { HEAD , BODY , UNKNOWN }
 

Functions

template<class T >
any_cast (const any &operand)
 
template<class T >
any_cast (any &operand)
 
template<class T >
any_cast (any &&operand)
 
template<class T >
const T * any_cast (const any *operand) noexcept
 
template<class T >
T * any_cast (any *operand) noexcept
 
bool is_empty (const any &a)
 
bool operator== (const Bitset &a, const Bitset &b)
 
bool operator< (const Bitset &a, const Bitset &b)
 
Bitset operator& (const Bitset &b1, const Bitset &b2)
 
Bitset operator| (const Bitset &b1, const Bitset &b2)
 
Bitset operator^ (const Bitset &b1, const Bitset &b2)
 
std::ostream & operator<< (std::ostream &os, const Bitset &b)
 
std::ostream & operator<< (std::ostream &os, const Codec &codec)
 
unsigned floor_bits2bytes (unsigned bits)
 
unsigned ceil_bits2bytes (unsigned bits)
 
std::ostream & operator<< (std::ostream &out, const google::protobuf::Message &msg)
 
template<typename Float >
Float round (Float d)
 
template<typename Float >
std::enable_if< std::is_floating_point< Float >::value, Float >::type round (Float value, int precision)
 
template<typename Float >
std::enable_if< std::is_floating_point< Float >::value, Float >::type quantize (Float value, double interval)
 
template<typename Int >
Int abs (Int i)
 
template<typename Int >
std::enable_if< std::is_integral< Int >::value, Int >::type round (Int value, int precision)
 
template<typename Int >
std::enable_if< std::is_integral< Int >::value, Int >::type quantize (Int value, double interval)
 
template<class T >
void hash_combine (std::size_t &seed, const T &v)
 hash combine - from boost::hash_combine
 
std::string exception_string (const std::string &in, const google::protobuf::Descriptor *desc, const google::protobuf::FieldDescriptor *field)
 
std::ostream & operator<< (std::ostream &os, const FieldCodecBase &field_codec)
 
Exception type_error (const std::string &action, const std::type_info &expected, const std::type_info &got)
 
void to_ostream (const std::string &msg, dccl::logger::Verbosity vrb, dccl::logger::Group grp, std::ostream *os, bool add_timestamp)
 
std::string hash_as_string (std::size_t hash)
 
bool is_part_of_oneof (const google::protobuf::FieldDescriptor *field_desc)
 Checks whether a given field is part to a oneof or not.
 
int containing_oneof_index (const google::protobuf::FieldDescriptor *field_desc)
 Returns the index of the containing oneof of the given field, or -1 if the field is not part of a oneof.
 
int oneof_size (const google::protobuf::OneofDescriptor *oneof_desc)
 Returns the number of bits needed to represent the oneof cases (including the unset case).
 
Binary encoding
void hex_decode (const std::string &in, std::string *out)
 Decodes a (little-endian) hexadecimal string to a byte string. Index 0 and 1 (first byte) of in are written to index 0 (first byte) of out
 
std::string hex_decode (const std::string &in)
 
template<typename CharIterator >
void hex_encode (CharIterator begin, CharIterator end, std::string *out, bool upper_case=false)
 Encodes a (little-endian) hexadecimal string from a byte string. Index 0 of begin is written to index 0 and 1 (first byte) of out
 
template<typename CharIterator >
std::string hex_encode (CharIterator begin, CharIterator end)
 
void hex_encode (const std::string &in, std::string *out, bool upper_case=false)
 Encodes a (little-endian) hexadecimal string from a byte string. Index 0 of in is written to index 0 and 1 (first byte) of out
 
std::string hex_encode (const std::string &in)
 
unsigned ceil_log2 (dccl::uint64 v)
 
unsigned long ceil_log2 (double d)
 
unsigned long ceil_log2 (int i)
 
unsigned long ceil_log2 (long i)
 
unsigned long ceil_log2 (unsigned i)
 
double log2 (double d)
 

Variables

DCCLFieldOptionsDefaultTypeInternal _DCCLFieldOptions_default_instance_
 
DCCLFieldOptions_ConditionsDefaultTypeInternal _DCCLFieldOptions_Conditions_default_instance_
 
DCCLFieldOptions_UnitsDefaultTypeInternal _DCCLFieldOptions_Units_default_instance_
 
DCCLMessageOptionsDefaultTypeInternal _DCCLMessageOptions_default_instance_
 
extern ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< ::PROTOBUF_NAMESPACE_ID::FieldOptions, ::PROTOBUF_NAMESPACE_ID::internal::MessageTypeTraits< ::dccl::DCCLFieldOptions >, 11, false > field
 
extern ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< ::PROTOBUF_NAMESPACE_ID::MessageOptions, ::PROTOBUF_NAMESPACE_ID::internal::MessageTypeTraits< ::dccl::DCCLMessageOptions >, 11, false > msg
 
const unsigned BITS_IN_BYTE = 8
 
Logger dlog
 
const std::string VERSION_STRING = "4.2.1"
 
const std::string VERSION_DATE = "2024.05.21"
 
const std::string COMPILE_DATE = "2024.05.21"
 

Detailed Description

Dynamic Compact Control Language namespace.

Typedef Documentation

◆ any

using dccl::any = typedef boost::any

Definition at line 48 of file any.h.

◆ bad_any_cast

using dccl::bad_any_cast = typedef boost::bad_any_cast

Definition at line 57 of file any.h.

◆ int32

using dccl::int32 = typedef google::protobuf::int32

a signed 32 bit integer

Definition at line 58 of file common.h.

◆ int64

using dccl::int64 = typedef google::protobuf::int64

a signed 64 bit integer

Definition at line 62 of file common.h.

◆ uint32

typedef google::protobuf::uint32 dccl::uint32

an unsigned 32 bit integer

Definition at line 56 of file common.h.

◆ uint64

using dccl::uint64 = typedef google::protobuf::uint64

an unsigned 64 bit integer

Definition at line 60 of file common.h.

Enumeration Type Documentation

◆ MessagePart

enum dccl::MessagePart

Definition at line 32 of file field_codec_message_stack.h.

Function Documentation

◆ abs()

template<typename Int >
Int dccl::abs ( Int  i)

Definition at line 103 of file common.h.

◆ any_cast() [1/5]

template<class T >
T dccl::any_cast ( any &&  operand)

Definition at line 51 of file any.h.

◆ any_cast() [2/5]

template<class T >
T dccl::any_cast ( any &  operand)

Definition at line 50 of file any.h.

◆ any_cast() [3/5]

template<class T >
T * dccl::any_cast ( any *  operand)
noexcept

Definition at line 56 of file any.h.

◆ any_cast() [4/5]

template<class T >
T dccl::any_cast ( const any &  operand)

Definition at line 49 of file any.h.

◆ any_cast() [5/5]

template<class T >
const T * dccl::any_cast ( const any *  operand)
noexcept

Definition at line 52 of file any.h.

◆ ceil_bits2bytes()

unsigned dccl::ceil_bits2bytes ( unsigned  bits)
inline

Definition at line 45 of file common.h.

◆ ceil_log2() [1/5]

unsigned dccl::ceil_log2 ( dccl::uint64  v)
inline
Returns
Efficiently computes ceil(log2(v))

Definition at line 178 of file binary.h.

◆ ceil_log2() [2/5]

unsigned long dccl::ceil_log2 ( double  d)
inline

Definition at line 186 of file binary.h.

◆ ceil_log2() [3/5]

unsigned long dccl::ceil_log2 ( int  i)
inline

Definition at line 191 of file binary.h.

◆ ceil_log2() [4/5]

unsigned long dccl::ceil_log2 ( long  i)
inline

Definition at line 193 of file binary.h.

◆ ceil_log2() [5/5]

unsigned long dccl::ceil_log2 ( unsigned  i)
inline

Definition at line 195 of file binary.h.

◆ containing_oneof_index()

int dccl::containing_oneof_index ( const google::protobuf::FieldDescriptor *  field_desc)
inline

Returns the index of the containing oneof of the given field, or -1 if the field is not part of a oneof.

Parameters
field_descThe field descriptor.
Returns
The index of the containing oneof if the field is part of a oneof, -1 otherwise.

Definition at line 45 of file oneof.h.

◆ exception_string()

std::string dccl::exception_string ( const std::string &  in,
const google::protobuf::Descriptor *  desc,
const google::protobuf::FieldDescriptor *  field 
)
inline

Definition at line 32 of file exception.h.

◆ floor_bits2bytes()

unsigned dccl::floor_bits2bytes ( unsigned  bits)
inline

Definition at line 42 of file common.h.

◆ hash_as_string()

std::string dccl::hash_as_string ( std::size_t  hash)
inline

Definition at line 262 of file logger.h.

◆ hash_combine()

template<class T >
void dccl::hash_combine ( std::size_t &  seed,
const T &  v 
)
inline

hash combine - from boost::hash_combine

Definition at line 152 of file common.h.

◆ hex_decode() [1/2]

std::string dccl::hex_decode ( const std::string &  in)
inline

Definition at line 86 of file binary.h.

◆ hex_decode() [2/2]

void dccl::hex_decode ( const std::string &  in,
std::string *  out 
)
inline

Decodes a (little-endian) hexadecimal string to a byte string. Index 0 and 1 (first byte) of in are written to index 0 (first byte) of out

Parameters
inhexadecimal string (e.g. "544f4d" or "544F4D")
outpointer to string to store result (e.g. "TOM").

Definition at line 51 of file binary.h.

◆ hex_encode() [1/4]

template<typename CharIterator >
std::string dccl::hex_encode ( CharIterator  begin,
CharIterator  end 
)
inline

Definition at line 133 of file binary.h.

◆ hex_encode() [2/4]

template<typename CharIterator >
void dccl::hex_encode ( CharIterator  begin,
CharIterator  end,
std::string *  out,
bool  upper_case = false 
)
inline

Encodes a (little-endian) hexadecimal string from a byte string. Index 0 of begin is written to index 0 and 1 (first byte) of out

Parameters
beginiterator to first byte of string to encode (e.g. "TOM")
enditerator pointing to the past-the-end character of the string.
outpointer to string to store result (e.g. "544f4d")
upper_caseset true to use upper case for the alphabet characters (i.e. A,B,C,D,E,F), otherwise lowercase is used (a,b,c,d,e,f).

Definition at line 100 of file binary.h.

◆ hex_encode() [3/4]

std::string dccl::hex_encode ( const std::string &  in)
inline

Definition at line 150 of file binary.h.

◆ hex_encode() [4/4]

void dccl::hex_encode ( const std::string &  in,
std::string *  out,
bool  upper_case = false 
)
inline

Encodes a (little-endian) hexadecimal string from a byte string. Index 0 of in is written to index 0 and 1 (first byte) of out

Parameters
inbyte string to encode (e.g. "TOM")
outpointer to string to store result (e.g. "544f4d")
upper_caseset true to use upper case for the alphabet characters (i.e. A,B,C,D,E,F), otherwise lowercase is used (a,b,c,d,e,f).

Definition at line 145 of file binary.h.

◆ is_empty()

bool dccl::is_empty ( const any &  a)
inline

Definition at line 58 of file any.h.

◆ is_part_of_oneof()

bool dccl::is_part_of_oneof ( const google::protobuf::FieldDescriptor *  field_desc)
inline

Checks whether a given field is part to a oneof or not.

Parameters
field_descThe field descriptor.
Returns
true if the field is part of a oneof, false otherwise.

Definition at line 36 of file oneof.h.

◆ log2()

double dccl::log2 ( double  d)
inline

Definition at line 197 of file binary.h.

◆ oneof_size()

int dccl::oneof_size ( const google::protobuf::OneofDescriptor *  oneof_desc)
inline

Returns the number of bits needed to represent the oneof cases (including the unset case).

Parameters
oneof_descThe oneof descriptor
Returns
The number of bits needed to represent the oneof cases (including the unset case).

Definition at line 57 of file oneof.h.

◆ operator&()

Bitset dccl::operator& ( const Bitset b1,
const Bitset b2 
)
inline

Definition at line 395 of file bitset.h.

◆ operator<()

bool dccl::operator< ( const Bitset a,
const Bitset b 
)
inline

Definition at line 380 of file bitset.h.

◆ operator<<() [1/4]

std::ostream & dccl::operator<< ( std::ostream &  os,
const Bitset b 
)
inline

Definition at line 416 of file bitset.h.

◆ operator<<() [2/4]

std::ostream & dccl::operator<< ( std::ostream &  os,
const Codec codec 
)
inline

Definition at line 466 of file codec.h.

◆ operator<<() [3/4]

std::ostream & dccl::operator<< ( std::ostream &  os,
const FieldCodecBase field_codec 
)

Definition at line 638 of file field_codec.cpp.

◆ operator<<() [4/4]

std::ostream & dccl::operator<< ( std::ostream &  out,
const google::protobuf::Message &  msg 
)
inline

Definition at line 66 of file common.h.

◆ operator==()

bool dccl::operator== ( const Bitset a,
const Bitset b 
)
inline

Definition at line 375 of file bitset.h.

◆ operator^()

Bitset dccl::operator^ ( const Bitset b1,
const Bitset b2 
)
inline

Definition at line 409 of file bitset.h.

◆ operator|()

Bitset dccl::operator| ( const Bitset b1,
const Bitset b2 
)
inline

Definition at line 402 of file bitset.h.

◆ quantize() [1/2]

template<typename Float >
std::enable_if< std::is_floating_point< Float >::value, Float >::type dccl::quantize ( Float  value,
double  interval 
)

approximate 'value' to the nearest quantile defined by 'interval'

Parameters
valuevalue to round
intervalnumber defining the quantization step
Returns
quantized value

Definition at line 90 of file common.h.

◆ quantize() [2/2]

template<typename Int >
std::enable_if< std::is_integral< Int >::value, Int >::type dccl::quantize ( Int  value,
double  interval 
)

approximate 'value' to the nearest quantile defined by 'interval'

Parameters
valuevalue to round
intervalnumber defining the quantization step
Returns
quantized value

Definition at line 135 of file common.h.

◆ round() [1/3]

template<typename Float >
Float dccl::round ( Float  d)

Definition at line 71 of file common.h.

◆ round() [2/3]

template<typename Float >
std::enable_if< std::is_floating_point< Float >::value, Float >::type dccl::round ( Float  value,
int  precision 
)

round 'value' to 'precision' number of decimal places

Parameters
valuevalue to round
precisionnumber of places past the decimal to round (e.g. dec=1 rounds to tenths)
Returns
rounded value

Definition at line 78 of file common.h.

◆ round() [3/3]

template<typename Int >
std::enable_if< std::is_integral< Int >::value, Int >::type dccl::round ( Int  value,
int  precision 
)

round 'value' to 'precision' number of decimal places

Parameters
valuevalue to round
precisionnumber of places past the decimal to round (e.g. dec=1 rounds to tenths)
Returns
rounded value

Definition at line 110 of file common.h.

◆ to_ostream()

void dccl::to_ostream ( const std::string &  msg,
dccl::logger::Verbosity  vrb,
dccl::logger::Group  grp,
std::ostream *  os,
bool  add_timestamp 
)

Definition at line 81 of file logger.cpp.

◆ type_error()

Exception dccl::type_error ( const std::string &  action,
const std::type_info &  expected,
const std::type_info &  got 
)
inline

Definition at line 537 of file field_codec.h.

Variable Documentation

◆ _DCCLFieldOptions_Conditions_default_instance_

DCCLFieldOptions_ConditionsDefaultTypeInternal dccl::_DCCLFieldOptions_Conditions_default_instance_
extern

Definition at line 58 of file option_extensions.pb.h.

◆ _DCCLFieldOptions_default_instance_

DCCLFieldOptionsDefaultTypeInternal dccl::_DCCLFieldOptions_default_instance_
extern

Definition at line 55 of file option_extensions.pb.h.

◆ _DCCLFieldOptions_Units_default_instance_

DCCLFieldOptions_UnitsDefaultTypeInternal dccl::_DCCLFieldOptions_Units_default_instance_
extern

Definition at line 61 of file option_extensions.pb.h.

◆ _DCCLMessageOptions_default_instance_

DCCLMessageOptionsDefaultTypeInternal dccl::_DCCLMessageOptions_default_instance_
extern

Definition at line 64 of file option_extensions.pb.h.

◆ BITS_IN_BYTE

const unsigned dccl::BITS_IN_BYTE = 8

Definition at line 64 of file common.h.

◆ COMPILE_DATE

const std::string dccl::COMPILE_DATE = "2024.05.21"

Definition at line 39 of file version.h.

◆ dlog

dccl::Logger dccl::dlog
extern

Definition at line 29 of file logger.cpp.

◆ field

extern::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<::PROTOBUF_NAMESPACE_ID::FieldOptions,::PROTOBUF_NAMESPACE_ID::internal::MessageTypeTraits<::dccl::DCCLFieldOptions >, 11, false > dccl::field

Definition at line 1453 of file option_extensions.pb.h.

◆ msg

extern::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier<::PROTOBUF_NAMESPACE_ID::MessageOptions,::PROTOBUF_NAMESPACE_ID::internal::MessageTypeTraits<::dccl::DCCLMessageOptions >, 11, false > dccl::msg

Definition at line 1457 of file option_extensions.pb.h.

◆ VERSION_DATE

const std::string dccl::VERSION_DATE = "2024.05.21"

Definition at line 38 of file version.h.

◆ VERSION_STRING

const std::string dccl::VERSION_STRING = "4.2.1"

Definition at line 37 of file version.h.