UMPS
The University of Utah Seismograph Stations Message Passing System.
UMPS::Modules::ProcessManager Class Reference

This is a collection of processes. By adding processes to this module, all processes can be started and stopped by one utility. More...

#include "umps/modules/processManager.hpp"

Public Member Functions

void insert (std::unique_ptr< IProcess > &&process)
 Adds a process to the manager. More...
 
bool contains (const IProcess &process) const noexcept
 
bool contains (const std::string &name) const noexcept
 
void start ()
 Attempts to start all processes.
 
void handleMainThread ()
 The main thread waits until a stop command is issued by a process.
 
bool isRunning () const noexcept
 
void stop ()
 Attempts to stop all processes.
 
 ProcessManager (const ProcessManager &)=delete
 
ProcessManageroperator= (const ProcessManager &)=delete
 
Constructors
 ProcessManager ()
 Constructor.
 
 ProcessManager (std::shared_ptr< UMPS::Logging::ILog > &logger)
 Constructs a process manager with a given logger. More...
 
Destructors
 ~ProcessManager ()
 Destructor.
 

Detailed Description

This is a collection of processes. By adding processes to this module, all processes can be started and stopped by one utility.

Constructor & Destructor Documentation

◆ ProcessManager()

UMPS::Modules::ProcessManager::ProcessManager ( std::shared_ptr< UMPS::Logging::ILog > &  logger)
explicit

Constructs a process manager with a given logger.

Parameters
[in]loggerThe logger.

Member Function Documentation

◆ contains() [1/2]

bool UMPS::Modules::ProcessManager::contains ( const IProcess process) const
noexcept
Returns
True indicates the process exists.
Exceptions
std::invalid_argumentif process.getName() is not set.

◆ contains() [2/2]

bool UMPS::Modules::ProcessManager::contains ( const std::string &  name) const
noexcept
Returns
True idicates the process exists.

◆ insert()

void UMPS::Modules::ProcessManager::insert ( std::unique_ptr< IProcess > &&  process)

Adds a process to the manager.

Parameters
[in,out]processThe process to bring under process management. Note, this class takes ownership or process. Therefore, processes's behavior on exit is undefined.
Exceptions
std::invalid_argumentif exists(process) is true;

◆ isRunning()

bool UMPS::Modules::ProcessManager::isRunning ( ) const
noexcept
Returns
True indicates the processes are running.

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