24 #ifndef OMG_DDS_RPC_FUNCTION_CALL_HH 25 #define OMG_DDS_RPC_FUNCTION_CALL_HH 27 #include <dds/request_reply.hh> 51 template <
class Iface>
52 struct interface_traits
54 typedef Iface InterfaceType;
55 typedef typename Iface::ProxyType ProxyType;
56 typedef typename Iface::RequestType RequestType;
57 typedef typename Iface::ReplyType ReplyType;
119 ServiceParams & datawriter_qos(dds_entity_traits::DataWriterQos qos);
123 ServiceParams & datareader_qos(dds_entity_traits::DataReaderQos qos);
127 ServiceParams & publisher(dds_entity_traits::Publisher publisher);
131 ServiceParams & subscriber(dds_entity_traits::Subscriber subscriber);
135 ServiceParams & domain_participant(dds_entity_traits::DomainParticipant part);
141 return this->_params.service_name();
147 return this->_params.instance_name();
153 return this->_params.request_topic_name();
159 return this->_params.reply_topic_name();
164 dds_entity_traits::DataWriterQos datawriter_qos()
const;
168 dds_entity_traits::DataReaderQos datareader_qos()
const;
172 dds_entity_traits::Publisher publisher()
const;
176 dds_entity_traits::Subscriber subscriber()
const;
180 dds_entity_traits::DomainParticipant domain_participant()
const;
216 std::string instance_name,
219 this->_instance_name = toc_strdup(instance_name.c_str());
220 this->_timeout = timeout;
242 toc_strfree( this->_instance_name );
243 this->_instance_name = toc_strdup(instance_name.c_str() );
263 ClientParams & datawriter_qos(
const dds_entity_traits::DataWriterQos & qos);
267 ClientParams & datareader_qos(
const dds_entity_traits::DataReaderQos & qos);
271 ClientParams & publisher(dds_entity_traits::Publisher publisher);
275 ClientParams & subscriber(dds_entity_traits::Subscriber subscriber);
279 ClientParams & domain_participant(dds_entity_traits::DomainParticipant part);
289 return this->_params.service_name();
295 return std::string(this->_instance_name?this->_instance_name:
"");
301 return this->_params.request_topic_name();
307 return this->_params.reply_topic_name();
312 const dds_entity_traits::DataWriterQos datawriter_qos()
const;
316 const dds_entity_traits::DataReaderQos datareader_qos()
const;
320 dds_entity_traits::Publisher publisher()
const;
324 dds_entity_traits::Subscriber subscriber()
const;
328 dds_entity_traits::DomainParticipant domain_participant()
const;
334 char * _instance_name;
354 template <
class Impl>
358 typedef rpc_entity_traits::ServiceEndpoint * VendorDependent;
368 template <
class TReq>
369 typename dds_type_traits<TReq>::DataReader get_request_datareader()
const;
373 template <
class TRep>
374 typename dds_type_traits<TRep>::DataWriter get_reply_datawriter()
const;
396 VendorDependent get_impl()
const;
427 template <
class TReq>
428 typename dds_type_traits<TReq>::DataWriter get_request_datawriter()
const;
432 template <
class TRep>
433 typename dds_type_traits<TRep>::DataReader get_reply_datareader()
const;
440 ClientParams cp( rp, this->get_bound_instance_name(), this->timeout );
446 #if defined(CDX_HAS_RPC_SERVER) 462 ServerParams(
const ServerParams & other);
463 ServerParams & operator = (
const ServerParams & that);
464 ServerParams & default_service_params(
const ServiceParams & service_params);
468 typedef rpc_entity_traits::ServerParams * VendorDependent;
469 VendorDependent impl_;
472 VendorDependent get_impl()
const;
491 typedef rpc_entity_traits::Server * VendorDependent;
495 explicit Server(
const ServerParams & server_params);
499 VendorDependent get_impl()
const;
507 template <
class TReq>
508 typename dds_type_traits<TReq>::DataWriter
511 return (
typename dds_type_traits<TReq>::DataWriter)
512 ((VendorDependent)this->impl_)->get_req_dw( );
515 template <
class TRep>
516 typename dds_type_traits<TRep>::DataReader
519 return (
typename dds_type_traits<TRep>::DataReader)
520 ((VendorDependent)this->impl_)->get_rep_dr( );
Definition: function_call.hh:44
ServiceParams & reply_topic_name(const std::string &rep_topic)
Assign the reply_topic_name configured in this instance of ServiceParams.
Definition: function_call.hh:112
const std::string request_topic_name() const
Access the request_topic_name configured in this instance of ClientParams.
Definition: function_call.hh:300
ServiceStatus
Definition: function_call.hh:44
std::string reply_topic_name() const
Access the reply_topic_name configured in this instance of ServiceParams.
Definition: function_call.hh:158
std::string service_name() const
Access the service_name configured in this instance of ServiceParams.
Definition: function_call.hh:140
std::string instance_name() const
Access the instance_name configured in this instance of ServiceParams.
Definition: function_call.hh:146
ClientEndpoint(const DDS::Duration_t &tout)
Default constructor.
Definition: function_call.hh:422
ClientParams & service_name(const std::string &service_name)
Assign the service_name configured in this instance of ClientParams.
Definition: function_call.hh:234
ClientParams & request_topic_name(const std::string &req_topic)
Assign the request_topic_name configured in this instance of ClientParams.
Definition: function_call.hh:249
Used to pass configuration parameters when constructing a Service.
Definition: function_call.hh:72
ServiceParams & request_topic_name(const std::string &req_topic)
Assign the request_topic_name configured in this instance of ServiceParams.
Definition: function_call.hh:105
ServiceParams & service_name(const std::string &service_name)
Assign the service_name configured in this instance of ServiceParams.
Definition: function_call.hh:91
Used to pass configuration parameters when constructing a Client.
Definition: function_call.hh:200
Definition: function_call.hh:350
const std::string service_name() const
Access the service_name configured in this instance of ClientParams.
Definition: function_call.hh:288
Definition: function_call.hh:46
const std::string instance_name() const
Access the instance_name configured in this instance of ClientParams.
Definition: function_call.hh:294
Provides the DDS infrastructure.
Definition: dds_builtin_basic.hh:27
ClientParams & reply_topic_name(const std::string &rep_topic)
Assign the reply_topic_name configured in this instance of ClientParams.
Definition: function_call.hh:256
dds_type_traits< TReq >::DataWriter get_request_datawriter() const
Access the DataWriter used to send TReq requests.
Definition: function_call.hh:509
Definition: function_call.hh:413
ServiceProxy.
Definition: request_reply.hh:254
RPCEntity is a base abstract class.
Definition: request_reply.hh:206
dds_type_traits< TRep >::DataReader get_reply_datareader() const
Access the DataReader used to receive TRep replies.
Definition: function_call.hh:517
Used to pass configuration parameters when constructing a Requester.
Definition: request_reply.hh:930
DDS::rpc::ClientParams get_client_params()
Access the ClientParams defining the configuration of this ClientEndpoint.
Definition: function_call.hh:438
ServiceParams & instance_name(const std::string &instance_name)
Assign the instance_name configured in this instance of ServiceParams.
Definition: function_call.hh:98
const std::string reply_topic_name() const
Access the reply_topic_name configured in this instance of ClientParams.
Definition: function_call.hh:306
std::string request_topic_name() const
Access the request_topic_name configured in this instance of ServiceParams.
Definition: function_call.hh:152
ClientParams & instance_name(const std::string &instance_name)
Assign the instance_name configured in this instance of ClientParams.
Definition: function_call.hh:241
Definition: function_call.hh:45
Used to pass configuration parameters when constructing a Replier.
Definition: request_reply.hh:1110
The Duration_t structure contains data to define a time duration.
Definition: dds_builtin_basic.hh:289