- Aldebaran documentation |
- C++ Libraries |
- index

libalcommon 2.8.7.4

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
almethodinfo.h
Go to the documentation of this file.
1
10 #pragma once
11 #ifndef _LIBALCOMMON_ALCOMMON_ALMETHODINFO_H_
12 #define _LIBALCOMMON_ALCOMMON_ALMETHODINFO_H_
13
14 # include <alcommon/api.h>
15 # include <boost/shared_ptr.hpp>
16
17
18 # define BLOCKINGFUNCTION 0
19 # define ASYNCHRONOUSFUNCTION 1
21 namespace AL
22 {
23 class ALFunctorBase;
24
33 class ALCOMMON_API ALMethodInfo
34 {
35 public:
37 ALMethodInfo() {
38 mask = 0;
39 }
40
42 virtual ~ALMethodInfo() {}
43
48 enum methodOption {
49 CPPMethod = 1,
50 AsynchronousMethod = 2,
51 localMethod = 4
52 };
53
58 class ALParameterInfo
59 {
60 public:
61 std::string paramError;
62 std::string name;
63 std::string description;
64 std::string strType;
65 bool optional;
66 };
67
72 template <typename T>
73 class ALParameterInfoOptional: public ALParameterInfo {
74 public:
79 ALParameterInfoOptional(T defaultValue) {
80 m_defaultValue = defaultValue;
81 }
82 T m_defaultValue;
83 };
84
89 class ALExample {
90 public:
91 std::string language;
92 std::string strExample;
93 };
94
95 std::string moduleName;
96 std::string methodName;
97 std::string methodDescription;
98 std::vector<ALParameterInfo> parameters;
99 std::string returnValue;
100 std::vector<ALExample> examples;
101 boost::shared_ptr<ALFunctorBase> ptrOnMethod;
102 ALParameterInfo returnInfo;
103 short mask;
110 bool isCpp(void) {
111 return ((mask & CPPMethod) == CPPMethod);
112 }
113
118 bool isAsynchronous(void) {
119 return (mask & AsynchronousMethod) > 0 ? true: false;
120 }
121
126 bool isLocalMethod(void) {
127 return ((mask & localMethod) == localMethod);
128 }
129
134 void addOption(int pOption)
135 {
136 mask = mask | (short)pOption;
137 }
138
143 ALFunctorBase* getFunction() {
144 return ptrOnMethod.get();
145 }
146
150 void clear(void) {
151 parameters.clear();
152 examples.clear();
153 }
154 };
155
156 template <typename C, typename R>
157 void completeAndCheck(R(C::*) (), ALMethodInfo & pDesc)
158 {
159 //useless
160 }
161
162 template <typename C, typename P1, typename R>
163 void completeAndCheck(R(C::*) (P1), ALMethodInfo & pDesc)
164 {
165 //useless
166 }
167
168 template <typename C, typename P1, typename P2, typename R>
169 void completeAndCheck(R(C::*) (P1, P2), ALMethodInfo & pDesc)
170 {
171 //useless
172 }
173
174 template <typename C, typename P1, typename P2, typename P3, typename R>
175 void completeAndCheck(R(C::*) (P1, P2, P3), ALMethodInfo & pDesc)
176 {
177 //useless
178 }
179
180 template <typename C, typename P1, typename P2, typename P3, typename P4, typename R>
181 void completeAndCheck(R(C::*) (P1, P2, P3, P4), ALMethodInfo & pDesc)
182 {
183 //useless
184 }
185
186 template <typename C, typename P1, typename P2, typename P3, typename P4, typename P5, typename R>
187 void completeAndCheck(R(C::*) (P1, P2, P3, P4, P5), ALMethodInfo & pDesc)
188 {
189 //useless
190 }
191
192 template <typename C, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename R>
193 void completeAndCheck(R(C::*) (P1, P2, P3, P4, P5, P6), ALMethodInfo & pDesc)
194 {
195 //useless
196 }
197
198 }
199 #endif // _LIBALCOMMON_ALCOMMON_ALMETHODINFO_H_
200
AL::ALMethodInfo::methodName
std::string methodName
Definition: almethodinfo.h:96
api.h
AL::ALMethodInfo::returnInfo
ALParameterInfo returnInfo
Definition: almethodinfo.h:102
AL::ALMethodInfo::ALParameterInfoOptional::ALParameterInfoOptional
ALParameterInfoOptional(T defaultValue)
Default contructor.
Definition: almethodinfo.h:79
AL::ALMethodInfo::ALParameterInfo
ALParameterInfo is the introspection container.
Definition: almethodinfo.h:58
AL::ALMethodInfo::ALParameterInfo::optional
bool optional
Definition: almethodinfo.h:65
AL::ALMethodInfo::ALParameterInfo::description
std::string description
Definition: almethodinfo.h:63
AL::ALMethodInfo::parameters
std::vector< ALParameterInfo > parameters
Definition: almethodinfo.h:98
AL::ALMethodInfo::~ALMethodInfo
virtual ~ALMethodInfo()
Default destructor.
Definition: almethodinfo.h:42
AL::ALMethodInfo::mask
short mask
Definition: almethodinfo.h:103
AL::ALMethodInfo::ALExample::strExample
std::string strExample
Definition: almethodinfo.h:92
AL::completeAndCheck
void completeAndCheck(R(C::*)(P1, P2, P3, P4, P5, P6), ALMethodInfo &pDesc)
Definition: almethodinfo.h:193
AL::ALMethodInfo::isLocalMethod
bool isLocalMethod(void)
Check is the method is a local one.
Definition: almethodinfo.h:126
AL::ALMethodInfo::getFunction
ALFunctorBase * getFunction()
Get a pointer to the method.
Definition: almethodinfo.h:143
AL::ALMethodInfo
ALMethodInfo is the introspection container.
Definition: almethodinfo.h:33
AL::ALMethodInfo::methodDescription
std::string methodDescription
Definition: almethodinfo.h:97
AL::ALMethodInfo::isAsynchronous
bool isAsynchronous(void)
Check is the method is used as asynchronous one.
Definition: almethodinfo.h:118
AL::ALMethodInfo::ALExample
ALExample is container for example.
Definition: almethodinfo.h:89
AL::ALMethodInfo::ALExample::language
std::string language
Definition: almethodinfo.h:91
AL::ALMethodInfo::clear
void clear(void)
Clear parameters and examples.
Definition: almethodinfo.h:150
AL::ALMethodInfo::isCpp
bool isCpp(void)
Check is the method is used for C++.
Definition: almethodinfo.h:110
AL::ALMethodInfo::ALParameterInfoOptional
ALParameterInfoOptional is the option container.
Definition: almethodinfo.h:73
AL::ALMethodInfo::moduleName
std::string moduleName
Definition: almethodinfo.h:95
AL::ALMethodInfo::examples
std::vector< ALExample > examples
Definition: almethodinfo.h:100
AL::ALMethodInfo::addOption
void addOption(int pOption)
Add method option.
Definition: almethodinfo.h:134
AL::ALMethodInfo::methodOption
methodOption
methodOption is differents option for the method.
Definition: almethodinfo.h:48
AL::ALMethodInfo::ALParameterInfo::strType
std::string strType
Definition: almethodinfo.h:64
AL::ALFunctorBase
ALFunctorBase is a generic functor class for pointer management.
Definition: alfunctor.h:35
AL::ALMethodInfo::ptrOnMethod
boost::shared_ptr< ALFunctorBase > ptrOnMethod
Definition: almethodinfo.h:101
AL::ALMethodInfo::ALMethodInfo
ALMethodInfo()
Default constructor.
Definition: almethodinfo.h:37
ALCOMMON_API
#define ALCOMMON_API
Definition: api.h:14
AL::ALMethodInfo::ALParameterInfoOptional::m_defaultValue
T m_defaultValue
Definition: almethodinfo.h:82
AL::ALMethodInfo::ALParameterInfo::name
std::string name
Definition: almethodinfo.h:62
AL::ALMethodInfo::ALParameterInfo::paramError
std::string paramError
Definition: almethodinfo.h:61
AL::ALMethodInfo::returnValue
std::string returnValue
Definition: almethodinfo.h:99