]> git.ipfire.org Git - thirdparty/squid.git/blame - src/mem_node.h
Maintenance: automate header guards 2/3 (#1655)
[thirdparty/squid.git] / src / mem_node.h
CommitLineData
528b2c61 1/*
b8ae064d 2 * Copyright (C) 1996-2023 The Squid Software Foundation and contributors
528b2c61 3 *
bbc27441
AJ
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.
528b2c61 7 */
8
ff9d9458
FC
9#ifndef SQUID_SRC_MEM_NODE_H
10#define SQUID_SRC_MEM_NODE_H
528b2c61 11
21dfc374 12#include "base/Range.h"
582c2af2 13#include "defines.h"
ed6e9fb9 14#include "mem/forward.h"
602d9612 15#include "StoreIOBuffer.h"
62e76326 16
17class mem_node
18{
741c2986 19 MEMPROXY_CLASS(mem_node);
62e76326 20
528b2c61 21public:
22 static size_t InUseCount();
2415e202 23 static size_t StoreMemSize();
528b2c61 24
47f6e231 25 mem_node(int64_t);
528b2c61 26 ~mem_node();
27 size_t space() const;
47f6e231 28 int64_t start() const;
29 int64_t end() const;
30 Range<int64_t> dataRange() const;
31 bool contains (int64_t const &location) const;
32 bool canAccept (int64_t const &location) const;
4c50505b 33 bool operator < (mem_node const & rhs) const;
528b2c61 34 /* public */
35 StoreIOBuffer nodeBuffer;
528b2c61 36 /* Private */
37 char data[SM_PAGE_SIZE];
3dd52a0b 38 bool write_pending;
528b2c61 39};
40
b8bad68c 41inline std::ostream &
42operator << (std::ostream &os, mem_node &aNode)
43{
44 os << aNode.nodeBuffer.range();
45 return os;
46}
528b2c61 47
12d74f96 48void memNodeWriteComplete(void *);
49
ff9d9458 50#endif /* SQUID_SRC_MEM_NODE_H */
f53969cc 51