YARP  2.3.68+228-20170410.2+git7d0b2e0
Yet Another Robot Platform
Vocab.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006 RobotCub Consortium
3  * Authors: Paul Fitzpatrick
4  * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT
5  */
6 
7 
8 #ifndef YARP_OS_VOCAB_H
9 #define YARP_OS_VOCAB_H
10 
11 #include <yarp/os/NetInt32.h>
12 #include <yarp/os/ConstString.h>
13 
14 namespace yarp {
15  namespace os {
16  class Vocab;
17  }
18 }
19 
20 // We need a macro for efficient switching.
21 // Use as, for example, VOCAB('s','e','t')
22 #define VOCAB(a,b,c,d) ((((int)(d))<<24)+(((int)(c))<<16)+(((int)(b))<<8)+((int)(a)))
23 #define VOCAB4(a,b,c,d) VOCAB((a),(b),(c),(d))
24 #define VOCAB3(a,b,c) VOCAB((a),(b),(c),(0))
25 #define VOCAB2(a,b) VOCAB((a),(b),(0),(0))
26 #define VOCAB1(a) VOCAB((a),(0),(0),(0))
27 
52 class YARP_OS_API yarp::os::Vocab {
53 public:
61  static NetInt32 encode(const ConstString& str);
62 
68  static ConstString decode(NetInt32 code);
69 };
70 
71 #endif // YARP_OS_VOCAB_H
Short readable codes.
Definition: Vocab.h:52
The main, catch-all namespace for YARP.
A string with almost the same api as std::string.
Definition: ConstString.h:44