PLCnext API Documentation 25.0.2.69
Process.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/System/Commons/Runtime/ProcessConfiguration.hpp"
9
10namespace Arp { namespace System { namespace Ve
11{
12class IProcessService;
13}}}
14
15namespace Arp { namespace System { namespace Commons { namespace Runtime
16{
17
20{
21public: // usings
22
23public: // construction/destruction
24 Process(void);
26 Process(const Process& arg) = delete;
28 Process& operator=(const Process& arg) = delete;
29 ~Process(void);
30
31public: // static operations
32 static void SetupCurrentProcess(int core = -1);
33 static String GetCurrentFileName(void);
34 static int32 GetCurrentProcessId(void);
35
36public: // operations
37 void Start(const String& workingDirectory, const String& path, const String& commandLineArgs = "");
38 void Start(const String& workingDirectory, const String& path, const String& commandLineArgs, const ProcessConfiguration& processConfiguration);
39 int StartBlocking(const String& workingDirectory, const String& path, const String& commandLineArgs, int& exitStatus);
40 void StartDaemon(const String& workingDirectory, const String& path, const String& commandLineArgs = "");
41 void Kill(void);
42 bool HasExited(void)const;
43 void DetermineCurrentProcess(void);
44 int32 GetId(void) const;
45
46private: // fields
47 Arp::System::Ve::IProcessService* pProcessService;
48};
49
51// inline methods of class Process
52
53}}}} // end of namesapce Arp::System::Commons::Diagnostics
This class represents the Arp String. The implementation is based on std::string.
Definition: String.hpp:39
This class contains all information of the process configuration.
Definition: ProcessConfiguration.hpp:15
High level API to create and manage a processes.
Definition: Process.hpp:20
static String GetCurrentFileName(void)
Returns the full qualified filename of the executable of the current process.
Definition: Process.cpp:111
void Kill(void)
Posts a kill request to this process.
Definition: Process.cpp:91
void Start(const String &workingDirectory, const String &path, const String &commandLineArgs="")
Starts a new separate process.
Definition: Process.cpp:54
static void SetupCurrentProcess(int core=-1)
Definition: Process.cpp:104
static int32 GetCurrentProcessId(void)
Gets the ID of the current process.
Definition: Process.cpp:118
bool HasExited(void) const
Checks if the process has terminated.
Definition: Process.cpp:98
~Process(void)
Destructs this instance and frees all resouces.
Definition: Process.cpp:45
void StartDaemon(const String &workingDirectory, const String &path, const String &commandLineArgs="")
Starts a new separate process as a daemon
Definition: Process.cpp:85
Process & operator=(const Process &arg)=delete
Assignment operator.
void DetermineCurrentProcess(void)
Determines the information for the current process.
Definition: Process.cpp:124
Process(const Process &arg)=delete
Copy contructor.
Process(void)
Constructs an Process instance.
Definition: Process.cpp:32
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
Definition: Process.cpp:75
int32 GetId(void) const
Retrieves ID of the process
Definition: Process.cpp:133
std::int32_t int32
The Arp integer type of 4 byte size.
Definition: PrimitiveTypes.hpp:35
Root namespace for the PLCnext API