33 #include <boost/shared_ptr.hpp>
34 #include <boost/enable_shared_from_this.hpp>
35 #include <boost/thread/mutex.hpp>
37 #include <rsc/runtime/TypeStringTools.h>
38 #include <rsc/logging/Logger.h>
39 #include <rsc/threading/Future.h>
45 #include "rsb/rsbexports.h"
60 public boost::enable_shared_from_this<RemoteServer> {
73 return this->target->isDone();
76 boost::shared_ptr<O>
get(
double timeout) {
77 return boost::static_pointer_cast<O>(this->target->get(timeout)->getData());
92 const std::string& name,
98 virtual std::string getKind()
const;
129 virtual std::string getKind()
const;
141 request->setType(rsc::runtime::typeName<I>());
142 request->setData(args);
158 FuturePtr callAsync(
const std::string& methodName,
EventPtr data);
174 template <
typename O,
typename I>
176 boost::shared_ptr<I> args) {
177 return DataFuture<O>(callAsync(methodName, prepareRequestEvent(args)));
191 template <
typename O>
194 request->setType(rsc::runtime::typeName<void>());
219 EventPtr call(
const std::string& methodName,
221 unsigned int maxReplyWaitTime = 25);
244 template <
typename O,
typename I>
245 boost::shared_ptr<O>
call(
const std::string& methodName,
246 boost::shared_ptr<I> args,
247 unsigned int maxReplyWaitTime = 25) {
248 return callAsync<O>(methodName, args).
get(maxReplyWaitTime);
269 template <
typename O>
270 boost::shared_ptr<O>
call(
const std::string& methodName,
271 unsigned int maxReplyWaitTime = 25) {
272 return callAsync<O>(methodName).
get(maxReplyWaitTime);
282 std::map<std::string, RemoteMethodPtr>
methods;
296 return this->
target->isDone();
299 boost::shared_ptr<void>
get(
double timeout) {
300 this->
target->get(timeout)->getData();
301 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.