CoreDX Data Distribution Service
The High Performance, Small Footprint DDS from Twin Oaks Computing, Inc
request_reply.hh
Go to the documentation of this file.
1 /*****************************************************************
2  *
3  * file: request_reply.hh
4  * desc:
5  *
6  *****************************************************************
7  *
8  * Copyright(C) 2014-2016 Twin Oaks Computing, Inc
9  * All rights reserved. Castle Rock, CO 80108
10  *
11  *****************************************************************
12  *
13  * This software has been provided pursuant to a License Agreement
14  * containing restrictions on its use. This software contains
15  * valuable trade secrets and proprietary information of
16  * Twin Oaks Computing, Inc and is protected by law. It may not be
17  * copied or distributed in any form or medium, disclosed to third
18  * parties, reverse engineered or used in any manner not provided
19  * for in said License Agreement except with the prior written
20  * authorization from Twin Oaks Computing, Inc.
21  *
22  *****************************************************************/
23 
24 #ifndef OMG_DDS_RPC_REQUEST_REPLY_HH
25 #define OMG_DDS_RPC_REQUEST_REPLY_HH
26 
27 #include <string> // platform-specific
28 #include <vector>
29 
30 #include "vendor_dependent.hh"
31 #include <dds/sample.hh>
32 
42 namespace DDS
43 {
47  namespace rpc
48  {
49 
50  class RequesterParams;
51  class ReplierParams;
52 
53  template <typename TReq, typename TRep>
54  class Requester;
55 
56  template <typename TReq, typename TRep>
57  class Replier;
58 
59  // -------------------------------------------------------------------
60  // Exception
61  // -------------------------------------------------------------------
62  class COREDX_RPC_CPP_CLASS_EXPORT Exception : public std::exception
63  {
64 
65  public:
66  Exception() : message_(NULL) { }
67  Exception(const char *msg) { message_ = toc_strdup(msg); }
68 
69  virtual ~Exception()
70 #if !defined(TOC_NO_EXCEPTIONS)
71  throw()
72 #endif
73  {
74  if (message_) toc_strfree(message_);
75  }
76  // virtual void raise() const = 0;
77 
78  char * message_;
79  };
80 
81  // -------------------------------------------------------------------
82  class COREDX_RPC_CPP_CLASS_EXPORT TimeoutException : public Exception
83  {
84  public:
85  TimeoutException() : Exception() { }
86  TimeoutException( const char * msg ) : Exception( msg ) { }
87  };
88 
89  // -------------------------------------------------------------------
90  // -------------------------------------------------------------------
95  class COREDX_RPC_CPP_CLASS_EXPORT ListenerBase
96  {
97  public:
98  virtual ~ListenerBase() {}
99  };
100 
101  // -------------------------------------------------------------------
102  // -------------------------------------------------------------------
113  template <class TReq, class TRep>
115  {
116  public:
121  virtual TRep * process_request(const Sample<TReq> &,
122  const DDS::SampleIdentity_t &) = 0;
123  virtual ~SimpleReplierListener() {}
124  };
125 
126  // -------------------------------------------------------------------
127  // -------------------------------------------------------------------
138  template <class TReq, class TRep>
140  {
141  public:
147  virtual void on_request_available(Replier<TReq, TRep> &) = 0;
148  virtual ~ReplierListener() {}
149  };
150 
151  // -------------------------------------------------------------------
152  // -------------------------------------------------------------------
162  template <class TRep>
164  {
165  public:
170  virtual void process_reply(const Sample<TRep> &,
171  const DDS::SampleIdentity_t &) = 0;
172  virtual ~SimpleRequesterListener() {}
173  };
174 
175  // -------------------------------------------------------------------
176  // -------------------------------------------------------------------
186  template <class TReq, class TRep>
188  {
189  public:
194  virtual void on_reply_available(Requester<TReq, TRep> &) = 0;
195  virtual ~RequesterListener() {}
196  };
197 
198  // -------------------------------------------------------------------
199  // RPCEntity
200  // -------------------------------------------------------------------
206  class COREDX_RPC_CPP_CLASS_EXPORT RPCEntity
207  {
208  public:
209  RPCEntity();
210 
215  bool operator == (const RPCEntity &);
221  void close();
227  bool is_null() const;
228 
229  protected:
230 
231  template <class Impl>
232  explicit RPCEntity(Impl impl);
233 
234  typedef DDS::rpc::rpc_entity_traits::RPCEntity * VendorDependent;
235  VendorDependent impl_;
236 
237  public:
238  VendorDependent get_impl() const;
239  };
240 
241  // -------------------------------------------------------------------
242  // ServiceProxy
243  // -------------------------------------------------------------------
244  // -------------------------------------------------------------------
253  // -------------------------------------------------------------------
254  class COREDX_RPC_CPP_CLASS_EXPORT ServiceProxy : public RPCEntity
255  {
256  protected:
257  // template <class Impl>
258  // explicit ServiceProxy(Impl impl);
259  ServiceProxy();
260 
261  public:
266  void bind(const std::string & instance_name) {
267  ((VendorDependent)this->impl_)->bind(instance_name.c_str());
268  }
273  void unbind();
278  bool is_bound() const;
283  std::string get_bound_instance_name() const {
284  const char * iname = ((VendorDependent)this->impl_)->get_bound_instance_name();
285  return std::string(iname?iname:"");
286  }
287 
293  std::vector<std::string> get_discoverd_service_instances() const { /* sic .. SPEC */
294  return this->get_discovered_service_instances();
295  }
300  std::vector<std::string> get_discovered_service_instances() const {
301  DDS::StringSeq * instances;
302  std::vector<std::string> retval;
303  instances = ((VendorDependent)this->impl_)->get_discovered_service_instances();
304  if ( instances )
305  {
306  for (unsigned int i = 0;i < instances->size(); i++)
307  {
308  if ( (*instances)[i] )
309  retval.push_back( std::string( (*instances)[i] ) );
310  }
311  }
312  return retval;
313  }
314 
319  uint32_t get_discovered_service_count() const;
320 
325  void wait_for_service();
331  ReturnCode_t wait_for_service(const DDS::Duration_t & maxWait);
332 
337  void wait_for_service(std::string instanceName) {
338  ((VendorDependent)this->impl_)->wait_for_service(instanceName.c_str());
339  }
340 
347  std::string instanceName) {
348  return ((VendorDependent)this->impl_)->wait_for_service(maxWait, instanceName.c_str());
349  }
350 
355  void wait_for_services(uint32_t count);
361  ReturnCode_t wait_for_services(const DDS::Duration_t & maxWait, uint32_t count);
362 
367  void wait_for_services(const std::vector<std::string> & instanceNames) {
368  DDS::StringSeq instances;
369  for (unsigned int i = 0; i < instanceNames.size(); i++)
370  instances.push_back((char*)instanceNames[i].c_str());
371  ((VendorDependent)this->impl_)->wait_for_services(&instances);
372  }
373 
380  const std::vector<std::string> & instanceNames) {
381  DDS::StringSeq instances;
382  for (unsigned int i = 0; i < instanceNames.size(); i++)
383  instances.push_back((char*)instanceNames[i].c_str());
384  return ((VendorDependent)this->impl_)->wait_for_services(maxWait, &instances);
385  }
386 
387 
388 #if defined(CDX_HAS_FUTURE) && 0 /* not implemented yet */
389  future<void> wait_for_service_async();
390  future<void> wait_for_service_async(std::string instanceName);
391  future<void> wait_for_services_async(uint32_t count);
392  future<void> wait_for_services_async(const std::vector<std::string> & instanceNames);
393 #endif
394 
395  // internal: link to the Requester's Listeners
396  virtual void listener_process_reply(const void * /*reply */,
397  const DDS::SampleIdentity_t & /* req_id */){}
398  virtual void listener_on_reply_available(ServiceProxy * /* sp */ ) {}
399 
400  protected:
401  typedef DDS::rpc::rpc_entity_traits::Requester * VendorDependent;
402  };
403 
404  // -------------------------------------------------------------------
405  // Requester
406  // -------------------------------------------------------------------
429  template <typename TReq, typename TRep>
430  class Requester : public ServiceProxy
431  {
432  public:
433 
434  typedef TReq RequestType;
435  typedef TRep ReplyType;
436  typedef typename DDS::dds_type_traits<TReq>::DataWriter RequestDataWriter;
437  typedef typename DDS::dds_type_traits<TRep>::DataReader ReplyDataReader;
438  typedef typename DDS::dds_type_traits<TRep>::LoanedSamplesType LoanedSamplesType;
439  typedef RequesterParams Params;
440  //typedef typename details::vendor_dependent<Requester<TReq, TRep> >::type VendorDependent;
441  typedef DDS::rpc::rpc_entity_traits::Requester * VendorDependent;
442 
448  Requester();
449 
453  explicit Requester(const RequesterParams& params);
454 
458  virtual ~Requester();
459 
464  void send_request(WriteSample<TReq> &request);
469  void send_request(WriteSampleRef<TReq> & wsref);
470 #if defined(CDX_HAS_FUTURE)
471  future<DDS::Sample<TRep> > send_request_async(const TReq &);
472 #endif
473 
474 #ifdef OMG_DDS_RPC_BASIC_PROFILE
475 
479  void send_request(TReq & request);
484  void send_request_oneway(TReq &);
485 #endif
486 
487 #ifdef OMG_DDS_RPC_ENHANCED_PROFILE
488  void send_request(const TReq & request);
489  void send_request_oneway(const TReq &);
490 #endif
491 
498  bool receive_reply(Sample<TRep>& reply,
499  const DDS::Duration_t & timeout);
506  bool receive_reply(SampleRef<TRep> reply,
507  const DDS::Duration_t & timeout);
515  bool receive_reply(Sample<TRep>& reply,
516  const DDS::SampleIdentity_t & relatedRequestId);
524  bool receive_reply(SampleRef<TRep> reply,
525  const DDS::SampleIdentity_t & relatedRequestId);
533  LoanedSamples<TRep> receive_replies(const DDS::Duration_t & max_wait);
541  LoanedSamples<TRep> receive_replies(uint32_t min_count,
542  uint32_t max_count,
543  const DDS::Duration_t & max_wait);
544 
551  bool wait_for_replies(uint32_t min_count,
552  const DDS::Duration_t & max_wait);
559  bool wait_for_replies(const DDS::Duration_t & max_wait);
569  bool wait_for_replies(uint32_t min_count,
570  const DDS::Duration_t & max_wait,
571  const DDS::SampleIdentity_t & related_request_id);
572 
579  bool take_reply(Sample<TRep>& reply);
586  bool take_reply(SampleRef<TRep> reply);
593  bool take_reply(Sample<TRep>& reply,
594  const DDS::SampleIdentity_t& related_request_id);
601  bool take_reply(SampleRef<TRep> reply,
602  const DDS::SampleIdentity_t& related_request_id);
603 
609  LoanedSamples<TRep> take_replies(uint32_t max_count);
615  LoanedSamples<TRep> take_replies(uint32_t max_count,
616  const DDS::SampleIdentity_t& related_request_id);
622  LoanedSamples<TRep> take_replies(const DDS::SampleIdentity_t& related_request_id);
623 
629  inline bool read_reply(Sample<TRep>& reply);
634  inline bool read_reply(SampleRef<TRep> reply);
639  inline bool read_reply(Sample<TRep>& reply,
640  const DDS::SampleIdentity_t& related_request_id);
645  inline bool read_reply(SampleRef<TRep> reply,
646  const DDS::SampleIdentity_t& related_request_id);
647 
653  LoanedSamples<TRep> read_replies(uint32_t max_count);
659  LoanedSamples<TRep> read_replies(uint32_t max_count,
660  const DDS::SampleIdentity_t& related_request_id);
666  LoanedSamples<TRep> read_replies(const DDS::SampleIdentity_t& related_request_id);
667 
675  bool receive_nondata_samples(bool enable);
680  RequesterParams get_requester_params() const;
685  RequestDataWriter get_request_datawriter() const;
690  ReplyDataReader get_reply_datareader() const;
691 
692  // internal: link to the Repliers's Listeners
693  VendorDependent get_impl();
694  virtual void listener_process_reply(const void * reply,
695  const DDS::SampleIdentity_t & req_id);
696  virtual void listener_on_reply_available(ServiceProxy * sp );
697 
698  protected:
699  RequesterListener<TReq,TRep> * req_listener;
700  SimpleRequesterListener<TRep> * simple_listener;
701 
702  private:
703  Requester (const Requester &); /* no esta */
704  Requester & operator = (const Requester &);
705  void swap(Requester & other);
706  };
707 
708  // -------------------------------------------------------------------
709  // -------------------------------------------------------------------
714  class COREDX_RPC_CPP_CLASS_EXPORT ReplierBase : public RPCEntity
715  {
716  protected:
717  // internal: link to the Repliers's Listeners
718  virtual void listener_process_request(const void * /* req */,
719  const DDS::SampleIdentity_t & /* req_id */) { }
720  virtual void listener_on_request_available(ReplierBase * /* replier */) { }
721 
722  ReplierBase() : RPCEntity() {}
723 
724  friend struct coredx::rpc::ReplierImpl;
725  };
726 
727  // -------------------------------------------------------------------
728  // Replier
729  // -------------------------------------------------------------------
742  template <typename TReq, typename TRep>
743  class Replier : public ReplierBase
744  {
745  public:
746 
747  typedef TReq RequestType;
748  typedef TRep ReplyType;
749  typedef typename DDS::dds_type_traits<TRep>::DataWriter ReplyDataWriter;
750  typedef typename DDS::dds_type_traits<TReq>::DataReader RequestDataReader;
751  typedef typename DDS::dds_type_traits<TReq>::LoanedSamplesType LoanedSamplesType;
752  typedef ReplierParams Params;
753 
754  typedef DDS::rpc::rpc_entity_traits::Replier * VendorDependent;
755 
761  Replier();
765  explicit Replier(const ReplierParams & params);
769  virtual ~Replier();
770 
771 
776  void send_reply(WriteSample<TRep> & reply,
777  const DDS::SampleIdentity_t& related_request_id);
782  void send_reply(WriteSampleRef<TRep> & reply,
783  const DDS::SampleIdentity_t& related_request_id);
784 
785 #ifdef OMG_DDS_RPC_BASIC_PROFILE
786 
790  void send_reply(TRep & reply,
791  const DDS::SampleIdentity_t& related_request_id);
792 #endif
793 
794 #ifdef OMG_DDS_RPC_ENHANCED_PROFILE
795  void send_reply(const TRep & reply,
796  const DDS::SampleIdentity_t& related_request_id);
797 #endif
798 
803  bool receive_request(Sample<TReq> & request,
804  const DDS::Duration_t & max_wait);
809  bool receive_request(SampleRef<TReq> request,
810  const DDS::Duration_t & max_wait);
811 
816  LoanedSamplesType receive_requests(const DDS::Duration_t & max_wait);
822  LoanedSamplesType receive_requests(uint32_t min_request_count,
823  uint32_t max_request_count,
824  const DDS::Duration_t& max_wait);
825 
830  bool wait_for_requests(const DDS::Duration_t & max_wait);
835  bool wait_for_requests(uint32_t min_count,
836  const DDS::Duration_t & max_wait);
837 
844  bool take_request(Sample<TReq> & request);
851  bool take_request(SampleRef<TReq> request);
857  LoanedSamplesType take_requests(int max_samples);
858 
865  bool read_request(Sample<TReq> & request);
872  bool read_request(SampleRef<TReq> request);
878  LoanedSamplesType read_requests(int max_samples);
879 
884  const ReplierParams & get_replier_params() const;
890  bool receive_nondata_samples(bool enable);
895  RequestDataReader get_request_datareader() const;
900  ReplyDataWriter get_reply_datawriter() const;
901 
902 
903  VendorDependent get_impl() const;
904  // internal link to listener
905  virtual void listener_process_request(const void * /* req */,
906  const DDS::SampleIdentity_t & /* req_id */);
907  virtual void listener_on_request_available(ReplierBase * /* replier */);
908  protected:
909  ReplierListener<TReq, TRep> * rep_listener;
910  SimpleReplierListener<TReq, TRep> * simple_listener;
911 
912  private:
913  /* not allowed .. */
914  Replier(const Replier &);
915  Replier & operator = (const Replier &);
916  void swap(Replier & other);
917  };
918 
919  // -------------------------------------------------------------------
920  // RequesterParams
921  // -------------------------------------------------------------------
930  class COREDX_RPC_CPP_CLASS_EXPORT RequesterParams
931  {
932  public:
936  RequesterParams ();
940  ~RequesterParams ();
944  RequesterParams(const RequesterParams & other);
948  RequesterParams & operator = (const RequesterParams & that);
949 
954  template <class TRep>
955  RequesterParams & simple_requester_listener(SimpleRequesterListener<TRep> *listener);
956 
961  template <class TReq, class TRep>
962  RequesterParams & requester_listener(RequesterListener<TReq, TRep> *listener);
963 
969  RequesterParams & domain_participant(dds_entity_traits::DomainParticipant participant);
975  RequesterParams & publisher(dds_entity_traits::Publisher publisher);
981  RequesterParams & subscriber(dds_entity_traits::Subscriber subscriber);
986  RequesterParams & datawriter_qos(dds_entity_traits::DataWriterQos qos);
991  RequesterParams & datareader_qos(dds_entity_traits::DataReaderQos qos);
1001  RequesterParams & service_name (const std::string &name) {
1002  toc_strfree( this->impl_->_service_name );
1003  this->impl_->_service_name = toc_strdup( name.c_str() );
1004  return *this;
1005  }
1006 
1011  RequesterParams & request_topic_name (const std::string &name) {
1012  toc_strfree( this->impl_->_req_topic_name );
1013  this->impl_->_req_topic_name = toc_strdup( name.c_str() );
1014  return *this;
1015  }
1016 
1021  RequesterParams & reply_topic_name (const std::string &name) {
1022  toc_strfree( this->impl_->_rep_topic_name );
1023  this->impl_->_rep_topic_name = toc_strdup( name.c_str() );
1024  return *this;
1025  }
1026 
1031  dds_entity_traits::DomainParticipant domain_participant() const;
1036  dds_entity_traits::Publisher publisher() const;
1041  dds_entity_traits::Subscriber subscriber() const;
1046  dds_entity_traits::DataWriterQos datawriter_qos() const;
1051  dds_entity_traits::DataReaderQos datareader_qos() const;
1056  ListenerBase * simple_requester_listener() const;
1061  ListenerBase * requester_listener() const;
1066  std::string service_name() const {
1067  const char * i = this->impl_->_service_name;
1068  return std::string(i?i:"" );
1069  }
1074  std::string request_topic_name() const {
1075  const char * i = this->impl_->_req_topic_name;
1076  return std::string( i?i:"");
1077  }
1082  std::string reply_topic_name() const {
1083  const char * i = this->impl_->_rep_topic_name;
1084  return std::string( i?i:"" );
1085  }
1086 
1087  private:
1088  //typedef details::vendor_dependent<RequesterParams>::type VendorDependent;
1089  typedef DDS::rpc::rpc_entity_traits::RequesterParams * VendorDependent;
1090  VendorDependent impl_;
1091 
1092  friend struct coredx::rpc::ServiceProxyImpl;
1093 
1094  public:
1095  VendorDependent get_impl() const { return this->impl_; }
1096  };
1097 
1098  // -------------------------------------------------------------------
1099  // ReplierParams
1100  // -------------------------------------------------------------------
1110  class COREDX_RPC_CPP_CLASS_EXPORT ReplierParams
1111  {
1112  public:
1116  ReplierParams ();
1120  ReplierParams(const ReplierParams & other);
1124  ~ReplierParams();
1128  ReplierParams & operator = (const ReplierParams & that);
1129 
1134  template <class TReq, class TRep>
1135  ReplierParams & simple_replier_listener (SimpleReplierListener<TReq, TRep> *listener);
1136 
1141  template <class TReq, class TRep>
1142  ReplierParams & replier_listener (ReplierListener<TReq, TRep> *listener);
1143 
1147  ReplierParams & domain_participant(dds_entity_traits::DomainParticipant participant);
1152  ReplierParams & service_name (const std::string &service_name) {
1153  toc_strfree( this->impl_->_service_name );
1154  this->impl_->_service_name = toc_strdup( service_name.c_str() );
1155  return *this;
1156  }
1161  ReplierParams & instance_name (const std::string &instance_name) {
1162  toc_strfree( this->impl_->_instance_name );
1163  this->impl_->_instance_name = toc_strdup( instance_name.c_str() );
1164  return *this;
1165  }
1170  ReplierParams & request_topic_name (const std::string &req_topic) {
1171  toc_strfree( this->impl_->_req_topic_name );
1172  this->impl_->_req_topic_name = toc_strdup( req_topic.c_str() );
1173  return *this;
1174  }
1179  ReplierParams & reply_topic_name (const std::string &rep_topic) {
1180  toc_strfree( this->impl_->_rep_topic_name );
1181  this->impl_->_rep_topic_name = toc_strdup( rep_topic.c_str() );
1182  return *this;
1183  }
1188  ReplierParams & datawriter_qos(dds_entity_traits::DataWriterQos qos);
1193  ReplierParams & datareader_qos(dds_entity_traits::DataReaderQos qos);
1198  ReplierParams & publisher(dds_entity_traits::Publisher publisher);
1203  ReplierParams & subscriber(dds_entity_traits::Subscriber subscriber);
1204 
1208  dds_entity_traits::DomainParticipant domain_participant() const;
1212  ListenerBase * simple_replier_listener() const;
1216  ListenerBase * replier_listener() const;
1220  std::string service_name() const {
1221  const char * i = this->impl_->_service_name ;
1222  return std::string( i?i:"" );
1223  }
1227  std::string instance_name() const {
1228  const char * i = this->impl_->_instance_name;
1229  return std::string( i?i:"" );
1230  }
1234  std::string request_topic_name() const {
1235  const char * i = this->impl_->_req_topic_name;
1236  return std::string( i?i:"" );
1237  }
1241  std::string reply_topic_name() const {
1242  const char * i = this->impl_->_rep_topic_name;
1243  return std::string( i?i:"" );
1244  }
1248  dds_entity_traits::DataWriterQos datawriter_qos() const;
1252  dds_entity_traits::DataReaderQos datareader_qos() const;
1256  dds_entity_traits::Publisher publisher() const;
1260  dds_entity_traits::Subscriber subscriber() const;
1261 
1262  private:
1263  //typedef details::vendor_dependent<ReplierParams>::type VendorDependent;
1264  typedef DDS::rpc::rpc_entity_traits::ReplierParams * VendorDependent;
1265  VendorDependent impl_;
1266 
1267  friend class coredx::rpc::Replier;
1268  friend struct coredx::rpc::ReplierImpl;
1269 
1270  public:
1271  VendorDependent get_impl() const { return this->impl_; }
1272  };
1273 
1274  } // namespace rpc
1275 
1276 } // namespace dds
1277 
1278 #include "request_reply_tmpl.hh"
1279 
1280 #endif
1281 
ReturnCode_t wait_for_service(const DDS::Duration_t &maxWait, std::string instanceName)
Block up to &#39;maxWait&#39; until a service matching &#39;instanceNmae&#39; is discovered.
Definition: request_reply.hh:346
SimpleRequesterListener can be installed on a Requester.
Definition: request_reply.hh:163
long ReturnCode_t
Definition: dds.hh:208
SimpleReplierListener can be installed on a Replier.
Definition: request_reply.hh:114
Basis for all rpc related listener classes.
Definition: request_reply.hh:95
A Requester sends requests and receives replies.
Definition: request_reply.hh:54
std::string reply_topic_name() const
Access the reply_topic_name configured in this instance of ReplierParams.
Definition: request_reply.hh:1241
RequesterParams & reply_topic_name(const std::string &name)
Assign the &#39;reply_topic_name&#39;.
Definition: request_reply.hh:1021
void wait_for_services(const std::vector< std::string > &instanceNames)
Block until discovering a service for each of the listed &#39;instanceNames&#39;.
Definition: request_reply.hh:367
A replier receives requests and send replies.
Definition: request_reply.hh:57
Holds a collection of sample data and related meta-data.
Definition: sample.hh:65
uint32_t size() const
Returns the current size (number of elements) of the sequence.
Definition: dds_seq.hh:218
void wait_for_service(std::string instanceName)
Wait for a service with matching &#39;instanceName&#39; to be discovered.
Definition: request_reply.hh:337
Sequence data type.
Definition: dds_seq.hh:61
Holds a reference to sample data intended for transmission.
Definition: sample.hh:64
std::string service_name() const
Access the service_name configured in this instance of RequesterParams.
Definition: request_reply.hh:1066
ReplierParams & service_name(const std::string &service_name)
Assign the service_name configured in this instance of ReplierParams.
Definition: request_reply.hh:1152
Sample holds the data and related meta information.
Definition: sample.hh:61
std::string instance_name() const
Access the instance_name configured in this instance of ReplierParams.
Definition: request_reply.hh:1227
ReturnCode_t wait_for_services(const DDS::Duration_t &maxWait, const std::vector< std::string > &instanceNames)
Block until discovering a service for each of the listed &#39;instanceNames&#39;, or &#39;maxWait&#39; elapses...
Definition: request_reply.hh:379
SampleRef holds a reference to data and related meta information.
Definition: sample.hh:62
std::string service_name() const
Access the service_name configured in this instance of ReplierParams.
Definition: request_reply.hh:1220
std::string request_topic_name() const
Access the request_topic_name configured in this instance of RequesterParams.
Definition: request_reply.hh:1074
Provides the DDS infrastructure.
Definition: dds_builtin_basic.hh:27
void bind(const std::string &instance_name)
Bind the ServiceProxy to service(s) with the provided &#39;instance_name&#39;.
Definition: request_reply.hh:266
Holds sample data intended for transmission.
Definition: sample.hh:63
std::vector< std::string > get_discoverd_service_instances() const
Access a list of instance_names that have been discovered by the ServiceProxy.
Definition: request_reply.hh:293
Definition: dds_builtin_basic.hh:238
ReplierParams & instance_name(const std::string &instance_name)
Assign the instance_name configured in this instance of ReplierParams.
Definition: request_reply.hh:1161
ServiceProxy.
Definition: request_reply.hh:254
RPCEntity is a base abstract class.
Definition: request_reply.hh:206
ReplierParams & reply_topic_name(const std::string &rep_topic)
Assign the reply_topic_name configured in this instance of ReplierParams.
Definition: request_reply.hh:1179
Used to pass configuration parameters when constructing a Requester.
Definition: request_reply.hh:930
RequesterListener can be installed on a Requester.
Definition: request_reply.hh:187
Provides a generic basis for all Replier objects.
Definition: request_reply.hh:714
std::vector< std::string > get_discovered_service_instances() const
Access a list of instance_names that have been discovered by the ServiceProxy.
Definition: request_reply.hh:300
std::string reply_topic_name() const
Access the reply_topic_name configured in this instance of RequesterParams.
Definition: request_reply.hh:1082
RequesterParams & request_topic_name(const std::string &name)
Assign the &#39;request_topic_name&#39; to use as the Request topic name.
Definition: request_reply.hh:1011
std::string request_topic_name() const
Access the request_topic_name configured in this instance of ReplierParams.
Definition: request_reply.hh:1234
Used to pass configuration parameters when constructing a Replier.
Definition: request_reply.hh:1110
bool push_back(const T &v)
Definition: dds_seq.hh:379
ReplierLister can be installed on a Replier.
Definition: request_reply.hh:139
std::string get_bound_instance_name() const
Provides the instance_name to which the ServiceProxy is currently bound.
Definition: request_reply.hh:283
ReplierParams & request_topic_name(const std::string &req_topic)
Assign the request_topic_name configured in this instance of ReplierParams.
Definition: request_reply.hh:1170
The Duration_t structure contains data to define a time duration.
Definition: dds_builtin_basic.hh:289
RequesterParams & service_name(const std::string &name)
Assign the service_name to use when creating the Request and Reply topic names.
Definition: request_reply.hh:1001

© 2009-2020 Twin Oaks Computing, Inc
Castle Rock, CO 80104
All rights reserved.