Template Class ServerImpl
Defined in File server_impl.hpp
Inheritance Relationships
Base Types
public iox::popo::BaseServer<>(Template Class BaseServer)private iox::popo::RpcInterface< Response< Res >, ServerSendError >(Template Class RpcInterface)
Derived Type
public iox::popo::Server< Req, Res >(Template Class Server)
Class Documentation
-
template<typename Req, typename Res, typename BaseServerT = BaseServer<>>
class ServerImpl : public iox::popo::BaseServer<>, private iox::popo::RpcInterface<Response<Res>, ServerSendError> The ServerImpl class implements the typed server API.
Note
Not intended for public usage! Use the
Serverinstead!Subclassed by iox::popo::Server< Req, Res >
Public Functions
-
explicit ServerImpl(const capro::ServiceDescription &service, const ServerOptions &serverOptions = {}) noexcept
Constructor for a sserver.
- Parameters:
service – [in] is the ServiceDescription for the new server
serverOptions – [in] like the queue capacity and queue full policy by a server
-
virtual ~ServerImpl() noexcept
-
ServerImpl(const ServerImpl&) = delete
-
ServerImpl(ServerImpl&&) = delete
-
ServerImpl &operator=(const ServerImpl&) = delete
-
ServerImpl &operator=(ServerImpl&&) = delete
-
cxx::expected<Request<const Req>, ServerRequestResult> take() noexcept
Take the Request from the top of the receive queue.
The Request takes care of the cleanup. Don’t store the raw pointer to the content of the Request, but always the whole Request.
- Returns:
Either a Request or a ServerRequestResult.
-
template<typename ...Args>
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.
The loaned Response is automatically released when it goes out of scope.
-
virtual cxx::expected<ServerSendError> send(Response<Res> &&response) noexcept override
Sends the given Response and then releases its loan.
- Parameters:
response – to send.
- Returns:
Error if sending was not successful
-
explicit ServerImpl(const capro::ServiceDescription &service, const ServerOptions &serverOptions = {}) noexcept