Page.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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 <iosfwd>
13 
14 namespace Ipc
15 {
16 
17 namespace Mem
18 {
19 
21 class PageId
22 {
23 public:
25 
27  bool set() const { return pool && number; }
28 
29  // safer than bool which would enable silent casts to int
30  typedef const uint32_t PageId::*SaferBool;
31  operator SaferBool() const { return set() ? &PageId::number : NULL; }
32 
33  uint32_t pool;
34  // uint32_t segment; ///< memory segment ID within the pool; unused for now
35  uint32_t number;
36 
39 };
40 
42 std::ostream &operator <<(std::ostream &os, const PageId &page);
43 
44 } // namespace Mem
45 
46 } // namespace Ipc
47 
48 #endif // SQUID_IPC_MEM_PAGE_H
49 
const uint32_t PageId::* SaferBool
Definition: Page.h:30
uint32_t pool
page pool ID within Squid
Definition: Page.h:33
uint32_t number
page number within the segment
Definition: Page.h:35
bool set() const
true if and only if both critical components have been initialized
Definition: Page.h:27
Purpose purpose
page purpose
Definition: Page.h:38
number
Definition: testStatHist.cc:16
Shared memory page identifier, address, or handler.
Definition: Page.h:21
std::ostream & operator<<(std::ostream &os, const PageId &page)
writes page address (e.g., "sh_page5.3"), for debugging
Definition: Page.cc:16
#define NULL
Definition: types.h:166

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors