CyberEngineMkIII
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CYBProcess.hpp
Go to the documentation of this file.
1 #pragma once
3 
4 namespace CYB {
6  namespace Platform {
7  namespace System {
8  class Path;
13  class Process : private Implementation::Process {
14  protected:
20  Process() = default;
21  public:
28  static Process GetSelf(void) noexcept;
29 
43  Process(const Path& APath, const API::String::UTF8& ACommandLine);
57  Process(const API::String::UTF8& ACommandLine);
59  Process(const Process&) = delete;
60  Process(Process&& AMove) noexcept = default;
61  Process& operator=(Process&& AMove) noexcept = default;
62  ~Process();
64 
71  bool Active(void) const noexcept;
79  bool operator==(const Process& ARHS) const noexcept;
87  bool operator!=(const Process& ARHS) const noexcept;
94  void Terminate(void);
95 
103  bool Wait(const unsigned int AMilliseconds = 0U);
111  int GetExitCode(void);
112  };
113  };
114  };
115 };
A variable length UTF-8 string.
Definition: UTF8String.hpp:8
Process & operator=(Process &&AMove) noexcept=default
See Default Constructors and Destructor.
Contains the Process handle and spawning function.
~Process()
Destroy the Process object without affecting the actual process.
static Process GetSelf(void) noexcept
Get's the Process representing the current execution.
Definition: CYBProcess.cpp:12
bool operator==(const Process &ARHS) const noexcept
Check the equivalence of two Process objects.
int GetExitCode(void)
Blocks execution until the associated Process is terminated and returns it's exit code...
bool operator!=(const Process &ARHS) const noexcept
Check the unequivalence of two Process objects.
Definition: CYBProcess.cpp:16
void Terminate(void)
Terminates the Process with exit code 0.
Process()=default
Constructor for self process. Use GetSelf()
bool Active(void) const noexcept
Check if the Process is still running.
bool Wait(const unsigned int AMilliseconds=0U)
Blocks execution until the associated Process is terminated or a timer expires.
Used for manipulating Paths. Paths will always exist either as a file or directory. Paths are '/' delimited when forming though may not be while retrieving. File names ".." will ascend a directory and '.' represents a no-op.
Definition: CYBPath.hpp:10
An object representing an operating system process.
Definition: CYBProcess.hpp:13