33 #include <boost/noncopyable.hpp>
34 #include <boost/thread/mutex.hpp>
36 #include <rsc/runtime/TypeStringTools.h>
37 #include <rsc/logging/Logger.h>
38 #include <rsc/threading/Future.h>
41 #include "../Exception.h"
42 #include "../Informer.h"
43 #include "../Listener.h"
44 #include "../ParticipantConfig.h"
46 #include "rsb/rsbexports.h"
51 class WaitingEventHandler;
75 return this->target->isDone();
78 boost::shared_ptr<O>
get(
double timeout) {
79 return boost::static_pointer_cast<O>(this->target->get(timeout)->getData());
106 request->setType(rsc::runtime::typeName<I>());
107 request->setData(args);
123 FuturePtr callAsync(
const std::string& methodName,
EventPtr data);
139 template <
typename O,
typename I>
141 boost::shared_ptr<I> args) {
142 return DataFuture<O>(callAsync(methodName, prepareRequestEvent(args)));
156 template <
typename O>
159 request->setType(rsc::runtime::typeName<void>());
184 EventPtr call(
const std::string& methodName,
186 unsigned int maxReplyWaitTime = 25);
209 template <
typename O,
typename I>
210 boost::shared_ptr<O>
call(
const std::string& methodName,
211 boost::shared_ptr<I> args,
212 unsigned int maxReplyWaitTime = 25) {
213 return callAsync<O>(methodName, args).
get(maxReplyWaitTime);
234 template <
typename O>
235 boost::shared_ptr<O>
call(
const std::string& methodName,
236 unsigned int maxReplyWaitTime = 25) {
237 return callAsync<O>(methodName).
get(maxReplyWaitTime);
250 boost::shared_ptr<WaitingEventHandler>
handler;
258 MethodSet getMethodSet(
const std::string& methodName,
259 const std::string& sendType);
271 return this->
target->isDone();
274 boost::shared_ptr<void>
get(
double timeout) {
275 this->
target->get(timeout)->getData();
276 return boost::shared_ptr<void>();
boost::shared_ptr< WaitingEventHandler > handler
boost::shared_ptr< void > VoidPtr
Informer< void >::Ptr requestInformer
ParticipantConfig listenerConfig
EventPtr prepareRequestEvent(boost::shared_ptr< I > args)
Prepares an Event which can be used for a request based on typed data.
boost::shared_ptr< O > call(const std::string &methodName, boost::shared_ptr< I > args, unsigned int maxReplyWaitTime=25)
Call the method named methodName on the remote server, passing it the argument object args and return...
Basic message that is exchanged between informers and listeners.
std::map< std::string, MethodSet > methodSets
boost::mutex methodSetMutex
ListenerPtr replyListener
DataFuture(FuturePtr target)
boost::shared_ptr< Listener > ListenerPtr
DataFuture< O > callAsync(const std::string &methodName)
Call the method named methodName on the remote server, without arguments and returning the value retu...
DataFuture(FuturePtr target)
boost::shared_ptr< O > call(const std::string &methodName, unsigned int maxReplyWaitTime=25)
Call the method named methodName on the remote server, without arguments and return the value returne...
ParticipantConfig informerConfig
A class describing the configuration of Participant instances.
boost::shared_ptr< RemoteServer > RemoteServerPtr
rsc::threading::Future< EventPtr > FutureType
rsc::logging::LoggerPtr logger
boost::shared_ptr< Event > EventPtr
boost::shared_ptr< FutureType > FuturePtr
Scope is a descriptor for a hierarchical channel of the unified bus.
DataFuture< O > callAsync(const std::string &methodName, boost::shared_ptr< I > args)
Call the method named methodName on the remote server, passing it the argument object args and return...
The client side of a request-reply-based communication channel.