Cbeam
Loading...
Searching...
No Matches
process.hpp
Go to the documentation of this file.
1/*
2Copyright (c) 2025 acrion innovations GmbH
3Authors: Stefan Zipproth, s.zipproth@acrion.ch
4
5This file is part of Cbeam, see https://github.com/acrion/cbeam and https://cbeam.org
6
7Cbeam is offered under a commercial and under the AGPL license.
8For commercial licensing, contact us at https://acrion.ch/sales. For AGPL licensing, see below.
9
10AGPL licensing:
11
12Cbeam is free software: you can redistribute it and/or modify
13it under the terms of the GNU Affero General Public License as published by
14the Free Software Foundation, either version 3 of the License, or
15(at your option) any later version.
16
17Cbeam is distributed in the hope that it will be useful,
18but WITHOUT ANY WARRANTY; without even the implied warranty of
19MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20GNU Affero General Public License for more details.
21
22You should have received a copy of the GNU Affero General Public License
23along with Cbeam. If not, see <https://www.gnu.org/licenses/>.
24*/
25
26#pragma once
27
28#ifdef _WIN32
30#else
31 #include <unistd.h> // for getpid, pid_t
32#endif
33
34namespace cbeam::concurrency
35{
43#ifdef _WIN32
44 using process_id_type = DWORD;
45#else
46 using process_id_type = pid_t;
47#endif
48
58 {
59#ifdef _WIN32
60 return GetCurrentProcessId();
61#else
62 return ::getpid();
63#endif
64 }
65}
Provides concurrency primitives and abstractions for multithreaded programming. It features the power...
Definition message_manager.hpp:47
process_id_type get_current_process_id()
Retrieves the current process's identifier in a platform-independent manner.
Definition process.hpp:57
DWORD process_id_type
Defines a platform-independent type for process identifiers.
Definition process.hpp:44
Header file to manage inclusion of windows.h with specific settings.