26#include "../../codec.h"
30int main(
int argc,
char* argv[])
33 for (
int i = 1; i < argc; ++i)
35 if (argv[i] && argv[i][0] ==
'-' && argv[i][1] ==
'v' && argv[i][2] ==
'\0')
39 dccl::dlog.
connect(verbose ? dccl::logger::ALL :
dccl::logger::WARN_PLUS, &std::cerr);
43 codec.load<BytesMsg>();
44 codec.info<BytesMsg>(&dccl::dlog);
54 codec.encode(&encoded, msg_in);
56 assert(encoded.size() == 36);
59 codec.decode(encoded, &msg_out);
61 assert(msg_in.SerializeAsString() == msg_out.SerializeAsString());
63 dccl::dlog.
is(dccl::logger::INFO) && dccl::dlog <<
"all tests passed" << std::endl;
The Dynamic CCL enCODer/DECoder. This is the main class you will use to load, encode and decode DCCL ...
bool is(logger::Verbosity verbosity, logger::Group group=logger::GENERAL)
Indicates the verbosity of the Logger until the next std::flush or std::endl. The boolean return is u...
void connect(int verbosity_mask, Slot slot)
Connect the output of one or more given verbosities to a slot (function pointer or similar)
Dynamic Compact Control Language namespace.
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 w...