iox::popo::ServerImpl🔗
The ServerImpl class implements the typed server API. More...
#include <iceoryx_posh/internal/popo/server_impl.hpp>
Inherits from iox::popo::BaseServer<>, iox::popo::RpcInterface< Response< Res >, ServerSendError >
Inherited by iox::popo::Server< Req, Res >
Public Functions🔗
Name | |
---|---|
ServerImpl(const capro::ServiceDescription & service, const ServerOptions & serverOptions ={}) Constructor for a sserver. |
|
virtual | ~ServerImpl() |
ServerImpl(const ServerImpl & ) | |
ServerImpl(ServerImpl && ) | |
ServerImpl & | operator=(const ServerImpl & ) |
ServerImpl & | operator=(ServerImpl && ) |
cxx::expected< Request< const Req >, ServerRequestResult > | take() Take the Request from the top of the receive queue. |
template <typename... Args> cxx::expected< Response< Res >, AllocationError > |
loan(const Request< const Req > & request, Args &&... args) Get a Response from loaned shared memory and construct the data with the given arguments. |
cxx::expected< ServerSendError > | send(Response< Res > && response) override Sends the given Response and then releases its loan. |
Additional inherited members🔗
Protected Types inherited from iox::popo::BaseServer<>
Name | |
---|---|
using BaseServer< PortT, TriggerHandleT > | SelfType |
using PortT | PortType |
Public Functions inherited from iox::popo::BaseServer<>
Name | |
---|---|
virtual | ~BaseServer() |
BaseServer(const BaseServer & other) | |
BaseServer(BaseServer && rhs) | |
uid_t | getUid() const Get the UID of the server. |
const capro::ServiceDescription & | getServiceDescription() const Get the service description of the server. |
void | offer() Offer the service to be connected to when not already offering, otherwise nothing. |
void | stopOffer() Stop offering the service when already offering, otherwise nothing. |
bool | isOffered() const Check if the server is offering. |
bool | hasClients() const Check if the server has clients. |
bool | hasRequests() const Check if requests are available. |
bool | hasMissedRequests() Check if requests has been missed since the last call of this method. |
void | releaseQueuedRequests() Releases any unread queued requests. |
Protected Functions inherited from iox::popo::BaseServer<>
Name | |
---|---|
BaseServer(const capro::ServiceDescription & service, const ServerOptions & serverOptions) | |
void | invalidateTrigger(const uint64_t uniqueTriggerId) Only usable by the WaitSet/Listener, not for public use. Invalidates the internal triggerHandle. |
void | enableState(TriggerHandleT && triggerHandle, const ServerState serverState) Only usable by the WaitSet/Listener, not for public use. Attaches the triggerHandle to the internal trigger. |
WaitSetIsConditionSatisfiedCallback | getCallbackForIsStateConditionSatisfied(const ServerState serverState) const Only usable by the WaitSet/Listener, not for public use. Returns method pointer to the event corresponding hasTriggered method callback. |
void | disableState(const ServerState serverState) Only usable by the WaitSet/Listener, not for public use. Resets the internal triggerHandle. |
void | enableEvent(TriggerHandleT && triggerHandle, const ServerEvent serverEvent) Only usable by the WaitSet/Listener, not for public use. Attaches the triggerHandle to the internal trigger. |
void | disableEvent(const ServerEvent serverEvent) Only usable by the WaitSet/Listener, not for public use. Resets the internal triggerHandle. |
const PortT & | port() const port |
PortT & | port() port |
Protected Attributes inherited from iox::popo::BaseServer<>
Name | |
---|---|
PortT | m_port |
TriggerHandleT | m_trigger |
Friends inherited from iox::popo::BaseServer<>
Name | |
---|---|
class | NotificationAttorney |
Detailed Description🔗
template <typename Req ,
typename Res ,
typename BaseServerT =BaseServer<>>
class iox::popo::ServerImpl;
The ServerImpl class implements the typed server API.
Note: Not intended for public usage! Use the [Server](/v2.0.1/API-reference/posh/Classes/classiox_1_1popo_1_1Server/)
instead!
Public Functions Documentation🔗
function ServerImpl🔗
explicit ServerImpl(
const capro::ServiceDescription & service,
const ServerOptions & serverOptions ={}
)
Constructor for a sserver.
Parameters:
- service is the ServiceDescription for the new server
- serverOptions like the queue capacity and queue full policy by a server
function ~ServerImpl🔗
virtual ~ServerImpl()
function ServerImpl🔗
ServerImpl(
const ServerImpl &
)
function ServerImpl🔗
ServerImpl(
ServerImpl &&
)
function operator=🔗
ServerImpl & operator=(
const ServerImpl &
)
function operator=🔗
ServerImpl & operator=(
ServerImpl &&
)
function take🔗
cxx::expected< Request< const Req >, ServerRequestResult > take()
Take the Request from the top of the receive queue.
Return: Either a Request or a ServerRequestResult.
The Request takes care of the cleanup. Don't store the raw pointer to the content of the Request, but always the whole Request.
function loan🔗
template <typename... Args>
cxx::expected< Response< Res >, AllocationError > loan(
const Request< const Req > & request,
Args &&... args
)
Get a Response from loaned shared memory and construct the data with the given arguments.
Parameters:
- request The request to which the Response belongs to, to determine where to send the response
- args Arguments used to construct the data.
Return: An instance of the Response that resides in shared memory or an error if unable to allocate memory to loan.
The loaned Response is automatically released when it goes out of scope.
function send🔗
cxx::expected< ServerSendError > send(
Response< Res > && response
) override
Sends the given Response and then releases its loan.
Parameters:
- response to send.
Return: Error if sending was not successful
Updated on 2 April 2022 at 16:37:47 CEST