RTI Connext Modern C++ API  Version 6.1.0
dds::rpc::ServiceEndpoint< Dispatcher > Class Template Reference

Manages the DDS entities required to receive function calls and send the return values. More...

#include <ServiceEndpoint.hpp>

Inheritance diagram for dds::rpc::ServiceEndpoint< Dispatcher >:
dds::core::Reference< detail::ServiceEndpointImpl< Dispatcher > >

Public Types

using InterfaceType = typename Dispatcher::InterfaceType
 The interface type, such as rpc_example::RobotControl. More...
 
using RequestType = typename Dispatcher::RequestType
 The internal type used to receive requests (function calls) More...
 
using ReplyType = typename Dispatcher::ReplyType
 The internal type used to send replies (the return values of the function calls) More...
 

Public Member Functions

 ServiceEndpoint (std::shared_ptr< InterfaceType > service_impl, dds::rpc::Server server, const ServiceParams &params)
 Construct a new Service Endpoint object. More...
 
void close ()
 Destroys the underlying resources. More...
 
dds::sub::DataReader< RequestTyperequest_datareader ()
 Accesses the underlying DataReader that receives the requests (function calls) More...
 
dds::pub::DataWriter< ReplyTypereply_datawriter ()
 Accesses the underlying DataWriter that sends the replies (return values from the function calls) More...
 

Detailed Description

template<typename Dispatcher>
class dds::rpc::ServiceEndpoint< Dispatcher >

Manages the DDS entities required to receive function calls and send the return values.

Template Parameters
DispatcherInternal type generated by rtiddsgen

Applications shouldn't use this class directly. rtiddsgen will generate the proper instantiation of this class, such as rpc_example::RobotControlService

A ServiceEndpoint requires a an implementation of an IDL service interface, such as rpc_example::RobotControl.

A ServiceEndpoint is attached to a Server in order to start receiving and processing remote function calls.

Member Typedef Documentation

◆ InterfaceType

template<typename Dispatcher >
using dds::rpc::ServiceEndpoint< Dispatcher >::InterfaceType = typename Dispatcher::InterfaceType

The interface type, such as rpc_example::RobotControl.

◆ RequestType

template<typename Dispatcher >
using dds::rpc::ServiceEndpoint< Dispatcher >::RequestType = typename Dispatcher::RequestType

The internal type used to receive requests (function calls)

◆ ReplyType

template<typename Dispatcher >
using dds::rpc::ServiceEndpoint< Dispatcher >::ReplyType = typename Dispatcher::ReplyType

The internal type used to send replies (the return values of the function calls)

Constructor & Destructor Documentation

◆ ServiceEndpoint()

template<typename Dispatcher >
dds::rpc::ServiceEndpoint< Dispatcher >::ServiceEndpoint ( std::shared_ptr< InterfaceType service_impl,
dds::rpc::Server  server,
const ServiceParams params 
)
inline

Construct a new Service Endpoint object.

Parameters
service_implThe implementation of the DDS service, such as rpc_example::RobotControl.
serverThe server where to run this service endpoint.
paramsThe parameters used to configure this service endpoint

Member Function Documentation

◆ close()

template<typename Dispatcher >
void dds::rpc::ServiceEndpoint< Dispatcher >::close ( )
inline

Destroys the underlying resources.

Any operation after close() throws dds::core::AlreadyClosedError

◆ request_datareader()

template<typename Dispatcher >
dds::sub::DataReader<RequestType> dds::rpc::ServiceEndpoint< Dispatcher >::request_datareader ( )
inline

Accesses the underlying DataReader that receives the requests (function calls)

Returns
The DataReader

◆ reply_datawriter()

template<typename Dispatcher >
dds::pub::DataWriter<ReplyType> dds::rpc::ServiceEndpoint< Dispatcher >::reply_datawriter ( )
inline

Accesses the underlying DataWriter that sends the replies (return values from the function calls)

Returns
The DataWriter