]>
Commit | Line | Data |
---|---|---|
96c2bb61 | 1 | /* |
bde978a6 | 2 | * Copyright (C) 1996-2015 The Squid Software Foundation and contributors |
bbc27441 AJ |
3 | * |
4 | * Squid software is distributed under GPLv2+ license and includes | |
5 | * contributions from numerous individuals and organizations. | |
6 | * Please see the COPYING and CONTRIBUTORS files for details. | |
96c2bb61 AR |
7 | */ |
8 | ||
9 | #ifndef SQUID_CPU_AFFINITY_MAP_H | |
10 | #define SQUID_CPU_AFFINITY_MAP_H | |
11 | ||
c8ea3cc0 | 12 | #include <vector> |
96c2bb61 AR |
13 | |
14 | class CpuAffinitySet; | |
15 | ||
96c2bb61 AR |
16 | /// stores cpu_affinity_map configuration |
17 | class CpuAffinityMap | |
18 | { | |
19 | public: | |
20 | /// append cpu_affinity_map option | |
c8ea3cc0 | 21 | bool add(const std::vector<int> &aProcesses, const std::vector<int> &aCores); |
96c2bb61 AR |
22 | |
23 | /// calculate CPU set for this process | |
24 | CpuAffinitySet *calculateSet(const int targetProcess) const; | |
25 | ||
26 | /// returns list of process numbers | |
c8ea3cc0 | 27 | const std::vector<int> &processes() const { return theProcesses; } |
96c2bb61 AR |
28 | |
29 | /// returns list of cores | |
c8ea3cc0 | 30 | const std::vector<int> &cores() const { return theCores; } |
96c2bb61 AR |
31 | |
32 | private: | |
c8ea3cc0 FC |
33 | std::vector<int> theProcesses; ///< list of process numbers |
34 | std::vector<int> theCores; ///< list of cores | |
96c2bb61 AR |
35 | }; |
36 | ||
37 | #endif // SQUID_CPU_AFFINITY_MAP_H | |
f53969cc | 38 |