15 #ifndef __MITK_PROCESS_EXECUTOR_H 16 #define __MITK_PROCESS_EXECUTOR_H 19 #include <itkObject.h> 21 #include <itksys/Process.h> 34 const char *
GetEventName()
const override {
return "ExternalProcessOutputEvent"; }
35 bool CheckEvent(const ::itk::EventObject *e)
const override {
return dynamic_cast<const Self *
>(e); }
43 #define mitkProcessExecutorEventMacro(classname) \ 44 class classname : public ExternalProcessOutputEvent \ 47 typedef classname Self; \ 48 typedef ExternalProcessOutputEvent Superclass; \ 50 explicit classname(const std::string &output) : Superclass(output) {} \ 51 ~classname() override {} \ 53 virtual const char *GetEventName() const { return #classname; } \ 54 virtual bool CheckEvent(const ::itk::EventObject *e) const { return dynamic_cast<const Self *>(e); } \ 55 virtual ::itk::EventObject *MakeObject() const { return new Self(this->GetOutput()); } \ 76 itkFactorylessNewMacro(
Self);
78 itkSetMacro(SharedOutputPipes,
bool);
79 itkGetConstMacro(SharedOutputPipes,
bool);
83 bool Execute(
const std::string &executionPath,
const std::string &executableName,
ArgumentListType &argumentList);
89 bool Execute(
const std::string &executionPath,
const ArgumentListType &argumentList);
92 static std::string EnsureCorrectOSPathSeparator(
const std::string &);
94 static std::string GetOSDependendExecutableName(
const std::string &name);
112 itksysProcess *m_ProcessID =
nullptr;
bool CheckEvent(const ::itk::EventObject *e) const override
You may register an observer for an ExternalProcessOutputEvent, ExternalProcessStdOutEvent or Externa...
~ExternalProcessOutputEvent() override
#define mitkProcessExecutorEventMacro(classname)
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
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.
const char * GetEventName() const override
ExternalProcessOutputEvent(const std::string &output="")
std::vector< std::string > ArgumentListType
ExternalProcessOutputEvent Self
itk::EventObject * MakeObject() const override
std::string GetOutput() const