Template Class BaseServer

Inheritance Relationships

Derived Types

Class Documentation

template<typename PortT = ServerPortUser, typename TriggerHandleT = TriggerHandle>
class BaseServer

The BaseServer class contains the common implementation for the different server.

Note

Not intended for public usage! Use the Server or UntypedServer instead!

Param PortT:

[in] type of the underlying port, required for testing specializations.

Param TriggerHandleT:

[in] type of the underlying trigger handle, required for testing

Subclassed by iox::popo::ServerImpl< Req, Res, BaseServerT >, iox::popo::UntypedServerImpl< BaseServerT >

Public Functions

virtual ~BaseServer() noexcept
BaseServer(const BaseServer &other) = delete
BaseServer &operator=(const BaseServer&) = delete
BaseServer(BaseServer &&rhs) = delete
BaseServer &operator=(BaseServer &&rhs) = delete
uid_t getUid() const noexcept

Get the UID of the server.

Returns:

The server’s UID.

const capro::ServiceDescription &getServiceDescription() const noexcept

Get the service description of the server.

Returns:

A reference to the service description.

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.

Returns:

True if service is currently being offered.

bool hasClients() const noexcept

Check if the server has clients.

Returns:

True if currently has subscribers to the service.

bool hasRequests() const noexcept

Check if requests are available.

Returns:

True if requests are available.

bool hasMissedRequests() noexcept

Check if requests has been missed since the last call of this method.

Requests may be missed due to overflowing receive queue.

Returns:

True if requests has been missed.

void releaseQueuedRequests() noexcept

Releases any unread queued requests.

Protected Types

using SelfType = BaseServer<PortT, TriggerHandleT>
using PortType = PortT

Protected Functions

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.

Parameters:

uniqueTriggerId[in] the id of the corresponding trigger

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.

Parameters:
  • triggerHandle[in] rvalue reference to the triggerHandle. This class takes the ownership of that handle.

  • serverState[in] the state which should be attached

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.

Parameters:

serverState[in] the state to which the hasTriggeredCallback is required

void disableState(const ServerState serverState) noexcept

Only usable by the WaitSet/Listener, not for public use. Resets the internal triggerHandle.

Parameters:

serverState[in] the state which should be detached

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.

Parameters:
  • triggerHandle[in] rvalue reference to the triggerHandle. This class takes the ownership of that handle.

  • serverEvent[in] the event which should be attached

void disableEvent(const ServerEvent serverEvent) noexcept

Only usable by the WaitSet/Listener, not for public use. Resets the internal triggerHandle.

Parameters:

serverEvent[in] the event which should be detached

const PortT &port() const noexcept

port

Returns:

const accessor of the underlying port

PortT &port() noexcept

port

Returns:

accessor of the underlying port

Protected Attributes

PortT m_port
TriggerHandleT m_trigger

Friends

friend class NotificationAttorney