Page.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2021 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_IPC_MEM_PAGE_H
10 #define SQUID_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 : NULL; }
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_IPC_MEM_PAGE_H
56 
PoolId pool
Definition: Page.h:39
Shared memory page identifier, address, or handler.
Definition: Page.h:24
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
const uint32_t PageId::* SaferBool
Definition: Page.h:32
number
Definition: testStatHist.cc:16
Memory Management.
Purpose purpose
page purpose
Definition: Page.h:45
#define NULL
Definition: types.h:166
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:24

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors