iceoryx_doc  1.0.1
Classes | Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
iox::roudi::RouDi Class Reference
Collaboration diagram for iox::roudi::RouDi:
Collaboration graph
[legend]

Classes

struct  RoudiStartupParameters
 

Public Types

enum class  RuntimeMessagesThreadStart { IMMEDIATE , DEFER_START }
 Indicate whether the thread processing messages from the runtimes will start directly or deferred this is important for derived classes which may need to initialize their members before the thread starts.
 

Public Member Functions

RouDioperator= (const RouDi &other)=delete
 
 RouDi (const RouDi &other)=delete
 
 RouDi (RouDiMemoryInterface &roudiMemoryInteface, PortManager &portManager, RoudiStartupParameters roudiStartupParameters)
 

Protected Member Functions

void startProcessRuntimeMessagesThread ()
 Starts the thread processing messages from the runtimes Once this is done, applications can register and Roudi is fully operational.
 
void shutdown ()
 Stops threads and kills all process known to RouDi Called in d'tor. More...
 
virtual void processMessage (const runtime::IpcMessage &message, const iox::runtime::IpcMessageType &cmd, const RuntimeName_t &runtimeName)
 
virtual void cyclicUpdateHook ()
 
void IpcMessageErrorHandler ()
 
version::VersionInfo parseRegisterMessage (const runtime::IpcMessage &message, uint32_t &pid, uid_t &userId, int64_t &transmissionTimestamp)
 
void registerProcess (const RuntimeName_t &name, const uint32_t pid, const posix::PosixUser user, const int64_t transmissionTimestamp, const uint64_t sessionId, const version::VersionInfo &versionInfo)
 Handles the registration request from process. More...
 

Static Protected Member Functions

static uint64_t getUniqueSessionIdForProcess ()
 Creates a unique ID which can be used to check outdated IPC channel transmissions. More...
 

Protected Attributes

RouDiMemoryInterfacem_roudiMemoryInterface {nullptr}
 
cxx::GenericRAII m_roudiMemoryManagerCleaner
 
PortManagerm_portManager {nullptr}
 
concurrent::smart_lock< ProcessManagerm_prcMgr
 
ProcessIntrospectionType m_processIntrospection
 
MemPoolIntrospectionType m_mempoolIntrospection
 

Member Function Documentation

◆ getUniqueSessionIdForProcess()

static uint64_t iox::roudi::RouDi::getUniqueSessionIdForProcess ( )
staticprotected

Creates a unique ID which can be used to check outdated IPC channel transmissions.

Returns
a unique, monotonic and consecutive increasing number

◆ registerProcess()

void iox::roudi::RouDi::registerProcess ( const RuntimeName_t &  name,
const uint32_t  pid,
const posix::PosixUser  user,
const int64_t  transmissionTimestamp,
const uint64_t  sessionId,
const version::VersionInfo &  versionInfo 
)
protected

Handles the registration request from process.

Parameters
[in]nameof the process which wants to register at roudi; this is equal to the IPC channel name
[in]pidis the host system process id
[in]useris the posix user id to which the process belongs
[in]transmissionTimestampis an ID for the application to check for the expected response
[in]sessionIdis an ID generated by RouDi to prevent sending outdated IPC channel transmission
[in]versionInfoVersion of iceoryx used

◆ shutdown()

void iox::roudi::RouDi::shutdown ( )
protected

Stops threads and kills all process known to RouDi Called in d'tor.

Note
Intentionally not virtual to be able to call it in derived class

Member Data Documentation

◆ m_roudiMemoryManagerCleaner

cxx::GenericRAII iox::roudi::RouDi::m_roudiMemoryManagerCleaner
protected
Initial value:
{[]() {},
[this]() {
if (this->m_roudiMemoryInterface->destroyMemory().has_error())
{
LogWarn() << "unable to cleanup roudi memory interface";
};
}}
virtual cxx::expected< RouDiMemoryManagerError > destroyMemory() noexcept=0
The RouDiMemoryManager calls the the MemoryProvider to destroy the memory, which in turn prompts the ...
Note
destroy the memory right at the end of the dTor, since the memory is not needed anymore and we know that the lifetime of the MemoryBlocks must be at least as long as RouDi; this saves us from issues if the RouDiMemoryManager outlives some MemoryBlocks

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