Template Class ProcessIntrospection

Class Documentation

template<typename PublisherPort>
class ProcessIntrospection

This class handles the process intropection for RouDi. It is recommended to use the ProcessIntrospectionType alias which sets the intended template parameter. The class tracks the adding and removal of processes and sends it to the introspection client if subscribed.

Public Functions

ProcessIntrospection() noexcept
~ProcessIntrospection() noexcept
ProcessIntrospection(ProcessIntrospection const&) = delete
ProcessIntrospection &operator=(ProcessIntrospection const&) = delete
ProcessIntrospection(ProcessIntrospection&&) = delete
ProcessIntrospection &operator=(ProcessIntrospection&&) = delete
void addProcess(const int pid, const RuntimeName_t &name) noexcept

This function is used to add a process to the process introspection.

Parameters:
  • pid[in] is the PID of the process to add

  • name[in] is the name of the process

void removeProcess(const int pid) noexcept

This function is used to remove the process from the process introspection.

Parameters:

pid[in] is the PID of the process to remove

void addNode(const RuntimeName_t &runtimeName, const NodeName_t &node) noexcept

This function is used to add a node to the process introspection.

Parameters:
  • runtimeName[in] is the name of the proces

  • nodeName[in] is the name of the node to add

void removeNode(const RuntimeName_t &runtimeName, const NodeName_t &node) noexcept

This function is used to remove a node from the process introspection.

Parameters:
  • runtimeName[in] is the name of the proces

  • nodeName[in] is the name of the node to remove

void registerPublisherPort(PublisherPort &&publisherPort) noexcept

This functions registers the POSH publisher port which is used to send the data to the instrospcetion client.

Parameters:

publisherPort – is the publisher port for transmission

void run() noexcept

This function starts a thread which periodically sends the introspection data to the client. The send interval can be set by setSendInterval(…). Before this function is called, the publisher port hast to be registered with registerPublisherPort().

void stop() noexcept

This function stops the thread previously started by run().

void setSendInterval(const units::Duration interval) noexcept

This function configures the interval for the transmission of the port introspection data.

Parameters:

interval[in] duration between two send invocations.

Protected Functions

void send() noexcept

Protected Attributes

cxx::optional<PublisherPort> m_publisherPort