iox::popo::ClientImpl🔗
The ClientImpl class implements the typed client API. More...
#include <iceoryx_posh/internal/popo/client_impl.hpp>
Inherits from iox::popo::BaseClient<>, iox::popo::RpcInterface< Request< Req >, ClientSendError >
Public Functions🔗
Name | |
---|---|
ClientImpl(const capro::ServiceDescription & service, const ClientOptions & clientOptions ={}) Constructor for a client. |
|
virtual | ~ClientImpl() |
ClientImpl(const ClientImpl & ) | |
ClientImpl(ClientImpl && ) | |
ClientImpl & | operator=(const ClientImpl & ) |
ClientImpl & | operator=(ClientImpl && ) |
template <typename... Args> cxx::expected< Request< Req >, AllocationError > |
loan(Args &&... args) Get a Request from loaned shared memory and construct the data with the given arguments. |
cxx::expected< ClientSendError > | send(Request< Req > && request) override Sends the given Request and then releases its loan. |
cxx::expected< Response< const Res >, ChunkReceiveResult > | take() Take the Response from the top of the receive queue. |
Additional inherited members🔗
Protected Types inherited from iox::popo::BaseClient<>
Name | |
---|---|
using BaseClient< PortT, TriggerHandleT > | SelfType |
using PortT | PortType |
Public Functions inherited from iox::popo::BaseClient<>
Name | |
---|---|
virtual | ~BaseClient() |
BaseClient(const BaseClient & other) | |
BaseClient(BaseClient && rhs) | |
uid_t | getUid() const Get the unique ID of the client. |
const capro::ServiceDescription & | getServiceDescription() const Get the service description of the client. |
void | connect() Initiate connection to server when not already connected, otherwise nothing. |
ConnectionState | getConnectionState() const Get current connection state. |
void | disconnect() Disconnects when already connected, otherwise nothing. |
bool | hasResponses() const Check if response are available. |
bool | hasMissedResponses() Check if response has been missed since the last call of this method. |
void | releaseQueuedResponses() Releases any unread queued response. |
Protected Functions inherited from iox::popo::BaseClient<>
Name | |
---|---|
BaseClient(const capro::ServiceDescription & service, const ClientOptions & clientOptions) | |
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 ClientState clientState) Only usable by the WaitSet/Listener, not for public use. Attaches the triggerHandle to the internal trigger. |
WaitSetIsConditionSatisfiedCallback | getCallbackForIsStateConditionSatisfied(const ClientState clientState) const 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) Only usable by the WaitSet/Listener, not for public use. Resets the internal triggerHandle. |
void | enableEvent(TriggerHandleT && triggerHandle, const ClientEvent clientEvent) Only usable by the WaitSet/Listener, not for public use. Attaches the triggerHandle to the internal trigger. |
void | disableEvent(const ClientEvent clientEvent) Only usable by the WaitSet/Listener, not for public use. Resets the internal triggerHandle. |
const PortT & | port() const const accessor of the underlying port |
PortT & | port() accessor of the underlying port |
Protected Attributes inherited from iox::popo::BaseClient<>
Name | |
---|---|
PortT | m_port |
TriggerHandleT | m_trigger |
Friends inherited from iox::popo::BaseClient<>
Name | |
---|---|
class | NotificationAttorney |
Detailed Description🔗
template <typename Req ,
typename Res ,
typename BaseClientT =BaseClient<>>
class iox::popo::ClientImpl;
The ClientImpl class implements the typed client API.
Note: Not intended for public usage! Use the [Client](/v2.0.5/API-reference/posh/Classes/classiox_1_1popo_1_1Client/)
instead!
Public Functions Documentation🔗
function ClientImpl🔗
explicit ClientImpl(
const capro::ServiceDescription & service,
const ClientOptions & clientOptions ={}
)
Constructor for a client.
Parameters:
- service is the ServiceDescription for the new client
- clientOptions like the queue capacity and queue full policy by a client
function ~ClientImpl🔗
virtual ~ClientImpl()
function ClientImpl🔗
ClientImpl(
const ClientImpl &
)
function ClientImpl🔗
ClientImpl(
ClientImpl &&
)
function operator=🔗
ClientImpl & operator=(
const ClientImpl &
)
function operator=🔗
ClientImpl & operator=(
ClientImpl &&
)
function loan🔗
template <typename... Args>
cxx::expected< Request< Req >, AllocationError > loan(
Args &&... args
)
Get a Request from loaned shared memory and construct the data with the given arguments.
Parameters:
- args Arguments used to construct the data.
Return: 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.
function send🔗
cxx::expected< ClientSendError > send(
Request< Req > && request
) override
Sends the given Request and then releases its loan.
Parameters:
- request to send.
Return: Error if sending was not successful
function take🔗
cxx::expected< Response< const Res >, ChunkReceiveResult > take()
Take the Response from the top of the receive queue.
Return: 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.
Updated on 18 December 2023 at 13:11:43 CET