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