]> git.ipfire.org Git - thirdparty/squid.git/blob - src/esi/Sequence.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / esi / Sequence.h
1 /*
2 * Copyright (C) 1996-2016 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 /* DEBUG: section 86 ESI processing */
10
11 #ifndef SQUID_ESISEQUENCE_H
12 #define SQUID_ESISEQUENCE_H
13
14 #include "esi/Element.h"
15 #include "esi/ElementList.h"
16 #include "mem/forward.h"
17
18 /* esiSequence */
19
20 class esiSequence : public ESIElement
21 {
22 MEMPROXY_CLASS(esiSequence);
23
24 public:
25 esiSequence(esiTreeParentPtr, bool = false);
26 ~esiSequence();
27
28 void render(ESISegment::Pointer);
29 bool addElement (ESIElement::Pointer);
30 esiProcessResult_t process (int dovars);
31 void provideData (ESISegment::Pointer, ESIElement*);
32 bool mayFail () const;
33 void wontFail();
34 void fail(ESIElement *, char const *anError = NULL);
35 void makeCachableElements(esiSequence const &old);
36 Pointer makeCacheable() const;
37 void makeUsableElements(esiSequence const &old, ESIVarState &);
38 Pointer makeUsable(esiTreeParentPtr, ESIVarState &) const;
39
40 ElementList elements; /* unprocessed or rendered nodes */
41 size_t processedcount;
42
43 struct {
44 int dovars:1; /* for esiVar */
45 } flags;
46 void finish();
47
48 protected:
49 esiSequence(esiSequence const &);
50 esiTreeParentPtr parent;
51
52 private:
53 int elementIndex (ESIElement::Pointer anElement) const;
54 bool mayFail_;
55 bool failed;
56 esiProcessResult_t processOne(int, size_t);
57 bool const provideIncrementalData;
58 bool processing;
59 esiProcessResult_t processingResult;
60 size_t nextElementToProcess_;
61 size_t nextElementToProcess() const;
62 void nextElementToProcess(size_t const &);
63 bool finishedProcessing() const;
64 void processStep(int dovars);
65 };
66
67 #endif /* SQUID_ESISEQUENCE_H */
68