11 #ifndef _LIBALCOMMON_ALCOMMON_ALPROXY_H_
12 #define _LIBALCOMMON_ALCOMMON_ALPROXY_H_
18 # include <alerror/alerror.h>
20 # include <boost/shared_ptr.hpp>
21 # include <boost/smart_ptr/enable_shared_from_this.hpp>
22 # include <qi/anyobject.hpp>
25 # pragma warning(disable:4996)
26 # pragma warning(disable:4800)
78 typedef boost::shared_ptr<ALProxy>
Ptr;
86 typedef int (*onFinishedCallback)(
const char*, int,
const AL::ALValue &);
92 boost::shared_ptr<ALProxy> getThis();
97 boost::shared_ptr<const ALProxy> getThis()
const;
123 ALProxy(boost::shared_ptr<ALBroker> pBroker,
124 const std::string &pModuleName,
134 ALProxy(qi::AnyObject pObject,
const std::string &pModuleName);
144 ALProxy(
const std::string &pModuleName,
145 const std::string &pIp,
159 ALProxy(
const std::string &pModuleName,
160 const std::string &pIp,
162 boost::shared_ptr<ALBroker> pBroker,
174 std::string remoteBrokerName();
187 AL::ALValue genericCall(
const std::string &strMethodName,
208 int genericPCall(
const std::string &strMethodName,
210 onFinishedCallback pCallbackToCallOnFinished = NULL,
211 const char *pszCallerName = NULL);
217 std::string version();
223 boost::shared_ptr<ALModule> getModule()
const;
228 boost::shared_ptr<ALModuleCore> getModuleCore()
const;
257 boost::shared_ptr<ALFunctorBase> getFunctor(
const std::string &pName,
258 const std::vector<std::string> &pParamTypes);
264 boost::shared_ptr<ALBroker> getParentBroker(
void)
const;
269 void destroyConnection(
void);
271 template <
typename R>
272 R call(
const std::string &pName);
274 template <
typename R,
typename P1>
275 R call(
const std::string &pName,
const P1 &p1);
277 template <
typename R,
typename P1,
typename P2>
278 R call(
const std::string &pName,
const P1 &p1,
const P2 &p2);
280 template <
typename R,
typename P1,
typename P2,
typename P3>
281 R call(
const std::string &pName,
const P1 &p1,
const P2 &p2,
const P3 &p3);
283 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4>
284 R call(
const std::string &pName,
const P1 &p1,
const P2 &p2,
const P3 &p3,
const P4 &p4);
286 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5>
287 R call(
const std::string &pName,
const P1 &p1,
const P2 &p2,
const P3 &p3,
const P4 &p4,
const P5 &p5);
289 template <
typename R,
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6>
290 R call(
const std::string &pName,
const P1 &p1,
const P2 &p2,
const P3 &p3,
const P4 &p4,
const P5 &p5,
const P6 &p6);
292 inline void callVoid(
const std::string &pName);
294 template <
typename P1>
295 void callVoid(
const std::string &pName,
const P1 &p1);
297 template <
typename P1,
typename P2>
298 void callVoid(
const std::string &pName,
const P1 &p1,
const P2 &p2);
300 template <
typename P1,
typename P2,
typename P3>
301 void callVoid(
const std::string &pName,
const P1 &p1,
const P2 &p2,
const P3 &p3);
303 template <
typename P1,
typename P2,
typename P3,
typename P4>
304 void callVoid(
const std::string &pName,
const P1 &p1,
const P2 &p2,
const P3 &p3,
const P4 &p4);
306 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5>
307 void callVoid(
const std::string &pName,
const P1 &p1,
const P2 &p2,
const P3 &p3,
const P4 &p4,
const P5 &p5);
309 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6>
310 void callVoid(
const std::string &pName,
const P1 &p1,
const P2 &p2,
const P3 &p3,
const P4 &p4,
const P5 &p5,
const P6 &p6);
312 inline int pCall(
const std::string &pName);
314 template <
typename P1>
315 int pCall(
const std::string &pName,
const P1 &p1);
317 template <
typename P1,
typename P2>
318 int pCall(
const std::string &pName,
const P1 &p1,
const P2 &p2);
320 template <
typename P1,
typename P2,
typename P3>
321 int pCall(
const std::string &pName,
const P1 &p1,
const P2 &p2,
const P3 &p3);
323 template <
typename P1,
typename P2,
typename P3,
typename P4>
324 int pCall(
const std::string &pName,
const P1 &p1,
const P2 &p2,
const P3 &p3,
const P4 &p4);
326 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5>
327 int pCall(
const std::string &pName,
const P1 &p1,
const P2 &p2,
const P3 &p3,
const P4 &p4,
const P5 &p5);
329 template <
typename P1,
typename P2,
typename P3,
typename P4,
typename P5,
typename P6>
330 int pCall(
const std::string &pName,
const P1 &p1,
const P2 &p2,
const P3 &p3,
const P4 &p4,
const P5 &p5,
const P6 &p6);
342 bool wait(
const int &
id,
const int &timeoutPeriod);
350 qi::FutureSync<void> wait(
const int &
id);
357 void stop(
const int &
id);
365 bool isRunning(
const int &
id);
373 int pCallNotify(
const std::string &name,
374 const std::string &key,
376 const ALValue &message = std::string(),
377 std::pair<int, int>* cache = 0);
379 std::string moduleName()
const;
384 qi::AnyObject asObject();
387 qi::AnyWeakObject _object;
389 int xMetaPCall(
const std::string &signature,
const qi::GenericFunctionParameters &in);
400 #endif // _LIBALCOMMON_ALCOMMON_ALPROXY_H_
boost::shared_ptr< ALProxy > Ptr
Shared pointer to ALProxy.
ALProxy is a client to the served methods of a module.
ALModuleInfo is the class of information about user modules.
ALModuleCore is the superclass of user modules.
boost::weak_ptr< ALProxy > WeakPtr
Weak pointer to ALProxy.
pProxyOption
Different options for the ALProxy.
boost::shared_ptr< ALProxy > ALProxyPtr