Pipeline.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_SRC_PIPELINE_H
10 #define SQUID_SRC_PIPELINE_H
11 
12 #include "base/RefCount.h"
13 #include "http/forward.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 terminateAll(const int xerrno);
60 
62  void popMe(const Http::StreamPointer &);
63 
66  uint32_t nrequests;
67 
68 private:
70  std::list<Http::StreamPointer> requests;
71 };
72 
73 #endif /* SQUID_SRC_PIPELINE_H */
74 
std::list< Http::StreamPointer > requests
requests parsed from the connection but not yet completed.
Definition: Pipeline.h:70
Http::StreamPointer front() const
get the first request context in the pipeline
Definition: Pipeline.cc:28
void terminateAll(const int xerrno)
tell everybody about the err, and abort all waiting requests
Definition: Pipeline.cc:52
Http::StreamPointer back() const
get the last request context in the pipeline
Definition: Pipeline.cc:40
~Pipeline()=default
size_t count() const
how many requests are currently pipelined
Definition: Pipeline.h:53
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:64
bool empty() const
whether there are none or any requests currently pipelined
Definition: Pipeline.h:56
Pipeline()
Definition: Pipeline.h:40
Pipeline & operator=(const Pipeline &)=delete
uint32_t nrequests
Definition: Pipeline.h:66

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors