iceoryx_posh 2.0.3
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
iox::popo::BaseServer< PortT, TriggerHandleT > Class Template Reference

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

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

Inheritance diagram for iox::popo::BaseServer< PortT, TriggerHandleT >:
Inheritance graph
[legend]
Collaboration diagram for iox::popo::BaseServer< PortT, TriggerHandleT >:
Collaboration graph
[legend]

Public Member Functions

 BaseServer (const BaseServer &other)=delete
 
BaseServeroperator= (const BaseServer &)=delete
 
 BaseServer (BaseServer &&rhs)=delete
 
BaseServeroperator= (BaseServer &&rhs)=delete
 
uid_t getUid () const noexcept
 Get the UID of the server. More...
 
const capro::ServiceDescriptiongetServiceDescription () const noexcept
 Get the service description of the server. More...
 
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. More...
 
bool hasClients () const noexcept
 Check if the server has clients. More...
 
bool hasRequests () const noexcept
 Check if requests are available. More...
 
bool hasMissedRequests () noexcept
 Check if requests has been missed since the last call of this method. More...
 
void releaseQueuedRequests () noexcept
 Releases any unread queued requests.
 

Protected Types

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

Protected Member 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. More...
 
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. More...
 
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. More...
 
void disableState (const ServerState serverState) noexcept
 Only usable by the WaitSet/Listener, not for public use. Resets the internal triggerHandle. More...
 
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. More...
 
void disableEvent (const ServerEvent serverEvent) noexcept
 Only usable by the WaitSet/Listener, not for public use. Resets the internal triggerHandle. More...
 
const PortT & port () const noexcept
 port More...
 
PortT & port () noexcept
 port More...
 

Protected Attributes

PortT m_port
 
TriggerHandleT m_trigger
 

Friends

class NotificationAttorney
 

Detailed Description

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

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

Parameters
[in]PortTtype of the underlying port, required for testing specializations.
[in]TriggerHandleTtype of the underlying trigger handle, required for testing
Note
Not intended for public usage! Use the Server or UntypedServer instead!

Member Function Documentation

◆ disableEvent()

template<typename PortT = ServerPortUser, typename TriggerHandleT = TriggerHandle>
void iox::popo::BaseServer< PortT, TriggerHandleT >::disableEvent ( const ServerEvent  serverEvent)
protectednoexcept

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

Parameters
[in]serverEventthe event which should be detached

◆ disableState()

template<typename PortT = ServerPortUser, typename TriggerHandleT = TriggerHandle>
void iox::popo::BaseServer< PortT, TriggerHandleT >::disableState ( const ServerState  serverState)
protectednoexcept

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

Parameters
[in]serverStatethe state which should be detached

◆ enableEvent()

template<typename PortT = ServerPortUser, typename TriggerHandleT = TriggerHandle>
void iox::popo::BaseServer< PortT, TriggerHandleT >::enableEvent ( TriggerHandleT &&  triggerHandle,
const ServerEvent  serverEvent 
)
protectednoexcept

Only usable by the WaitSet/Listener, not for public use. Attaches the triggerHandle to the internal trigger.

Parameters
[in]triggerHandlervalue reference to the triggerHandle. This class takes the ownership of that handle.
[in]serverEventthe event which should be attached

◆ enableState()

template<typename PortT = ServerPortUser, typename TriggerHandleT = TriggerHandle>
void iox::popo::BaseServer< PortT, TriggerHandleT >::enableState ( TriggerHandleT &&  triggerHandle,
const ServerState  serverState 
)
protectednoexcept

Only usable by the WaitSet/Listener, not for public use. Attaches the triggerHandle to the internal trigger.

Parameters
[in]triggerHandlervalue reference to the triggerHandle. This class takes the ownership of that handle.
[in]serverStatethe state which should be attached

◆ getCallbackForIsStateConditionSatisfied()

template<typename PortT = ServerPortUser, typename TriggerHandleT = TriggerHandle>
WaitSetIsConditionSatisfiedCallback iox::popo::BaseServer< PortT, TriggerHandleT >::getCallbackForIsStateConditionSatisfied ( const ServerState  serverState) const
protectednoexcept

Only usable by the WaitSet/Listener, not for public use. Returns method pointer to the event corresponding hasTriggered method callback.

Parameters
[in]serverStatethe state to which the hasTriggeredCallback is required

◆ getServiceDescription()

template<typename PortT = ServerPortUser, typename TriggerHandleT = TriggerHandle>
const capro::ServiceDescription & iox::popo::BaseServer< PortT, TriggerHandleT >::getServiceDescription ( ) const
noexcept

Get the service description of the server.

Returns
A reference to the service description.

◆ getUid()

template<typename PortT = ServerPortUser, typename TriggerHandleT = TriggerHandle>
uid_t iox::popo::BaseServer< PortT, TriggerHandleT >::getUid ( ) const
noexcept

Get the UID of the server.

Returns
The server's UID.

◆ hasClients()

template<typename PortT = ServerPortUser, typename TriggerHandleT = TriggerHandle>
bool iox::popo::BaseServer< PortT, TriggerHandleT >::hasClients ( ) const
noexcept

Check if the server has clients.

Returns
True if currently has subscribers to the service.

◆ hasMissedRequests()

template<typename PortT = ServerPortUser, typename TriggerHandleT = TriggerHandle>
bool iox::popo::BaseServer< PortT, TriggerHandleT >::hasMissedRequests ( )
noexcept

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

Returns
True if requests has been missed.

Requests may be missed due to overflowing receive queue.

◆ hasRequests()

template<typename PortT = ServerPortUser, typename TriggerHandleT = TriggerHandle>
bool iox::popo::BaseServer< PortT, TriggerHandleT >::hasRequests ( ) const
noexcept

Check if requests are available.

Returns
True if requests are available.

◆ invalidateTrigger()

template<typename PortT = ServerPortUser, typename TriggerHandleT = TriggerHandle>
void iox::popo::BaseServer< PortT, TriggerHandleT >::invalidateTrigger ( const uint64_t  uniqueTriggerId)
protectednoexcept

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

Parameters
[in]uniqueTriggerIdthe id of the corresponding trigger

◆ isOffered()

template<typename PortT = ServerPortUser, typename TriggerHandleT = TriggerHandle>
bool iox::popo::BaseServer< PortT, TriggerHandleT >::isOffered ( ) const
noexcept

Check if the server is offering.

Returns
True if service is currently being offered.

◆ port() [1/2]

template<typename PortT = ServerPortUser, typename TriggerHandleT = TriggerHandle>
const PortT & iox::popo::BaseServer< PortT, TriggerHandleT >::port ( ) const
protectednoexcept

port

Returns
const accessor of the underlying port

◆ port() [2/2]

template<typename PortT = ServerPortUser, typename TriggerHandleT = TriggerHandle>
PortT & iox::popo::BaseServer< PortT, TriggerHandleT >::port ( )
protectednoexcept

port

Returns
accessor of the underlying port

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