iceoryx_posh 2.0.5
Loading...
Searching...
No Matches
Public Member Functions | List of all members
iox::popo::ClientImpl< Req, Res, BaseClientT > Class Template Reference

The ClientImpl class implements the typed client API. More...

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

Inheritance diagram for iox::popo::ClientImpl< Req, Res, BaseClientT >:
Inheritance graph
[legend]
Collaboration diagram for iox::popo::ClientImpl< Req, Res, BaseClientT >:
Collaboration graph
[legend]

Public Member Functions

 ClientImpl (const capro::ServiceDescription &service, const ClientOptions &clientOptions={}) noexcept
 Constructor for a client.
 
 ClientImpl (const ClientImpl &)=delete
 
 ClientImpl (ClientImpl &&)=delete
 
ClientImploperator= (const ClientImpl &)=delete
 
ClientImploperator= (ClientImpl &&)=delete
 
template<typename... Args>
cxx::expected< Request< Req >, AllocationErrorloan (Args &&... args) noexcept
 Get a Request from loaned shared memory and construct the data with the given arguments.
 
cxx::expected< ClientSendErrorsend (Request< Req > &&request) noexcept override
 Sends the given Request and then releases its loan.
 
cxx::expected< Response< const Res >, ChunkReceiveResulttake () noexcept
 Take the Response from the top of the receive queue.
 
- 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.
 
const capro::ServiceDescriptiongetServiceDescription () const noexcept
 Get the service description of the client.
 
void connect () noexcept
 Initiate connection to server when not already connected, otherwise nothing.
 
ConnectionState getConnectionState () const noexcept
 Get current connection state.
 
void disconnect () noexcept
 Disconnects when already connected, otherwise nothing.
 
bool hasResponses () const noexcept
 Check if response are available.
 
bool hasMissedResponses () noexcept
 Check if response has been missed since the last call of this method.
 
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.
 
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.
 
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.
 
void disableState (const ClientState clientState) noexcept
 Only usable by the WaitSet/Listener, not for public use. Resets the internal triggerHandle.
 
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.
 
void disableEvent (const ClientEvent clientEvent) noexcept
 Only usable by the WaitSet/Listener, not for public use. Resets the internal triggerHandle.
 
const PortTport () const noexcept
 const accessor of the underlying port
 
PortTport () 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 Req, typename Res, typename BaseClientT = BaseClient<>>
class iox::popo::ClientImpl< Req, Res, BaseClientT >

The ClientImpl class implements the typed client API.

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

Constructor & Destructor Documentation

◆ ClientImpl()

template<typename Req , typename Res , typename BaseClientT = BaseClient<>>
iox::popo::ClientImpl< Req, Res, BaseClientT >::ClientImpl ( const capro::ServiceDescription service,
const ClientOptions clientOptions = {} 
)
explicitnoexcept

Constructor for a client.

Parameters
[in]serviceis the ServiceDescription for the new client
[in]clientOptionslike the queue capacity and queue full policy by a client

Member Function Documentation

◆ loan()

template<typename Req , typename Res , typename BaseClientT = BaseClient<>>
template<typename... Args>
cxx::expected< Request< Req >, AllocationError > iox::popo::ClientImpl< Req, Res, BaseClientT >::loan ( Args &&...  args)
noexcept

Get a Request from loaned shared memory and construct the data with the given arguments.

Parameters
[in]argsArguments used to construct the data.
Returns
An instance of the Request that resides in shared memory or an error if unable to allocate memory to loan.

The loaned Request is automatically released when it goes out of scope.

◆ send()

template<typename Req , typename Res , typename BaseClientT = BaseClient<>>
cxx::expected< ClientSendError > iox::popo::ClientImpl< Req, Res, BaseClientT >::send ( Request< Req > &&  request)
overridenoexcept

Sends the given Request and then releases its loan.

Parameters
requestto send.
Returns
Error if sending was not successful

◆ take()

template<typename Req , typename Res , typename BaseClientT = BaseClient<>>
cxx::expected< Response< const Res >, ChunkReceiveResult > iox::popo::ClientImpl< Req, Res, BaseClientT >::take ( )
noexcept

Take the Response from the top of the receive queue.

Returns
Either a Response or a ChunkReceiveResult.

The Response takes care of the cleanup. Don't store the raw pointer to the content of the Response, but always the whole Response.


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