11 #ifndef _LIBALCOMMON_ALCOMMON_ALMETHODINFO_H_
12 #define _LIBALCOMMON_ALCOMMON_ALMETHODINFO_H_
15 # include <boost/shared_ptr.hpp>
18 # define BLOCKINGFUNCTION 0
19 # define ASYNCHRONOUSFUNCTION 1
50 AsynchronousMethod = 2,
80 m_defaultValue = defaultValue;
111 return ((mask & CPPMethod) == CPPMethod);
119 return (mask & AsynchronousMethod) > 0 ?
true:
false;
127 return ((mask & localMethod) == localMethod);
134 void addOption(
int pOption)
136 mask = mask | (short)pOption;
144 return ptrOnMethod.get();
156 template <
typename C,
typename R>
157 void completeAndCheck(R(C::*) (), ALMethodInfo & pDesc)
159 pDesc.returnInfo.strType = getParamStrType<R>();
162 template <
typename C,
typename P1,
typename R>
163 void completeAndCheck(R(C::*) (P1), ALMethodInfo & pDesc)
165 pDesc.returnInfo.strType = getParamStrType<R>();
166 ALMethodInfo::ALParameterInfo param;
167 param.description =
"arg";
168 std::string name =
"arg0";
169 for (
int i = pDesc.parameters.size(); i < 1; ++i) {
170 name[3] = (char) (i +
'1');
172 pDesc.parameters.push_back(param);
174 pDesc.parameters[0].strType = getParamStrType<P1>();
177 template <
typename C,
typename P1,
typename P2,
typename R>
178 void completeAndCheck(R(C::*) (P1, P2), ALMethodInfo & pDesc)
180 pDesc.returnInfo.strType = getParamStrType<R>();
181 ALMethodInfo::ALParameterInfo param;
182 std::string name =
"arg0";
183 param.description =
"arg";
184 for (
int i = pDesc.parameters.size() ; i < 2; ++i) {
185 name[3] = (char) (i +
'1');
187 pDesc.parameters.push_back(param);
189 pDesc.parameters[0].strType = getParamStrType<P1>();
190 pDesc.parameters[1].strType = getParamStrType<P2>();
193 template <
typename C,
typename P1,
typename P2,
typename P3,
typename R>
194 void completeAndCheck(R(C::*) (P1, P2, P3), ALMethodInfo & pDesc)
196 pDesc.returnInfo.strType = getParamStrType<R>();
197 ALMethodInfo::ALParameterInfo param;
198 std::string name =
"arg0";
199 param.description =
"arg";
200 for (
int i = pDesc.parameters.size(); i < 3; ++i) {
203 pDesc.parameters.push_back(param);
205 pDesc.parameters[0].strType = getParamStrType<P1>();
206 pDesc.parameters[1].strType = getParamStrType<P2>();
207 pDesc.parameters[2].strType = getParamStrType<P3>();
210 template <
typename C,
typename P1,
typename P2,
typename P3,
typename P4,
typename R>
211 void completeAndCheck(R(C::*) (P1, P2, P3, P4), ALMethodInfo & pDesc)
213 pDesc.returnInfo.strType = getParamStrType<R>();
214 ALMethodInfo::ALParameterInfo param;
215 std::string name =
"arg0";
216 param.description =
"arg";
217 for (
int i = pDesc.parameters.size(); i < 4; ++i) {
220 pDesc.parameters.push_back(param);
222 pDesc.parameters[0].strType = getParamStrType<P1>();
223 pDesc.parameters[1].strType = getParamStrType<P2>();
224 pDesc.parameters[2].strType = getParamStrType<P3>();
225 pDesc.parameters[3].strType = getParamStrType<P4>();
228 template <
typename C,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename R>
229 void completeAndCheck(R(C::*) (P1, P2, P3, P4, P5), ALMethodInfo & pDesc)
231 pDesc.returnInfo.strType = getParamStrType<R>();
232 ALMethodInfo::ALParameterInfo param;
233 std::string name =
"arg0";
234 param.description =
"arg";
235 for (
int i = pDesc.parameters.size(); i < 5; ++i) {
238 pDesc.parameters.push_back(param);
240 pDesc.parameters[0].strType = getParamStrType<P1>();
241 pDesc.parameters[1].strType = getParamStrType<P2>();
242 pDesc.parameters[2].strType = getParamStrType<P3>();
243 pDesc.parameters[3].strType = getParamStrType<P4>();
244 pDesc.parameters[4].strType = getParamStrType<P5>();
247 template <
typename C,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6,
typename R>
248 void completeAndCheck(R(C::*) (P1, P2, P3, P4, P5, P6), ALMethodInfo & pDesc)
250 pDesc.returnInfo.strType = getParamStrType<R>();
251 ALMethodInfo::ALParameterInfo param;
252 std::string name =
"arg0";
253 param.description =
"arg";
254 for (
int i = pDesc.parameters.size(); i < 6; ++i) {
257 pDesc.parameters.push_back(param);
259 pDesc.parameters[0].strType = getParamStrType<P1>();
260 pDesc.parameters[1].strType = getParamStrType<P2>();
261 pDesc.parameters[2].strType = getParamStrType<P3>();
262 pDesc.parameters[3].strType = getParamStrType<P4>();
263 pDesc.parameters[4].strType = getParamStrType<P5>();
264 pDesc.parameters[5].strType = getParamStrType<P6>();
268 #endif // _LIBALCOMMON_ALCOMMON_ALMETHODINFO_H_