Pipeline.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_SRC_PIPELINE_H
10 #define SQUID_SRC_PIPELINE_H
11 
12 #include "base/RefCount.h"
13 #include "http/Stream.h"
14 
15 #include <list>
16 
34 class Pipeline
35 {
36  Pipeline(const Pipeline &) = delete;
37  Pipeline & operator =(const Pipeline &) = delete;
38 
39 public:
40  Pipeline() : nrequests(0) {}
41  ~Pipeline() = default;
42 
44  void add(const Http::StreamPointer &);
45 
47  Http::StreamPointer front() const;
48 
50  Http::StreamPointer back() const;
51 
53  size_t count() const {return requests.size();}
54 
56  bool empty() const {return requests.empty();}
57 
59  void popMe(const Http::StreamPointer &);
60 
63  uint32_t nrequests;
64 
65 private:
67  std::list<Http::StreamPointer> requests;
68 };
69 
70 #endif /* SQUID_SRC_PIPELINE_H */
71 
bool empty() const
whether there are none or any requests currently pipelined
Definition: Pipeline.h:56
void add(const Http::StreamPointer &)
register a new request context to the pipeline
Definition: Pipeline.cc:20
void popMe(const Http::StreamPointer &)
deregister the front request from the pipeline
Definition: Pipeline.cc:52
Http::StreamPointer front() const
get the first request context in the pipeline
Definition: Pipeline.cc:28
Pipeline()
Definition: Pipeline.h:40
size_t count() const
how many requests are currently pipelined
Definition: Pipeline.h:53
Http::StreamPointer back() const
get the last request context in the pipeline
Definition: Pipeline.cc:40
Pipeline & operator=(const Pipeline &)=delete
uint32_t nrequests
Definition: Pipeline.h:63
std::list< Http::StreamPointer > requests
requests parsed from the connection but not yet completed.
Definition: Pipeline.h:67
~Pipeline()=default

 

Introduction

Documentation

Support

Miscellaneous