PLCnext API Documentation  22.9.0.33
Process.hpp
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 #pragma once
7 #include "Arp/System/Core/Arp.h"
8 
9 namespace Arp { namespace System { namespace Ve
10 {
11 class IProcessService;
12 }}}
13 
14 namespace Arp { namespace System { namespace Commons { namespace Runtime
15 {
16 
18 class Process
19 {
20 public: // construction/destruction
22  Process(void);
24  Process(const Process& arg) = default;
26  Process& operator=(const Process& arg) = default;
28  ~Process(void);
29 
30 public: // static operations
32  static void SetupCurrentProcess(int core = -1);
33 
36  static const String GetCurrentFileName(void);
37 
38 public: // operations
43  void Start(const String& workingDirectory, const String& path, const String& commandLineArgs = "");
44 
51  int StartBlocking(const String& workingDirectory, const String& path, const String& commandLineArgs, int& exitStatus);
52 
54  void Kill(void);
55 
58  bool HasExited(void);
59 
60 private: // fields
61  Arp::System::Ve::IProcessService* pProcessService;
62 };
63 
65 // inline methods of class Process
66 
67 }}}} // end of namesapce Arp::System::Commons::Diagnostics
High level API to create and manage a processes.
Definition: Process.hpp:19
void Kill(void)
Posts a kill request to this process.
void Start(const String &workingDirectory, const String &path, const String &commandLineArgs="")
Starts a new separate process.
Process(const Process &arg)=default
Copy contructor.
bool HasExited(void)
Checks if the process has terminated.
Process & operator=(const Process &arg)=default
Assignment operator.
~Process(void)
Destructs this instance and frees all resouces.
static void SetupCurrentProcess(int core=-1)
The core to bind the current process to, -1 means not set.
Process(void)
Constructs an Process instance.
static const String GetCurrentFileName(void)
Returns the full qualified filename of the executable of the current process.
int StartBlocking(const String &workingDirectory, const String &path, const String &commandLineArgs, int &exitStatus)
Starts a new separate process. And waits until the child process exits
@ System
System components used by the System, Device, Plc or Io domains.
Root namespace for the PLCnext API