]>
Commit | Line | Data |
---|---|---|
b67e2c8c | 1 | /* |
bbc27441 | 2 | * Copyright (C) 1996-2014 The Squid Software Foundation and contributors |
b67e2c8c | 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. | |
b67e2c8c | 7 | */ |
bbc27441 | 8 | |
b67e2c8c | 9 | #ifndef SQUID_DELAYVECTOR_H |
10 | #define SQUID_DELAYVECTOR_H | |
11 | ||
9a0a18de | 12 | #if USE_DELAY_POOLS |
eb8ed10d | 13 | |
b67e2c8c | 14 | #include "CompositePoolNode.h" |
15 | ||
63be0a78 | 16 | /// \ingroup DelayPoolsAPI |
62e76326 | 17 | class DelayVector : public CompositePoolNode |
18 | { | |
19 | ||
b67e2c8c | 20 | public: |
21 | typedef RefCount<DelayVector> Pointer; | |
22 | void *operator new(size_t); | |
23 | void operator delete (void *); | |
2e6c0f0f | 24 | DelayVector(); |
b67e2c8c | 25 | virtual ~DelayVector(); |
26 | virtual void stats(StoreEntry * sentry); | |
27 | virtual void dump(StoreEntry *entry) const; | |
28 | virtual void update(int incr); | |
29 | virtual void parse(); | |
62e76326 | 30 | |
1e5562e3 | 31 | virtual DelayIdComposite::Pointer id(CompositeSelectionDetails &); |
b67e2c8c | 32 | void push_back (CompositePoolNode::Pointer); |
62e76326 | 33 | |
b67e2c8c | 34 | private: |
62e76326 | 35 | |
63be0a78 | 36 | /// \ingroup DelayPoolsInternal |
37 | class Id:public DelayIdComposite | |
62e76326 | 38 | { |
39 | ||
40 | public: | |
41 | void *operator new(size_t); | |
42 | void operator delete (void *); | |
62e76326 | 43 | |
75566ba2 | 44 | Id (RefCount<DelayVector>,CompositeSelectionDetails &); |
62e76326 | 45 | ~Id(); |
46 | virtual int bytesWanted (int min, int max) const; | |
47 | virtual void bytesIn(int qty); | |
a46d2c0e | 48 | virtual void delayRead(DeferredRead const &); |
62e76326 | 49 | |
50 | private: | |
75566ba2 | 51 | RefCount<DelayVector> theVector; |
c8ea3cc0 FC |
52 | std::vector<DelayIdComposite::Pointer> ids; |
53 | typedef std::vector<DelayIdComposite::Pointer>::iterator iterator; | |
54 | typedef std::vector<DelayIdComposite::Pointer>::const_iterator const_iterator; | |
b67e2c8c | 55 | }; |
62e76326 | 56 | |
0353e724 | 57 | friend class Id; |
58 | ||
c8ea3cc0 FC |
59 | std::vector<CompositePoolNode::Pointer> pools; |
60 | typedef std::vector<CompositePoolNode::Pointer>::iterator iterator; | |
61 | typedef std::vector<CompositePoolNode::Pointer>::const_iterator const_iterator; | |
b67e2c8c | 62 | }; |
63 | ||
9a0a18de | 64 | #endif /* USE_DELAY_POOLS */ |
b67e2c8c | 65 | #endif /* SQUID_DELAYVECTOR_H */ |