InnerNode.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_ACL_INNERNODE_H
10 #define SQUID_SRC_ACL_INNERNODE_H
11 
12 #include "acl/Node.h"
13 #include <vector>
14 
15 namespace Acl
16 {
17 
19 using Nodes = std::vector<Node::Pointer>;
20 
22 class InnerNode: public Acl::Node
23 {
24 public:
26  bool resumeMatchingAt(ACLChecklist *checklist, Acl::Nodes::const_iterator pos) const;
27 
29  Nodes::size_type childrenCount() const { return nodes.size(); }
30 
31  /* Acl::Node API */
32  void prepareForUse() override;
33  bool empty() const override;
34  SBufList dump() const override;
35 
38  size_t lineParse();
39 
41  void add(Acl::Node *node);
42 
43 protected:
46  virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const = 0;
47 
48  /* Acl::Node API */
49  int match(ACLChecklist *checklist) override;
50 
52 };
53 
54 } // namespace Acl
55 
56 #endif /* SQUID_SRC_ACL_INNERNODE_H */
57 
Definition: parse.c:104
bool empty() const override
Definition: InnerNode.cc:30
std::list< SBuf > SBufList
Definition: forward.h:22
Definition: Acl.cc:33
An intermediate Acl::Node tree node. Manages a collection of child tree nodes.
Definition: InnerNode.h:22
size_t lineParse()
Definition: InnerNode.cc:44
void prepareForUse() override
Definition: InnerNode.cc:23
Nodes::size_type childrenCount() const
the number of children nodes
Definition: InnerNode.h:29
int match(ACLChecklist *checklist) override
Matches the actual data in checklist against this Acl::Node.
Definition: InnerNode.cc:90
void add(Acl::Node *node)
appends the node to the collection and takes control over it
Definition: InnerNode.cc:36
bool resumeMatchingAt(ACLChecklist *checklist, Acl::Nodes::const_iterator pos) const
Resumes matching (suspended by an async call) at the given position.
Definition: InnerNode.cc:96
Nodes nodes
children of this intermediate node
Definition: InnerNode.h:51
SBufList dump() const override
Definition: InnerNode.cc:81
Definition: Node.h:25
virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const =0
std::vector< Node::Pointer > Nodes
operands of a boolean ACL expression, in configuration/evaluation order
Definition: InnerNode.h:19

 

Introduction

Documentation

Support

Miscellaneous