iceoryx_posh 2.0.3
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
iox::runtime::PoshRuntime Class Referenceabstract

The runtime that is needed for each application to communicate with the RouDi daemon. More...

#include <iceoryx_posh/runtime/posh_runtime.hpp>

Public Member Functions

 PoshRuntime (const PoshRuntime &)=delete
 
PoshRuntimeoperator= (const PoshRuntime &)=delete
 
 PoshRuntime (PoshRuntime &&)=delete
 
PoshRuntimeoperator= (PoshRuntime &&)=delete
 
RuntimeName_t getInstanceName () const noexcept
 get the name that was used to register with RouDi More...
 
void shutdown () noexcept
 initiates the shutdown of the runtime to unblock all potentially blocking publisher with the ConsumerTooSlowPolicy::WAIT_FOR_CONSUMER option set
 
virtual PublisherPortUserType::MemberType_t * getMiddlewarePublisher (const capro::ServiceDescription &service, const popo::PublisherOptions &publisherOptions={}, const PortConfigInfo &portConfigInfo={}) noexcept=0
 request the RouDi daemon to create a publisher port More...
 
virtual SubscriberPortUserType::MemberType_t * getMiddlewareSubscriber (const capro::ServiceDescription &service, const popo::SubscriberOptions &subscriberOptions={}, const PortConfigInfo &portConfigInfo={}) noexcept=0
 request the RouDi daemon to create a subscriber port More...
 
virtual popo::ClientPortData * getMiddlewareClient (const capro::ServiceDescription &service, const popo::ClientOptions &clientOptions={}, const PortConfigInfo &portConfigInfo=PortConfigInfo()) noexcept=0
 request the RouDi daemon to create a client port More...
 
virtual popo::ServerPortData * getMiddlewareServer (const capro::ServiceDescription &service, const popo::ServerOptions &serverOptions={}, const PortConfigInfo &portConfigInfo=PortConfigInfo()) noexcept=0
 request the RouDi daemon to create a server port More...
 
virtual popo::InterfacePortData * getMiddlewareInterface (const capro::Interfaces interface, const NodeName_t &nodeName={}) noexcept=0
 request the RouDi daemon to create an interface port More...
 
virtual popo::ConditionVariableData * getMiddlewareConditionVariable () noexcept=0
 request the RouDi daemon to create a condition variable More...
 
virtual NodeData * createNode (const NodeProperty &nodeProperty) noexcept=0
 request the RouDi daemon to create a node More...
 
virtual bool sendRequestToRouDi (const IpcMessage &msg, IpcMessage &answer) noexcept=0
 send a request to the RouDi daemon and get the response currently each request is followed by a response More...
 

Static Public Member Functions

static PoshRuntimegetInstance () noexcept
 returns active runtime More...
 
static PoshRuntimeinitRuntime (const RuntimeName_t &name) noexcept
 creates the runtime with given name More...
 

Protected Types

using factory_t = PoshRuntime &(*)(cxx::optional< const RuntimeName_t * >)
 

Protected Member Functions

 PoshRuntime (cxx::optional< const RuntimeName_t * > name) noexcept
 
const RuntimeName_t & verifyInstanceName (cxx::optional< const RuntimeName_t * > name) noexcept
 checks the given application name for certain constraints like length or if is empty
 

Static Protected Member Functions

static PoshRuntimedefaultRuntimeFactory (cxx::optional< const RuntimeName_t * > name) noexcept
 
static factory_t & getRuntimeFactory () noexcept
 gets current runtime factory. If the runtime factory is not yet initialized it is set to defaultRuntimeFactory. More...
 
static void setRuntimeFactory (const factory_t &factory) noexcept
 sets runtime factory, terminates if given factory is empty More...
 
static PoshRuntimegetInstance (cxx::optional< const RuntimeName_t * > name) noexcept
 creates the runtime or returns the already existing one -> Singleton More...
 

Protected Attributes

const RuntimeName_t m_appName
 
std::atomic< bool > m_shutdownRequested {false}
 

Friends

class roudi::RuntimeTestInterface
 

Detailed Description

The runtime that is needed for each application to communicate with the RouDi daemon.

Member Function Documentation

◆ createNode()

virtual NodeData * iox::runtime::PoshRuntime::createNode ( const NodeProperty &  nodeProperty)
pure virtualnoexcept

request the RouDi daemon to create a node

Parameters
[in]nodePropertyclass which contains all properties which the node should have
Returns
pointer to the data of the node

◆ getInstance() [1/2]

static PoshRuntime & iox::runtime::PoshRuntime::getInstance ( )
staticnoexcept

returns active runtime

Returns
active runtime

◆ getInstance() [2/2]

static PoshRuntime & iox::runtime::PoshRuntime::getInstance ( cxx::optional< const RuntimeName_t * >  name)
staticprotectednoexcept

creates the runtime or returns the already existing one -> Singleton

Parameters
[in]nameoptional containing the name used for registering with the RouDi daemon
Returns
active runtime

◆ getInstanceName()

RuntimeName_t iox::runtime::PoshRuntime::getInstanceName ( ) const
noexcept

get the name that was used to register with RouDi

Returns
name of the registered application

◆ getMiddlewareClient()

virtual popo::ClientPortData * iox::runtime::PoshRuntime::getMiddlewareClient ( const capro::ServiceDescription service,
const popo::ClientOptions clientOptions = {},
const PortConfigInfo portConfigInfo = PortConfigInfo() 
)
pure virtualnoexcept

request the RouDi daemon to create a client port

Parameters
[in]serviceDescriptionservice description for the new client port
[in]clientOptionslike the queue capacity and queue full policy by a client
[in]portConfigInfoconfiguration information for the port (what type of port is requested, device where its payload memory is located on etc.)
Returns
pointer to a created client port data

◆ getMiddlewareConditionVariable()

virtual popo::ConditionVariableData * iox::runtime::PoshRuntime::getMiddlewareConditionVariable ( )
pure virtualnoexcept

request the RouDi daemon to create a condition variable

Returns
pointer to a created condition variable data

◆ getMiddlewareInterface()

virtual popo::InterfacePortData * iox::runtime::PoshRuntime::getMiddlewareInterface ( const capro::Interfaces  interface,
const NodeName_t &  nodeName = {} 
)
pure virtualnoexcept

request the RouDi daemon to create an interface port

Parameters
[in]interfaceinterface to create
[in]nodeNamename of the node where the interface should belong to
Returns
pointer to a created interface port data

◆ getMiddlewarePublisher()

virtual PublisherPortUserType::MemberType_t * iox::runtime::PoshRuntime::getMiddlewarePublisher ( const capro::ServiceDescription service,
const popo::PublisherOptions publisherOptions = {},
const PortConfigInfo portConfigInfo = {} 
)
pure virtualnoexcept

request the RouDi daemon to create a publisher port

Parameters
[in]serviceDescriptionservice description for the new publisher port
[in]publisherOptionslike the history capacity of a publisher
[in]portConfigInfoconfiguration information for the port (i.e. what type of port is requested, device where its payload memory is located on etc.)
Returns
pointer to a created publisher port user

◆ getMiddlewareServer()

virtual popo::ServerPortData * iox::runtime::PoshRuntime::getMiddlewareServer ( const capro::ServiceDescription service,
const popo::ServerOptions serverOptions = {},
const PortConfigInfo portConfigInfo = PortConfigInfo() 
)
pure virtualnoexcept

request the RouDi daemon to create a server port

Parameters
[in]serviceDescriptionservice description for the new server port
[in]serverOptionslike the queue capacity and queue full policy by a server
[in]portConfigInfoconfiguration information for the port (what type of port is requested, device where its payload memory is located on etc.)
Returns
pointer to a created server port data

◆ getMiddlewareSubscriber()

virtual SubscriberPortUserType::MemberType_t * iox::runtime::PoshRuntime::getMiddlewareSubscriber ( const capro::ServiceDescription service,
const popo::SubscriberOptions subscriberOptions = {},
const PortConfigInfo portConfigInfo = {} 
)
pure virtualnoexcept

request the RouDi daemon to create a subscriber port

Parameters
[in]serviceDescriptionservice description for the new subscriber port
[in]subscriberOptionslike the queue capacity and history requested by a subscriber
[in]portConfigInfoconfiguration information for the port (what type of port is requested, device where its payload memory is located on etc.)
Returns
pointer to a created subscriber port data

◆ getRuntimeFactory()

static factory_t & iox::runtime::PoshRuntime::getRuntimeFactory ( )
staticprotectednoexcept

gets current runtime factory. If the runtime factory is not yet initialized it is set to defaultRuntimeFactory.

Returns
current runtime factory

◆ initRuntime()

static PoshRuntime & iox::runtime::PoshRuntime::initRuntime ( const RuntimeName_t &  name)
staticnoexcept

creates the runtime with given name

Parameters
[in]nameused for registering the process with the RouDi daemon
Returns
active runtime

◆ sendRequestToRouDi()

virtual bool iox::runtime::PoshRuntime::sendRequestToRouDi ( const IpcMessage &  msg,
IpcMessage &  answer 
)
pure virtualnoexcept

send a request to the RouDi daemon and get the response currently each request is followed by a response

Parameters
[in]msgrequest message to send
[out]responsefrom the RouDi daemon
Returns
true if sucessful request/response, false on error

◆ setRuntimeFactory()

static void iox::runtime::PoshRuntime::setRuntimeFactory ( const factory_t &  factory)
staticprotectednoexcept

sets runtime factory, terminates if given factory is empty

Parameters
[in]factorystd::function to which the runtime factory should be set

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