Goby3  3.1.5a
2024.05.23
goby::moos::transitional Namespace Reference

Classes

class  DCCLAlgorithmPerformer
 
class  DCCLMessage
 
class  DCCLMessageVal
 defines a DCCL value More...
 
class  DCCLMessageVar
 
class  DCCLPublish
 

Typedefs

using AlgFunction1 = boost::function< void(DCCLMessageVal &)>
 boost::function for a function taking a single DCCLMessageVal reference. Used for algorithm callbacks. More...
 
using AlgFunction2 = boost::function< void(DCCLMessageVal &, const std::vector< DCCLMessageVal > &)>
 boost::function for a function taking a dccl::MessageVal reference, and the MessageVal of a second part of the message. Used for algorithm callbacks. More...
 

Enumerations

enum  DCCLType {
  dccl_static, dccl_bool, dccl_int, dccl_float,
  dccl_enum, dccl_string, dccl_hex
}
 Enumeration of DCCL types used for sending messages. dccl_enum and dccl_string primarily map to cpp_string, dccl_bool to cpp_bool, dccl_int to cpp_long, dccl_float to cpp_double. More...
 
enum  DCCLCppType {
  cpp_notype, cpp_bool, cpp_string, cpp_long,
  cpp_double
}
 Enumeration of C++ types used in DCCL. More...
 
enum  { POWER2_BITS_IN_BYTE = 3 }
 
enum  { POWER2_NIBS_IN_BYTE = 1 }
 
enum  DCCLHeaderPart {
  HEAD_CCL_ID = 0, HEAD_DCCL_ID = 1, HEAD_TIME = 2, HEAD_SRC_ID = 3,
  HEAD_DEST_ID = 4, HEAD_MULTIMESSAGE_FLAG = 5, HEAD_BROADCAST_FLAG = 6, HEAD_UNUSED = 7
}
 
enum  DCCLHeaderBits {
  HEAD_CCL_ID_SIZE = 8, HEAD_DCCL_ID_SIZE = 9, HEAD_TIME_SIZE = 17, HEAD_SRC_ID_SIZE = 5,
  HEAD_DEST_ID_SIZE = 5, HEAD_FLAG_SIZE = 1, HEAD_UNUSED_SIZE = 2
}
 

Functions

unsigned bits2bytes (unsigned bits)
 
unsigned bytes2bits (unsigned bytes)
 
unsigned bytes2nibs (unsigned bytes)
 
unsigned nibs2bytes (unsigned nibs)
 
std::string type_to_string (DCCLType type)
 
std::string type_to_protobuf_type (DCCLType type)
 
std::string type_to_string (DCCLCppType type)
 
std::string to_str (DCCLHeaderPart p)
 
std::ostream & operator<< (std::ostream &os, const DCCLMessageVal &mv)
 
std::ostream & operator<< (std::ostream &os, const std::vector< DCCLMessageVal > &vm)
 

Variables

const unsigned DCCL_NUM_HEADER_BYTES = 6
 
const unsigned DCCL_NUM_HEADER_PARTS = 8
 
const std::string DCCL_HEADER_NAMES []
 

Typedef Documentation

◆ AlgFunction1

using goby::moos::transitional::AlgFunction1 = typedef boost::function<void(DCCLMessageVal&)>

boost::function for a function taking a single DCCLMessageVal reference. Used for algorithm callbacks.

Think of this as a generalized version of a function pointer (void (*)(DCCLMessageVal&)). See http://www.boost.org/doc/libs/1_34_0/doc/html/function.html for more on boost:function.

Definition at line 47 of file message_algorithms.h.

◆ AlgFunction2

using goby::moos::transitional::AlgFunction2 = typedef boost::function<void(DCCLMessageVal&, const std::vector<DCCLMessageVal>&)>

boost::function for a function taking a dccl::MessageVal reference, and the MessageVal of a second part of the message. Used for algorithm callbacks.

Think of this as a generalized version of a function pointer (void (*)(DCCLMessageVal&, const DCCLMessageVal&). See http://www.boost.org/doc/libs/1_34_0/doc/html/function.html for more on boost:function.

Definition at line 51 of file message_algorithms.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
POWER2_BITS_IN_BYTE 

Definition at line 69 of file dccl_constants.h.

◆ anonymous enum

anonymous enum
Enumerator
POWER2_NIBS_IN_BYTE 

Definition at line 77 of file dccl_constants.h.

◆ DCCLCppType

Enumeration of C++ types used in DCCL.

Enumerator
cpp_notype 

not one of the C++ types used in DCCL

cpp_bool 

C++ bool

cpp_string 

C++ std::string

cpp_long 

C++ long

cpp_double 

C++ double

Definition at line 59 of file dccl_constants.h.

◆ DCCLHeaderBits

Enumerator
HEAD_CCL_ID_SIZE 
HEAD_DCCL_ID_SIZE 
HEAD_TIME_SIZE 
HEAD_SRC_ID_SIZE 
HEAD_DEST_ID_SIZE 
HEAD_FLAG_SIZE 
HEAD_UNUSED_SIZE 

Definition at line 151 of file dccl_constants.h.

◆ DCCLHeaderPart

Enumerator
HEAD_CCL_ID 
HEAD_DCCL_ID 
HEAD_TIME 
HEAD_SRC_ID 
HEAD_DEST_ID 
HEAD_MULTIMESSAGE_FLAG 
HEAD_BROADCAST_FLAG 
HEAD_UNUSED 

Definition at line 133 of file dccl_constants.h.

◆ DCCLType

Enumeration of DCCL types used for sending messages. dccl_enum and dccl_string primarily map to cpp_string, dccl_bool to cpp_bool, dccl_int to cpp_long, dccl_float to cpp_double.

Enumerator
dccl_static 
dccl_bool 
dccl_int 
dccl_float 
dccl_enum 
dccl_string 
dccl_hex 

Definition at line 48 of file dccl_constants.h.

Function Documentation

◆ binary_string2hex_string()

std::string goby::moos::transitional::binary_string2hex_string ( const std::string &  bs)
inline

converts a binary string ("1000101010101010") into a hex string ("8AAA")

Definition at line 209 of file dccl_constants.h.

◆ bits2bytes()

unsigned goby::moos::transitional::bits2bytes ( unsigned  bits)
inline

Definition at line 73 of file dccl_constants.h.

◆ bytes2bits()

unsigned goby::moos::transitional::bytes2bits ( unsigned  bytes)
inline

Definition at line 74 of file dccl_constants.h.

◆ bytes2nibs()

unsigned goby::moos::transitional::bytes2nibs ( unsigned  bytes)
inline

Definition at line 81 of file dccl_constants.h.

◆ char_array2hex_string()

bool goby::moos::transitional::char_array2hex_string ( const unsigned char c,
std::string &  s,
const unsigned int  n 
)
inline

converts a char (byte) array into a hex string

Parameters
cpointer to array of char
sreference to string to put char into as hex
nlength of c the first two hex chars in s are the 0 index in c

Definition at line 171 of file dccl_constants.h.

◆ hex_string2binary_string()

std::string goby::moos::transitional::hex_string2binary_string ( const std::string &  bs)
inline

converts a hex string ("8AAA") into a binary string ("1000101010101010")

only works on whole byte string (even number of nibbles)

Definition at line 229 of file dccl_constants.h.

◆ hex_string2char_array()

bool goby::moos::transitional::hex_string2char_array ( unsigned char c,
const std::string &  s,
const unsigned int  n 
)
inline

turns a string of hex chars ABCDEF into a character array reading each byte 0xAB,0xCD, 0xEF, etc.

Definition at line 182 of file dccl_constants.h.

◆ hex_string2number()

template<typename T >
bool goby::moos::transitional::hex_string2number ( const std::string &  s,
T &  t 
)

attempts to convert a hex string into a numerical representation (of type T)

Returns
true if conversion succeeds, false otherwise

Definition at line 246 of file dccl_constants.h.

◆ long2binary_string()

std::string goby::moos::transitional::long2binary_string ( unsigned long  l,
unsigned short  bits 
)
inline

return a string represented the binary value of l for bits number of bits which reads MSB -> LSB

Definition at line 196 of file dccl_constants.h.

◆ nibs2bytes()

unsigned goby::moos::transitional::nibs2bytes ( unsigned  nibs)
inline

Definition at line 82 of file dccl_constants.h.

◆ number2hex_string() [1/2]

template<typename T >
std::string goby::moos::transitional::number2hex_string ( const T &  t,
unsigned int  width = 2 
)

converts a decimal number of type T into a hex string assuming success

Parameters
tdecimal number to convert
widthdesired width (in characters) of return string. Width should be twice the number of bytes
Returns
hex string

Definition at line 273 of file dccl_constants.h.

◆ number2hex_string() [2/2]

template<typename T >
bool goby::moos::transitional::number2hex_string ( std::string &  s,
const T &  t,
unsigned int  width = 2 
)

converts a decimal number of type T into a hex string

Parameters
sstring reference to store result in
tdecimal number to convert
widthdesired width (in characters) of return string. Width should be twice the number of bytes
Returns
true if successful, false otherwise

Definition at line 260 of file dccl_constants.h.

◆ operator<<() [1/2]

std::ostream& goby::moos::transitional::operator<< ( std::ostream &  os,
const DCCLMessageVal mv 
)

◆ operator<<() [2/2]

std::ostream& goby::moos::transitional::operator<< ( std::ostream &  os,
const std::vector< DCCLMessageVal > &  vm 
)

◆ to_str()

std::string goby::moos::transitional::to_str ( DCCLHeaderPart  p)
inline

Definition at line 149 of file dccl_constants.h.

◆ type_to_protobuf_type()

std::string goby::moos::transitional::type_to_protobuf_type ( DCCLType  type)
inline

Definition at line 99 of file dccl_constants.h.

◆ type_to_string() [1/2]

std::string goby::moos::transitional::type_to_string ( DCCLCppType  type)
inline

Definition at line 116 of file dccl_constants.h.

◆ type_to_string() [2/2]

std::string goby::moos::transitional::type_to_string ( DCCLType  type)
inline

Definition at line 84 of file dccl_constants.h.

Variable Documentation

◆ DCCL_HEADER_NAMES

const std::string goby::moos::transitional::DCCL_HEADER_NAMES[]
Initial value:
= {
"_ccl_id", "_id", "_time", "_src_id", "_dest_id", "_multimessage_flag",
"_broadcast_flag", "_unused",
}

Definition at line 145 of file dccl_constants.h.

◆ DCCL_NUM_HEADER_BYTES

const unsigned goby::moos::transitional::DCCL_NUM_HEADER_BYTES = 6

Definition at line 129 of file dccl_constants.h.

◆ DCCL_NUM_HEADER_PARTS

const unsigned goby::moos::transitional::DCCL_NUM_HEADER_PARTS = 8

Definition at line 131 of file dccl_constants.h.