Segment.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_ESISEGMENT_H
10 #define SQUID_ESISEGMENT_H
11 
12 /* TODO: Factor the store memory segment management into a reusable code block
13  * or perhaps use membuffers here?
14  */
15 
16 #include "base/RefCount.h"
17 #include "cbdata.h"
18 #include "defines.h"
19 #include "SquidString.h"
20 
21 class ESISegment : public RefCountable
22 {
24 
25 public:
27  static void ListAppend (Pointer &, char const *, size_t);
28  static void ListTransfer (Pointer &from, Pointer &to);
29 
30  ESISegment() : len(0), next(NULL) {*buf = 0;}
31  ESISegment(ESISegment const &);
33 
35  char *listToChar() const;
36  void listAppend (char const *s, size_t length);
37  void adsorbList (ESISegment::Pointer from);
38  size_t space() const;
39 
41  size_t len; /* how much data has been pushed into this */
43  size_t append(char const *, size_t);
44  size_t append (Pointer);
45  ESISegment const *tail() const;
46  ESISegment *tail();
47  void dumpToLog() const;
48 
49 private:
50  size_t listLength()const;
51  void dumpOne() const;
52 };
53 
55 
56 #endif /* SQUID_ESISEGMENT_H */
57 
static void ListAppend(Pointer &, char const *, size_t)
Definition: Segment.cc:120
#define HTTP_REQBUF_SZ
Definition: defines.h:216
void adsorbList(ESISegment::Pointer from)
Definition: Segment.cc:36
size_t space() const
Definition: Segment.cc:29
void ESISegmentFreeList(ESISegment::Pointer &head)
Definition: Segment.cc:19
char * listToChar() const
Definition: Segment.cc:81
ESISegment::Pointer cloneList() const
Definition: Segment.cc:130
size_t len
Definition: Segment.h:41
Pointer next
Definition: Segment.h:42
void dumpOne() const
Definition: Segment.cc:191
~ESISegment()
Definition: Segment.h:32
ESISegment()
Definition: Segment.h:30
size_t append(char const *, size_t)
Definition: Segment.cc:138
void dumpToLog() const
Definition: Segment.cc:180
void listAppend(char const *s, size_t length)
Definition: Segment.cc:101
RefCount< ESISegment > Pointer
Definition: Segment.h:26
size_t listLength() const
Definition: Segment.cc:67
char buf[HTTP_REQBUF_SZ]
Definition: Segment.h:40
static void ListTransfer(Pointer &from, Pointer &to)
Definition: Segment.cc:53
CBDATA_CLASS(ESISegment)
squidaio_request_t * head
Definition: aiops.cc:127
#define NULL
Definition: types.h:166
ESISegment const * tail() const
Definition: Segment.cc:153

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors