17#ifndef IOX_POSH_POPO_SERVER_IMPL_HPP
18#define IOX_POSH_POPO_SERVER_IMPL_HPP
20#include "iceoryx_posh/capro/service_description.hpp"
21#include "iceoryx_posh/internal/popo/base_server.hpp"
22#include "iceoryx_posh/internal/popo/request_deleter.hpp"
23#include "iceoryx_posh/internal/popo/response_deleter.hpp"
24#include "iceoryx_posh/internal/popo/rpc_interface.hpp"
25#include "iceoryx_posh/internal/popo/typed_port_api_trait.hpp"
26#include "iceoryx_posh/popo/request.hpp"
27#include "iceoryx_posh/popo/response.hpp"
28#include "iceoryx_posh/popo/server_options.hpp"
29#include "iceoryx_posh/popo/trigger_handle.hpp"
30#include "iceoryx_posh/runtime/posh_runtime.hpp"
38template <
typename Req,
typename Res,
typename BaseServerT = BaseServer<>>
41 using RequestTypeAssert =
typename TypedPortApiTrait<Req>::Assert;
42 using ResponseTypeAssert =
typename TypedPortApiTrait<Res>::Assert;
60 cxx::expected<
Request<const Req>, ServerRequestResult>
take() noexcept;
68 template <typename... Args>
69 cxx::expected<
Response<Res>, AllocationError>
loan(const
Request<const Req>& request, Args&&... args) noexcept;
74 cxx::expected<ServerSendError>
send(
Response<Res>&& response) noexcept override;
77 using BaseServerT::
port;
80 cxx::expected<
Response<Res>, AllocationError> loanUninitialized(const
Request<const Req>& request) noexcept;
82 using RequestSampleDeleter = RequestDeleter<typename BaseServerT::PortType>;
83 RequestSampleDeleter m_requestDeleter{
port()};
84 using ResponseSampleDeleter = ResponseDeleter<typename BaseServerT::PortType>;
85 ResponseSampleDeleter m_responseDeleter{
port()};
90#include "iceoryx_posh/internal/popo/server_impl.inl"
class for the identification of a communication event including information on the service,...
Definition: service_description.hpp:81
const PortT & port() const noexcept
port
The Request class is a mutable abstraction over types which are written to loaned shared memory....
Definition: request.hpp:40
The Response class is a mutable abstraction over types which are written to loaned shared memory....
Definition: response.hpp:42
Definition: request.hpp:33
The ServerImpl class implements the typed server API.
Definition: server_impl.hpp:40
cxx::expected< Response< Res >, AllocationError > loan(const Request< const Req > &request, Args &&... args) noexcept
Get a Response from loaned shared memory and construct the data with the given arguments.
cxx::expected< Request< const Req >, ServerRequestResult > take() noexcept
Take the Request from the top of the receive queue.
ServerImpl(const capro::ServiceDescription &service, const ServerOptions &serverOptions={}) noexcept
Constructor for a sserver.
cxx::expected< ServerSendError > send(Response< Res > &&response) noexcept override
Sends the given Response and then releases its loan.
This struct is used to configure the server.
Definition: server_options.hpp:33