34 #include <boost/shared_ptr.hpp> 35 #include <boost/enable_shared_from_this.hpp> 36 #include <boost/thread/mutex.hpp> 38 #include <rsc/runtime/TypeStringTools.h> 39 #include <rsc/logging/Logger.h> 40 #include <rsc/threading/Future.h> 46 #include "rsb/rsbexports.h" 61 public boost::enable_shared_from_this<RemoteServer> {
74 return this->target->isDone();
77 boost::shared_ptr<O>
get(
double timeout) {
78 return boost::static_pointer_cast<O>(this->target->get(timeout)->getData());
93 const std::string& name,
99 virtual std::string getKind()
const;
101 FuturePtr call(
const std::string& methodName,
EventPtr request);
130 virtual std::string getKind()
const;
133 virtual const std::set<std::string> getTransportURLs()
const;
145 request->setType(rsc::runtime::typeName<I>());
146 request->setData(args);
162 FuturePtr callAsync(
const std::string& methodName,
EventPtr data);
178 template <
typename O,
typename I>
180 boost::shared_ptr<I> args) {
181 return DataFuture<O>(callAsync(methodName, prepareRequestEvent(args)));
195 template <
typename O>
198 request->setType(rsc::runtime::typeName<void>());
223 EventPtr call(
const std::string& methodName,
225 unsigned int maxReplyWaitTime = 25);
248 template <
typename O,
typename I>
249 boost::shared_ptr<O>
call(
const std::string& methodName,
250 boost::shared_ptr<I> args,
251 unsigned int maxReplyWaitTime = 25) {
252 return callAsync<O>(methodName, args).
get(maxReplyWaitTime);
273 template <
typename O>
274 boost::shared_ptr<O>
call(
const std::string& methodName,
275 unsigned int maxReplyWaitTime = 25) {
276 return callAsync<O>(methodName).
get(maxReplyWaitTime);
286 std::map<std::string, RemoteMethodPtr>
methods;
288 RemoteMethodPtr getMethod(
const std::string& name);
300 return this->target->isDone();
303 boost::shared_ptr<void>
get(
double timeout) {
304 this->target->get(timeout)->getData();
305 return boost::shared_ptr<void>();
boost::shared_ptr< void > VoidPtr
ParticipantConfig listenerConfig
A derived Method class which can be used to invoke methods on a remote LocalServer object...
EventPtr prepareRequestEvent(boost::shared_ptr< I > args)
Prepares an Event which can be used for a request based on typed data.
std::map< std::string, RemoteMethodPtr > methods
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...
boost::shared_ptr< RemoteMethod > RemoteMethodPtr
std::map< EventId, FuturePtr > inprogress
Basic message that is exchanged between informers and listeners.
Objects of this class participate in the exchange of notifications on one channel of the bus...
rsc::logging::LoggerPtr logger
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...
MutexType inprogressMutex
Base class for method classes.
boost::mutex methodsMutex
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.