DCCL v4
dccl Namespace Reference

Dynamic Compact Control Language namespace. More...

Namespaces

 arith
 DCCL Arithmetic Encoder Library namespace.
 
 internal
 Namespace for objects used internally by DCCL.
 
 legacyccl
 DCCL Implementation of the REMUS CCL Language Library namespace.
 
 native_protobuf
 Implements the default Google Protocol Buffers encoder for a variety of numeric types.
 
 test
 Unit test namespace.
 
 tool
 'dccl' command line tool namespace
 
 v2
 Goby/DCCL version 2 default field codecs.
 
 v3
 DCCL version 3 default field codecs.
 
 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)
 
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. More...
 
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. More...
 
int oneof_size (const google::protobuf::OneofDescriptor *oneof_desc)
 Returns the number of bits needed to represent the oneof cases (including the unset case). More...
 

Variables

DCCLFieldOptionsDefaultTypeInternal _DCCLFieldOptions_default_instance_
 
DCCLFieldOptions_ConditionsDefaultTypeInternal _DCCLFieldOptions_Conditions_default_instance_
 
DCCLFieldOptions_UnitsDefaultTypeInternal _DCCLFieldOptions_Units_default_instance_
 
DCCLMessageOptionsDefaultTypeInternal _DCCLMessageOptions_default_instance_
 
extern ::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::FieldOptions, ::google::protobuf::internal::MessageTypeTraits< ::dccl::DCCLFieldOptions >, 11, false > field
 
extern ::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions, ::google::protobuf::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.

Function Documentation

◆ ceil_log2()

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

Definition at line 178 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.

◆ hex_decode()

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/2]

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() [2/2]

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_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.

◆ 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.