iceoryx_doc
1.0.1
|
The ServerPortUser provides the API for accessing a server port from the user side. The server port is divided in the three parts ServerPortData, ServerPortRouDi and ServerPortUser. The ServerPortUser uses the functionality of a ChunkSender and ChunReceiver for receiving requests and sending responses. Additionally it provides the offer / stopOffer API which controls whether the server is discoverable for client ports. More...
#include <server_port_user.hpp>
Public Types | |
using | MemberType_t = ServerPortData |
![]() | |
using | MemberType_t = BasePortData |
Public Member Functions | |
ServerPortUser (cxx::not_null< MemberType_t *const > serverPortDataPtr) noexcept | |
ServerPortUser (const ServerPortUser &other)=delete | |
ServerPortUser & | operator= (const ServerPortUser &)=delete |
ServerPortUser (ServerPortUser &&rhs)=default | |
ServerPortUser & | operator= (ServerPortUser &&rhs)=default |
cxx::expected< cxx::optional< const RequestHeader * >, ChunkReceiveResult > | getRequest () noexcept |
Tries to get the next request from the queue. If there is a new one, the ChunkHeader of the oldest request in the queue is returned (FiFo queue) More... | |
void | releaseRequest (const RequestHeader *const requestHeader) noexcept |
Release a request that was obtained with getRequest. More... | |
bool | hasNewRequests () const noexcept |
check if there are requests in the queue More... | |
bool | hasLostRequestsSinceLastCall () noexcept |
check if there was a queue overflow since the last call of hasLostRequestsSinceLastCall More... | |
cxx::expected< ResponseHeader *, AllocationError > | allocateResponse (const uint32_t userPayloadSize) noexcept |
Allocate a response, the ownerhip of the SharedChunk remains in the ServerPortUser for being able to cleanup if the user process disappears. More... | |
void | freeResponse (ResponseHeader *const responseHeader) noexcept |
Free an allocated response without sending it. More... | |
void | sendResponse (ResponseHeader *const responseHeader) noexcept |
Send an allocated request chunk to the server port. More... | |
void | offer () noexcept |
offer this server port in the system | |
void | stopOffer () noexcept |
stop offering this server port, all clients will be disconnected from this server | |
bool | isOffered () const noexcept |
Checks whether the server port is currently offered. More... | |
bool | hasClients () const noexcept |
Checks whether there are currently clients connected to this server. More... | |
void | setConditionVariable (ConditionVariableData &conditionVariableData, const uint64_t notificationIndex) noexcept |
set a condition variable (via its pointer) to the client More... | |
void | unsetConditionVariable () noexcept |
unset a condition variable from the client | |
bool | isConditionVariableSet () const noexcept |
check if there's a condition variable set More... | |
![]() | |
BasePort (MemberType_t *const basePortDataPtr) noexcept | |
BasePort (const BasePort &other)=delete | |
BasePort & | operator= (const BasePort &)=delete |
BasePort (BasePort &&) noexcept | |
BasePort & | operator= (BasePort &&) noexcept |
operator bool () const noexcept | |
a port can be constructed from a nullptr, additionally it also can be moved and in these cases the member methods would work on a nullptr. to circumvent this problem More... | |
capro::ServiceDescription | getCaProServiceDescription () const noexcept |
Reads Type of actual CaPro Port (publisher/subscriber...) More... | |
RuntimeName_t | getRuntimeName () const noexcept |
Gets name of the application's runtime for the active port. More... | |
UniquePortId | getUniqueID () const noexcept |
Gets Id of the active port. More... | |
NodeName_t | getNodeName () const noexcept |
returns node name for the active port More... | |
void | destroy () noexcept |
Indicate that this port can be destroyed. | |
bool | toBeDestroyed () const noexcept |
Checks whether port can be destroyed. More... | |
Additional Inherited Members | |
![]() | |
const MemberType_t * | getMembers () const noexcept |
MemberType_t * | getMembers () noexcept |
The ServerPortUser provides the API for accessing a server port from the user side. The server port is divided in the three parts ServerPortData, ServerPortRouDi and ServerPortUser. The ServerPortUser uses the functionality of a ChunkSender and ChunReceiver for receiving requests and sending responses. Additionally it provides the offer / stopOffer API which controls whether the server is discoverable for client ports.
|
noexcept |
Allocate a response, the ownerhip of the SharedChunk remains in the ServerPortUser for being able to cleanup if the user process disappears.
[in] | userPayloadSize,size | of the user user-paylaod without additional headers |
|
noexcept |
Free an allocated response without sending it.
[in] | chunkHeader,pointer | to the ChunkHeader to free |
|
noexcept |
Tries to get the next request from the queue. If there is a new one, the ChunkHeader of the oldest request in the queue is returned (FiFo queue)
|
noexcept |
Checks whether there are currently clients connected to this server.
|
noexcept |
check if there was a queue overflow since the last call of hasLostRequestsSinceLastCall
|
noexcept |
check if there are requests in the queue
|
noexcept |
check if there's a condition variable set
|
noexcept |
Checks whether the server port is currently offered.
|
noexcept |
Release a request that was obtained with getRequest.
[in] | chunkHeader,pointer | to the ChunkHeader to release |
|
noexcept |
Send an allocated request chunk to the server port.
[in] | chunkHeader,pointer | to the ChunkHeader to send |
|
noexcept |
set a condition variable (via its pointer) to the client