stmem.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_STMEM_H
10#define SQUID_STMEM_H
11
12#include "base/Range.h"
13#include "splay.h"
14
15class mem_node;
16
17class StoreIOBuffer;
18
20{
21
22public:
23 mem_hdr();
24 ~mem_hdr();
25 void freeContent();
26 int64_t lowestOffset () const;
27 int64_t endOffset () const;
28 int64_t freeDataUpto (int64_t);
29 ssize_t copy (StoreIOBuffer const &) const;
30 bool hasContigousContentRange(Range<int64_t> const &range) const;
31 /* success or fail */
32 bool write (StoreIOBuffer const &);
33 void dump() const;
34 size_t size() const;
35 mem_node *getBlockContainingLocation (int64_t location) const;
36 /* access the contained nodes - easier than punning
37 * as a container ourselves
38 */
39 const Splay<mem_node *> &getNodes() const;
40 char * NodeGet(mem_node * aNode);
41
43
44private:
45 void debugDump() const;
46 bool unlink(mem_node *aNode);
47 void appendNode (mem_node *aNode);
48 size_t copyAvailable(mem_node *aNode, int64_t location, size_t amount, char *target) const;
49 bool unionNotEmpty (StoreIOBuffer const &);
50 mem_node *nodeToRecieve(int64_t offset);
51 size_t writeAvailable(mem_node *aNode, int64_t location, size_t amount, char const *source);
52 int64_t inmem_hi;
54};
55
56#endif /* SQUID_STMEM_H */
57
Definition: Range.h:19
Definition: stmem.h:20
int64_t inmem_hi
Definition: stmem.h:52
const Splay< mem_node * > & getNodes() const
Definition: stmem.cc:374
bool unlink(mem_node *aNode)
Definition: stmem.cc:67
void dump() const
Definition: stmem.cc:361
ssize_t copy(StoreIOBuffer const &) const
Definition: stmem.cc:189
void freeContent()
Definition: stmem.cc:59
bool unionNotEmpty(StoreIOBuffer const &)
Definition: stmem.cc:262
int64_t freeDataUpto(int64_t)
Definition: stmem.cc:81
mem_hdr()
Definition: stmem.cc:334
size_t writeAvailable(mem_node *aNode, int64_t location, size_t amount, char const *source)
Definition: stmem.cc:104
mem_node * nodeToRecieve(int64_t offset)
Definition: stmem.cc:271
size_t copyAvailable(mem_node *aNode, int64_t location, size_t amount, char *target) const
Definition: stmem.cc:153
static Splay< mem_node * >::SPLAYCMP NodeCompare
Definition: stmem.h:42
bool write(StoreIOBuffer const &)
Definition: stmem.cc:305
char * NodeGet(mem_node *aNode)
Definition: stmem.cc:26
void debugDump() const
Definition: stmem.cc:172
size_t size() const
Definition: stmem.cc:368
~mem_hdr()
Definition: stmem.cc:339
Splay< mem_node * > nodes
Definition: stmem.h:53
int64_t endOffset() const
Definition: stmem.cc:45
void appendNode(mem_node *aNode)
Definition: stmem.cc:130
bool hasContigousContentRange(Range< int64_t > const &range) const
Definition: stmem.cc:247
mem_node * getBlockContainingLocation(int64_t location) const
Definition: stmem.cc:139
int64_t lowestOffset() const
Definition: stmem.cc:34

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors