Yet Another Robot Platform
Short readable codes. More...
|static NetInt32||encode (const ConstString &str)|
|Convert a string into a vocabulary identifier. More...|
|static ConstString||decode (NetInt32 code)|
|Convert a vocabulary identifier into a string. More...|
Short readable codes.
They are integers, for efficient switching, but have a readable (and writable) string representation. Codes are limited to 4 characters long (to fit in a standard network integer, NetInt32). This is a compromise to allow the creation of messages that can be parsed very efficiently by machine but nevertheless are human readable and writable. When switching on a Vocab code, we suggest you use the VOCABn macro defined in yarp/os/Vocab.h.
Your program will be efficient, and the codes used if they traverse the network will be human readable/writable.
Convert a string into a vocabulary identifier.
If the string is longer than four characters, only the first four characters are used.
|str||the string to convert|