iceoryx_posh 2.0.3
Public Member Functions | List of all members
iox::popo::UntypedClientImpl< BaseClientT > Class Template Reference

The UntypedClientImpl class implements the untyped client API. More...

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

Inheritance diagram for iox::popo::UntypedClientImpl< BaseClientT >:
Inheritance graph
[legend]
Collaboration diagram for iox::popo::UntypedClientImpl< BaseClientT >:
Collaboration graph
[legend]

Public Member Functions

 UntypedClientImpl (const capro::ServiceDescription &service, const ClientOptions &clientOptions={}) noexcept
 
 UntypedClientImpl (const UntypedClientImpl &)=delete
 
 UntypedClientImpl (UntypedClientImpl &&)=delete
 
UntypedClientImploperator= (const UntypedClientImpl &)=delete
 
UntypedClientImploperator= (UntypedClientImpl &&)=delete
 
cxx::expected< void *, AllocationError > loan (const uint32_t payloadSize, const uint32_t payloadAlignment) noexcept
 Get a request chunk from loaned shared memory. More...
 
void releaseRequest (void *const requestPayload) noexcept
 Releases the ownership of the request chunk provided by the payload pointer. More...
 
cxx::expected< ClientSendError > send (void *const requestPayload) noexcept
 Sends the provided memory chunk as request to the server. More...
 
cxx::expected< const void *, ChunkReceiveResult > take () noexcept
 Take the response chunk from the top of the receive queue. More...
 
void releaseResponse (const void *const responsePayload) noexcept
 Releases the ownership of the response chunk provided by the payload pointer. More...
 
- Public Member Functions inherited from iox::popo::BaseClient< PortT, TriggerHandleT >
 BaseClient (const BaseClient &other)=delete
 
BaseClientoperator= (const BaseClient &)=delete
 
 BaseClient (BaseClient &&rhs)=delete
 
BaseClientoperator= (BaseClient &&rhs)=delete
 
uid_t getUid () const noexcept
 Get the unique ID of the client. More...
 
const capro::ServiceDescriptiongetServiceDescription () const noexcept
 Get the service description of the client. More...
 
void connect () noexcept
 Initiate connection to server when not already connected, otherwise nothing.
 
ConnectionState getConnectionState () const noexcept
 Get current connection state. More...
 
void disconnect () noexcept
 Disconnects when already connected, otherwise nothing.
 
bool hasResponses () const noexcept
 Check if response are available. More...
 
bool hasMissedResponses () noexcept
 Check if response has been missed since the last call of this method. More...
 
void releaseQueuedResponses () noexcept
 Releases any unread queued response.
 

Additional Inherited Members

- Protected Types inherited from iox::popo::BaseClient< PortT, TriggerHandleT >
using SelfType = BaseClient< PortT, TriggerHandleT >
 
using PortType = PortT
 
- Protected Member Functions inherited from iox::popo::BaseClient< PortT, TriggerHandleT >
 BaseClient (const capro::ServiceDescription &service, const ClientOptions &clientOptions) noexcept
 
void invalidateTrigger (const uint64_t uniqueTriggerId) noexcept
 Only usable by the WaitSet/Listener, not for public use. Invalidates the internal triggerHandle. More...
 
void enableState (TriggerHandleT &&triggerHandle, const ClientState clientState) noexcept
 Only usable by the WaitSet/Listener, not for public use. Attaches the triggerHandle to the internal trigger. More...
 
WaitSetIsConditionSatisfiedCallback getCallbackForIsStateConditionSatisfied (const ClientState clientState) const noexcept
 Only usable by the WaitSet/Listener, not for public use. Returns method pointer to the event corresponding hasTriggered method callback. More...
 
void disableState (const ClientState clientState) noexcept
 Only usable by the WaitSet/Listener, not for public use. Resets the internal triggerHandle. More...
 
void enableEvent (TriggerHandleT &&triggerHandle, const ClientEvent clientEvent) noexcept
 Only usable by the WaitSet/Listener, not for public use. Attaches the triggerHandle to the internal trigger. More...
 
void disableEvent (const ClientEvent clientEvent) noexcept
 Only usable by the WaitSet/Listener, not for public use. Resets the internal triggerHandle. More...
 
const PortT & port () const noexcept
 const accessor of the underlying port
 
PortT & port () noexcept
 accessor of the underlying port
 
- Protected Attributes inherited from iox::popo::BaseClient< PortT, TriggerHandleT >
PortT m_port
 
TriggerHandleT m_trigger
 

Detailed Description

template<typename BaseClientT = BaseClient<>>
class iox::popo::UntypedClientImpl< BaseClientT >

The UntypedClientImpl class implements the untyped client API.

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

Member Function Documentation

◆ loan()

template<typename BaseClientT = BaseClient<>>
cxx::expected< void *, AllocationError > iox::popo::UntypedClientImpl< BaseClientT >::loan ( const uint32_t  payloadSize,
const uint32_t  payloadAlignment 
)
noexcept

Get a request chunk from loaned shared memory.

Parameters
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 BaseClientT = BaseClient<>>
void iox::popo::UntypedClientImpl< BaseClientT >::releaseRequest ( 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 loan and not have been already released. The chunk must not be accessed afterwards as its memory may have been reclaimed.

◆ releaseResponse()

template<typename BaseClientT = BaseClient<>>
void iox::popo::UntypedClientImpl< BaseClientT >::releaseResponse ( const 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 take and not have been already released. The chunk must not be accessed afterwards as its memory may have been reclaimed.

◆ send()

template<typename BaseClientT = BaseClient<>>
cxx::expected< ClientSendError > iox::popo::UntypedClientImpl< BaseClientT >::send ( void *const  requestPayload)
noexcept

Sends the provided memory chunk as request to the server.

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

◆ take()

template<typename BaseClientT = BaseClient<>>
cxx::expected< const void *, ChunkReceiveResult > iox::popo::UntypedClientImpl< BaseClientT >::take ( )
noexcept

Take the response 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 releaseResponse


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