13 #ifndef mitkProcessExecutor_h
14 #define mitkProcessExecutor_h
17 #include <itkObject.h>
19 #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 override { return #classname; } \
54 virtual bool CheckEvent(const ::itk::EventObject *e) const override { return dynamic_cast<const Self *>(e); } \
55 virtual ::itk::EventObject *MakeObject() const override { return new Self(this->GetOutput()); } \
76 itkFactorylessNewMacro(
Self);
78 itkSetMacro(SharedOutputPipes,
bool);
79 itkGetConstMacro(SharedOutputPipes,
bool);
112 itksysProcess *m_ProcessID =
nullptr;
#define MITKSEGMENTATION_EXPORT
const char * GetEventName() const override
bool CheckEvent(const ::itk::EventObject *e) const override
itk::EventObject * MakeObject() const override
std::string GetOutput() const
ExternalProcessOutputEvent(const std::string &output="")
~ExternalProcessOutputEvent() override
ExternalProcessOutputEvent Self
You may register an observer for an ExternalProcessOutputEvent, ExternalProcessStdOutEvent or Externa...
~ProcessExecutor() override
static std::string GetOSDependendExecutableName(const std::string &name)
bool m_SharedOutputPipes
Specifies if the child process should share the output pipes (true) or not (false)....
bool Execute(const std::string &executionPath, const std::string &executableName, ArgumentListType &argumentList)
std::vector< std::string > ArgumentListType
static std::string EnsureCorrectOSPathSeparator(const std::string &)
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 argu...
#define mitkProcessExecutorEventMacro(classname)
Find image slices visible on a given plane.