]> git.ipfire.org Git - thirdparty/squid.git/blob - src/ipc/mem/Page.h
SMP Caching: Core changes, IPC primitives, Shared memory cache, and Rock Store
[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
16 namespace Mem
17 {
18
19 /// Shared memory page identifier, address, or handler
20 class PageId
21 {
22 public:
23 PageId(): pool(0), number(0), purpose(maxPurpose) {}
24
25 operator bool() const { return pool && number; }
26
27 uint32_t pool; ///< page pool ID within Squid
28 // uint32_t segment; ///< memory segment ID within the pool; unused for now
29 uint32_t number; ///< page number within the segment
30
31 enum Purpose { cachePage, ioPage, maxPurpose };
32 Purpose purpose; ///< page purpose
33 };
34
35 /// writes page address (e.g., "sh_page5.3"), for debugging
36 std::ostream &operator <<(std::ostream &os, const PageId &page);
37
38 } // namespace Mem
39
40 } // namespace Ipc
41
42 #endif // SQUID_IPC_MEM_PAGE_H