Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitk::ProcessExecutor Class Reference

You may register an observer for an ExternalProcessOutputEvent, ExternalProcessStdOutEvent or ExternalProcessStdErrEvent in order to get notified of any output. More...

#include <mitkProcessExecutor.h>

Inheritance diagram for mitk::ProcessExecutor:
Collaboration diagram for mitk::ProcessExecutor:

Public Types

using Self = ProcessExecutor
 
using Superclass = ::itk::Object
 
using Pointer = ::itk::SmartPointer< Self >
 
using ConstPointer = ::itk::SmartPointer< const Self >
 
using ArgumentListType = std::vector< std::string >
 

Public Member Functions

virtual const char * GetClassName () const
 
virtual void SetSharedOutputPipes (bool _arg)
 
virtual bool GetSharedOutputPipes () const
 
bool Execute (const std::string &executionPath, const std::string &executableName, ArgumentListType &argumentList)
 
virtual bool Execute (const std::string &executionPath, const ArgumentListType &argumentList)
 Executes the process. This version assumes that the executable name is the first argument in the argument list and has already been converted to its OS dependent name via the static convert function of this class. More...
 
int GetExitValue ()
 
void KillProcess ()
 

Static Public Member Functions

static Pointer New ()
 
static std::string EnsureCorrectOSPathSeparator (const std::string &)
 
static std::string GetOSDependendExecutableName (const std::string &name)
 

Protected Member Functions

 ProcessExecutor ()
 
 ~ProcessExecutor () override
 

Protected Attributes

int m_ExitValue
 
bool m_SharedOutputPipes
 Specifies if the child process should share the output pipes (true) or not (false). If pipes are not shared the output will be passed by invoking ExternalProcessOutputEvents. More...
 

Detailed Description

You may register an observer for an ExternalProcessOutputEvent, ExternalProcessStdOutEvent or ExternalProcessStdErrEvent in order to get notified of any output.

Remarks
The events will only be invoked if the pipes are NOT(!) shared. By default the pipes are not shared.

Definition at line 67 of file mitkProcessExecutor.h.

Member Typedef Documentation

◆ ArgumentListType

using mitk::ProcessExecutor::ArgumentListType = std::vector<std::string>

Definition at line 81 of file mitkProcessExecutor.h.

◆ ConstPointer

◆ Pointer

◆ Self

◆ Superclass

using mitk::ProcessExecutor::Superclass = ::itk::Object

Definition at line 71 of file mitkProcessExecutor.h.

Constructor & Destructor Documentation

◆ ProcessExecutor()

mitk::ProcessExecutor::ProcessExecutor ( )
protected

◆ ~ProcessExecutor()

mitk::ProcessExecutor::~ProcessExecutor ( )
overrideprotected

Member Function Documentation

◆ EnsureCorrectOSPathSeparator()

static std::string mitk::ProcessExecutor::EnsureCorrectOSPathSeparator ( const std::string &  )
static

◆ Execute() [1/2]

virtual bool mitk::ProcessExecutor::Execute ( const std::string &  executionPath,
const ArgumentListType argumentList 
)
virtual

Executes the process. This version assumes that the executable name is the first argument in the argument list and has already been converted to its OS dependent name via the static convert function of this class.

Reimplemented in mitk::SegmentAnythingProcessExecutor.

◆ Execute() [2/2]

bool mitk::ProcessExecutor::Execute ( const std::string &  executionPath,
const std::string &  executableName,
ArgumentListType argumentList 
)

◆ GetClassName()

virtual const char* mitk::ProcessExecutor::GetClassName ( ) const
virtual

◆ GetExitValue()

int mitk::ProcessExecutor::GetExitValue ( )

◆ GetOSDependendExecutableName()

static std::string mitk::ProcessExecutor::GetOSDependendExecutableName ( const std::string &  name)
static

◆ GetSharedOutputPipes()

virtual bool mitk::ProcessExecutor::GetSharedOutputPipes ( ) const
virtual

◆ KillProcess()

void mitk::ProcessExecutor::KillProcess ( )

◆ New()

static Pointer mitk::ProcessExecutor::New ( )
static

◆ SetSharedOutputPipes()

virtual void mitk::ProcessExecutor::SetSharedOutputPipes ( bool  _arg)
virtual

Member Data Documentation

◆ m_ExitValue

int mitk::ProcessExecutor::m_ExitValue
protected

Definition at line 102 of file mitkProcessExecutor.h.

◆ m_SharedOutputPipes

bool mitk::ProcessExecutor::m_SharedOutputPipes
protected

Specifies if the child process should share the output pipes (true) or not (false). If pipes are not shared the output will be passed by invoking ExternalProcessOutputEvents.

Remarks
The events will only be invoked if the pipes are NOT(!) shared.

Definition at line 109 of file mitkProcessExecutor.h.


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