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_IPC_MEM_PAGE_H
10#define SQUID_IPC_MEM_PAGE_H
11
12#include "ipc/mem/forward.h"
13
14#include <iosfwd>
15
16namespace Ipc
17{
18
19namespace Mem
20{
21
23class PageId
24{
25public:
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
49std::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
Shared memory page identifier, address, or handler.
Definition: Page.h:24
PoolId pool
Definition: Page.h:39
const uint32_t PageId::* SaferBool
Definition: Page.h:32
uint32_t number
page number within the segment
Definition: Page.h:42
bool set() const
true if and only if both critical components have been initialized
Definition: Page.h:29
Purpose purpose
page purpose
Definition: Page.h:45
uint32_t PoolId
Definition: forward.h:17
std::ostream & operator<<(std::ostream &os, const PageId &page)
writes page address (e.g., "sh_page5.3"), for debugging
Definition: Page.cc:16
Definition: IpcIoFile.h:24
Memory Management.
Definition: Allocator.h:17
number
Definition: testStatHist.cc:32

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors