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