]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/ipc/mem/Page.h
4 #ifndef SQUID_IPC_MEM_PAGE_H
5 #define SQUID_IPC_MEM_PAGE_H
17 /// Shared memory page identifier, address, or handler
21 PageId(): pool(0), number(0), purpose(maxPurpose
) {}
23 /// true if and only if both critical components have been initialized
24 bool set() const { return pool
&& number
; }
26 // safer than bool which would enable silent casts to int
27 typedef const uint32_t PageId::*SaferBool
;
28 operator SaferBool() const { return set() ? &PageId::number
: NULL
; }
30 uint32_t pool
; ///< page pool ID within Squid
31 // uint32_t segment; ///< memory segment ID within the pool; unused for now
32 uint32_t number
; ///< page number within the segment
34 enum Purpose
{ cachePage
, ioPage
, maxPurpose
};
35 Purpose purpose
; ///< page purpose
38 /// writes page address (e.g., "sh_page5.3"), for debugging
39 std::ostream
&operator <<(std::ostream
&os
, const PageId
&page
);
45 #endif // SQUID_IPC_MEM_PAGE_H