25#ifndef GOBY_MOOS_TRANSITIONAL_DCCL_CONSTANTS_H 
   26#define GOBY_MOOS_TRANSITIONAL_DCCL_CONSTANTS_H 
  111                "cannot directly map DCCLv1 XML type to Protobuf Type"));
 
 
  146    "_ccl_id",         
"_id",     
"_time", 
"_src_id", 
"_dest_id", 
"_multimessage_flag",
 
  147    "_broadcast_flag", 
"_unused",
 
 
  173    std::stringstream ss;
 
  174    for (
unsigned int i = 0; i < n; i++)
 
  175        ss << std::hex << std::setw(2) << std::setfill(
'0') << 
static_cast<unsigned int>(c[i]);
 
 
  184    for (
unsigned int i = 0; i < n; i++)
 
  186        std::stringstream ss;
 
  188        ss << s.substr(2 * i, 2);
 
  189        ss >> std::hex >> in;
 
  190        c[i] = 
static_cast<unsigned char>(in);
 
 
  198    std::string s(bits + 1, 
'\0');
 
  199    for (
unsigned int i = 0; i < bits; i++)
 
  201        s[bits - i - 1] = (l & 1) ? 
'1' : 
'0';
 
 
  212    auto bytes = (
unsigned int)(std::ceil(bs.length() / 8.0));
 
  213    std::vector<unsigned char> c(bytes, 0);
 
  215    for (
size_t i = 0; i < bytes; ++i)
 
  217        std::bitset<8> b(bs.substr(i * 8, 8));
 
  218        c[i] = (char)b.to_ulong();
 
 
  231    int bytes = bs.length() / 2;
 
  232    std::vector<unsigned char> c(bytes, 0);
 
  238    for (
size_t i = 0; i < (size_t)bytes; i++) hs += 
long2binary_string((
unsigned long)c[i], 8);
 
 
  248    std::stringstream ss;
 
 
  262    std::stringstream ss;
 
  263    ss << std::hex << std::setw(width) << std::setfill('0') << static_cast<unsigned int>(t);
 
 
dccl::Exception DCCLException
 
std::string hex_string2binary_string(const std::string &bs)
converts a hex string ("8AAA") into a binary string ("1000101010101010")
 
bool hex_string2number(const std::string &s, T &t)
attempts to convert a hex string into a numerical representation (of type T)
 
std::string to_str(DCCLHeaderPart p)
 
std::string type_to_string(DCCLType type)
 
std::string long2binary_string(unsigned long l, unsigned short bits)
return a string represented the binary value of l for bits number of bits which reads MSB -> LSB
 
unsigned bytes2nibs(unsigned bytes)
 
const unsigned DCCL_NUM_HEADER_BYTES
 
bool char_array2hex_string(const unsigned char *c, std::string &s, const unsigned int n)
converts a char (byte) array into a hex string
 
DCCLType
Enumeration of DCCL types used for sending messages. dccl_enum and dccl_string primarily map to cpp_s...
 
unsigned bytes2bits(unsigned bytes)
 
DCCLCppType
Enumeration of C++ types used in DCCL.
 
unsigned bits2bytes(unsigned bits)
 
std::string type_to_protobuf_type(DCCLType type)
 
bool number2hex_string(std::string &s, const T &t, unsigned int width=2)
converts a decimal number of type T into a hex string
 
unsigned nibs2bytes(unsigned nibs)
 
std::string binary_string2hex_string(const std::string &bs)
converts a binary string ("1000101010101010") into a hex string ("8AAA")
 
const std::string DCCL_HEADER_NAMES[]
 
bool hex_string2char_array(unsigned char *c, const std::string &s, const unsigned int n)
turns a string of hex chars ABCDEF into a character array reading each byte 0xAB,0xCD,...
 
const unsigned DCCL_NUM_HEADER_PARTS
 
The global namespace for the Goby project.