iceoryx_posh 2.0.5
Loading...
Searching...
No Matches
Public Member Functions | List of all members
iox::popo::UntypedServerImpl< BaseServerT > Class Template Reference

The UntypedServerImpl class implements the untyped server API. More...

#include <iceoryx_posh/internal/popo/untyped_server_impl.hpp>

Inheritance diagram for iox::popo::UntypedServerImpl< BaseServerT >:
Inheritance graph
[legend]
Collaboration diagram for iox::popo::UntypedServerImpl< BaseServerT >:
Collaboration graph
[legend]

Public Member Functions

 UntypedServerImpl (const capro::ServiceDescription &service, const ServerOptions &serverOptions={}) noexcept
 
 UntypedServerImpl (const UntypedServerImpl &)=delete
 
 UntypedServerImpl (UntypedServerImpl &&)=delete
 
UntypedServerImploperator= (const UntypedServerImpl &)=delete
 
UntypedServerImploperator= (UntypedServerImpl &&)=delete
 
cxx::expected< const void *, ServerRequestResulttake () noexcept
 Take the request chunk from the top of the receive queue.
 
void releaseRequest (const void *const requestPayload) noexcept
 Releases the ownership of the request chunk provided by the payload pointer.
 
cxx::expected< void *, AllocationErrorloan (const RequestHeader *const requestHeader, const uint32_t payloadSize, const uint32_t payloadAlignment) noexcept
 Get a response chunk from loaned shared memory.
 
cxx::expected< ServerSendErrorsend (void *const responsePayload) noexcept
 Sends the provided memory chunk as response to the client.
 
void releaseResponse (void *const responsePayload) noexcept
 Releases the ownership of the response chunk provided by the payload pointer.
 
- Public Member Functions inherited from iox::popo::BaseServer< PortT, TriggerHandleT >
 BaseServer (const BaseServer &other)=delete
 
BaseServeroperator= (const BaseServer &)=delete
 
 BaseServer (BaseServer &&rhs)=delete
 
BaseServeroperator= (BaseServer &&rhs)=delete
 
uid_t getUid () const noexcept
 Get the UID of the server.
 
const capro::ServiceDescriptiongetServiceDescription () const noexcept
 Get the service description of the server.
 
void offer () noexcept
 Offer the service to be connected to when not already offering, otherwise nothing.
 
void stopOffer () noexcept
 Stop offering the service when already offering, otherwise nothing.
 
bool isOffered () const noexcept
 Check if the server is offering.
 
bool hasClients () const noexcept
 Check if the server has clients.
 
bool hasRequests () const noexcept
 Check if requests are available.
 
bool hasMissedRequests () noexcept
 Check if requests has been missed since the last call of this method.
 
void releaseQueuedRequests () noexcept
 Releases any unread queued requests.
 

Additional Inherited Members

- Protected Types inherited from iox::popo::BaseServer< PortT, TriggerHandleT >
using SelfType = BaseServer< PortT, TriggerHandleT >
 
using PortType = PortT
 
- Protected Member Functions inherited from iox::popo::BaseServer< PortT, TriggerHandleT >
 BaseServer (const capro::ServiceDescription &service, const ServerOptions &serverOptions) noexcept
 
void invalidateTrigger (const uint64_t uniqueTriggerId) noexcept
 Only usable by the WaitSet/Listener, not for public use. Invalidates the internal triggerHandle.
 
void enableState (TriggerHandleT &&triggerHandle, const ServerState serverState) noexcept
 Only usable by the WaitSet/Listener, not for public use. Attaches the triggerHandle to the internal trigger.
 
WaitSetIsConditionSatisfiedCallback getCallbackForIsStateConditionSatisfied (const ServerState serverState) const noexcept
 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) noexcept
 Only usable by the WaitSet/Listener, not for public use. Resets the internal triggerHandle.
 
void enableEvent (TriggerHandleT &&triggerHandle, const ServerEvent serverEvent) noexcept
 Only usable by the WaitSet/Listener, not for public use. Attaches the triggerHandle to the internal trigger.
 
void disableEvent (const ServerEvent serverEvent) noexcept
 Only usable by the WaitSet/Listener, not for public use. Resets the internal triggerHandle.
 
const PortTport () const noexcept
 port
 
PortTport () noexcept
 port
 
- Protected Attributes inherited from iox::popo::BaseServer< PortT, TriggerHandleT >
PortT m_port
 
TriggerHandleT m_trigger
 

Detailed Description

template<typename BaseServerT = BaseServer<>>
class iox::popo::UntypedServerImpl< BaseServerT >

The UntypedServerImpl class implements the untyped server API.

Note
Not intended for public usage! Use the UntypedServer instead!

Member Function Documentation

◆ loan()

template<typename BaseServerT = BaseServer<>>
cxx::expected< void *, AllocationError > iox::popo::UntypedServerImpl< BaseServerT >::loan ( const RequestHeader *const  requestHeader,
const uint32_t  payloadSize,
const uint32_t  payloadAlignment 
)
noexcept

Get a response chunk from loaned shared memory.

Parameters
[in]requestHeaderThe requestHeader to which the response belongs to, to determine where to send the response
payloadSizeThe expected payload size of the chunk.
payloadAlignmentThe expected payload alignment of the chunk.
Returns
A pointer to the payload of a chunk of memory with the requested size or an AllocationError if no chunk could be loaned.
Note
An AllocationError occurs if no chunk is available in the shared memory.

◆ releaseRequest()

template<typename BaseServerT = BaseServer<>>
void iox::popo::UntypedServerImpl< BaseServerT >::releaseRequest ( const void *const  requestPayload)
noexcept

Releases the ownership of the request chunk provided by the payload pointer.

Parameters
requestPayloadpointer to the payload of the chunk to be released

The requestPayload pointer must have been previously provided by take and not have been already released. The chunk must not be accessed afterwards as its memory may have been reclaimed.

◆ releaseResponse()

template<typename BaseServerT = BaseServer<>>
void iox::popo::UntypedServerImpl< BaseServerT >::releaseResponse ( void *const  responsePayload)
noexcept

Releases the ownership of the response chunk provided by the payload pointer.

Parameters
responsePayloadpointer to the payload of the chunk to be released

The responsePayload pointer must have been previously provided by loan and not have been already released. The chunk must not be accessed afterwards as its memory may have been reclaimed.

◆ send()

template<typename BaseServerT = BaseServer<>>
cxx::expected< ServerSendError > iox::popo::UntypedServerImpl< BaseServerT >::send ( void *const  responsePayload)
noexcept

Sends the provided memory chunk as response to the client.

Parameters
responsePayloadPointer to the payload of the allocated shared memory chunk.
Returns
Error if sending was not successful

◆ take()

template<typename BaseServerT = BaseServer<>>
cxx::expected< const void *, ServerRequestResult > iox::popo::UntypedServerImpl< BaseServerT >::take ( )
noexcept

Take the request chunk from the top of the receive queue.

Returns
The payload pointer of the request chunk taken.

No automatic cleanup of the associated chunk is performed and must be manually done by calling releaseRequest


The documentation for this class was generated from the following file: