Template Class BasicService
Defined in File agnocast_service.hpp
Nested Relationships
Nested Types
Inheritance Relationships
Base Type
public std::enable_shared_from_this< BasicService< ServiceT, BridgeRequestPolicy > >
Class Documentation
-
template<typename ServiceT, typename BridgeRequestPolicy>
class BasicService : public std::enable_shared_from_this<BasicService<ServiceT, BridgeRequestPolicy>> Public Types
Public Functions
- inline AGNOCAST_PUBLIC void send_response (ipc_shared_ptr< typename ServiceT::Request > &&request, ipc_shared_ptr< typename ServiceT::Response > &&response)
Sends a response to the client that initiated the service call. This function is expected to be used in deferred response callbacks.
responsemust be the object returned byborrow_loaned_response(). The entireborrow_loaned_response()-> populate ->send_response()sequence must run on the same thread (typically in a single callback).- Parameters:
request – The request that initiated the service call.
response – The response to send. Must be acquired by calling borrow_loaned_response().
- inline AGNOCAST_PUBLIC ipc_shared_ptr< typename ServiceT::Response > borrow_loaned_response (const ipc_shared_ptr< typename ServiceT::Request > &request)
Allocate a service response message in shared memory. This function is expected to be used in deferred response callbacks.
This function does not consume
request. In deferred callbacks, keeprequestand pass it tosend_response()after populating the returned response.- Parameters:
request – The request that initiated the service call.
- Returns:
Owned pointer to the response message in shared memory.