Class RouDi

Nested Relationships

Nested Types

Class Documentation

class RouDi

Public Types

enum class RuntimeMessagesThreadStart

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.

Values:

enumerator IMMEDIATE
enumerator DEFER_START

Public Functions

RouDi &operator=(const RouDi &other) = delete
RouDi(const RouDi &other) = delete
RouDi(RouDiMemoryInterface &roudiMemoryInterface, PortManager &portManager, RoudiStartupParameters roudiStartupParameters) noexcept
virtual ~RouDi() noexcept

Protected Functions

void startProcessRuntimeMessagesThread() noexcept

Starts the thread processing messages from the runtimes Once this is done, applications can register and Roudi is fully operational.

void shutdown() noexcept

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

virtual void processMessage(const runtime::IpcMessage &message, const iox::runtime::IpcMessageType &cmd, const RuntimeName_t &runtimeName) noexcept
virtual void cyclicUpdateHook() noexcept
void IpcMessageErrorHandler() noexcept
version::VersionInfo parseRegisterMessage(const runtime::IpcMessage &message, uint32_t &pid, uid_t &userId, int64_t &transmissionTimestamp) noexcept
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) noexcept

Handles the registration request from process.

Parameters:
  • name[in] of the process which wants to register at roudi; this is equal to the IPC channel name

  • pid[in] is the host system process id

  • user[in] is the posix user id to which the process belongs

  • transmissionTimestamp[in] is an ID for the application to check for the expected response

  • sessionId[in] is an ID generated by RouDi to prevent sending outdated IPC channel transmission

  • versionInfo[in] Version of iceoryx used

Protected Attributes

RouDiMemoryInterface *m_roudiMemoryInterface = {nullptr}
cxx::GenericRAII m_roudiMemoryManagerCleaner  {[]() {},[this]() {if (this->m_roudiMemoryInterface->destroyMemory().has_error()){LogWarn() << "unable to cleanup roudi memory interface";};}}

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

PortManager *m_portManager = {nullptr}
concurrent::smart_lock<ProcessManager> m_prcMgr
ProcessIntrospectionType m_processIntrospection
MemPoolIntrospectionType m_mempoolIntrospection

Protected Static Functions

static uint64_t getUniqueSessionIdForProcess() noexcept

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

Returns:

a unique, monotonic and consecutive increasing number

struct RoudiStartupParameters

Public Functions

inline RoudiStartupParameters(const roudi::MonitoringMode monitoringMode = roudi::MonitoringMode::ON, const bool killProcessesInDestructor = true, const RuntimeMessagesThreadStart RuntimeMessagesThreadStart = RuntimeMessagesThreadStart::IMMEDIATE, const version::CompatibilityCheckLevel compatibilityCheckLevel = version::CompatibilityCheckLevel::PATCH, const units::Duration processKillDelay = roudi::PROCESS_DEFAULT_KILL_DELAY) noexcept

Public Members

const roudi::MonitoringMode m_monitoringMode
const bool m_killProcessesInDestructor
const RuntimeMessagesThreadStart m_runtimesMessagesThreadStart
const version::CompatibilityCheckLevel m_compatibilityCheckLevel
const units::Duration m_processKillDelay