Page.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
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.
7  */
8 
9 #ifndef SQUID_SRC_IPC_MEM_PAGE_H
10 #define SQUID_SRC_IPC_MEM_PAGE_H
11 
12 #include "ipc/mem/forward.h"
13 
14 #include <iosfwd>
15 
16 namespace Ipc
17 {
18 
19 namespace Mem
20 {
21 
23 class PageId
24 {
25 public:
27 
29  bool set() const { return pool && number; }
30 
31  // safer than bool which would enable silent casts to int
32  typedef const uint32_t PageId::*SaferBool;
33  operator SaferBool() const { return set() ? &PageId::number : nullptr; }
34 
40 
41  // uint32_t segment; ///< memory segment ID within the pool; unused for now
42  uint32_t number;
43 
46 };
47 
49 std::ostream &operator <<(std::ostream &os, const PageId &page);
50 
51 } // namespace Mem
52 
53 } // namespace Ipc
54 
55 #endif /* SQUID_SRC_IPC_MEM_PAGE_H */
56 
const typedef uint32_t PageId::* SaferBool
Definition: Page.h:32
PoolId pool
Definition: Page.h:39
Shared memory page identifier, address, or handler.
Definition: Page.h:23
std::ostream & operator<<(std::ostream &os, const PageId &page)
writes page address (e.g., "sh_page5.3"), for debugging
Definition: Page.cc:16
uint32_t PoolId
Definition: forward.h:17
number
Definition: testStatHist.cc:32
Memory Management.
Definition: Allocator.h:16
Purpose purpose
page purpose
Definition: Page.h:45
bool set() const
true if and only if both critical components have been initialized
Definition: Page.h:29
uint32_t number
page number within the segment
Definition: Page.h:42
Definition: IpcIoFile.h:23

 

Introduction

Documentation

Support

Miscellaneous