]> git.ipfire.org Git - thirdparty/squid.git/blob - src/ipc/mem/Page.h
Merged from trunk
[thirdparty/squid.git] / src / ipc / mem / Page.h
1 /*
2 */
3
4 #ifndef SQUID_IPC_MEM_PAGE_H
5 #define SQUID_IPC_MEM_PAGE_H
6
7 #if HAVE_IOSFWD
8 #include <iosfwd>
9 #endif
10
11 namespace Ipc
12 {
13
14 namespace Mem
15 {
16
17 /// Shared memory page identifier, address, or handler
18 class PageId
19 {
20 public:
21 PageId(): pool(0), number(0), purpose(maxPurpose) {}
22
23 operator bool() const { return pool && number; }
24
25 uint32_t pool; ///< page pool ID within Squid
26 // uint32_t segment; ///< memory segment ID within the pool; unused for now
27 uint32_t number; ///< page number within the segment
28
29 enum Purpose { cachePage, ioPage, maxPurpose };
30 Purpose purpose; ///< page purpose
31 };
32
33 /// writes page address (e.g., "sh_page5.3"), for debugging
34 std::ostream &operator <<(std::ostream &os, const PageId &page);
35
36 } // namespace Mem
37
38 } // namespace Ipc
39
40 #endif // SQUID_IPC_MEM_PAGE_H