InnerNode.h
Go to the documentation of this file.
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 #ifndef SQUID_ACL_INNER_NODE_H
10 #define SQUID_ACL_INNER_NODE_H
11 
12 #include "acl/Acl.h"
13 #include <vector>
14 
15 namespace Acl
16 {
17 
18 typedef std::vector<ACL*> Nodes;
19 
21 class InnerNode: public ACL
22 {
23 public:
24  // No ~InnerNode() to delete children. They are aclRegister()ed instead.
25 
27  bool resumeMatchingAt(ACLChecklist *checklist, Acl::Nodes::const_iterator pos) const;
28 
30  Nodes::size_type childrenCount() const { return nodes.size(); }
31 
32  /* ACL API */
33  virtual void prepareForUse();
34  virtual bool empty() const;
35  virtual SBufList dump() const;
36 
39  size_t lineParse();
40 
42  void add(ACL *node);
43 
44 protected:
47  virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const = 0;
48 
49  /* ACL API */
50  virtual int match(ACLChecklist *checklist);
51 
52  // XXX: use refcounting instead of raw pointers
53  std::vector<ACL*> nodes;
54 };
55 
56 } // namespace Acl
57 
58 #endif /* SQUID_ACL_INNER_NODE_H */
59 
Definition: parse.c:104
virtual int match(ACLChecklist *checklist)
Matches the actual data in checklist against this ACL.
Definition: InnerNode.cc:89
std::list< SBuf > SBufList
Definition: forward.h:22
Definition: Acl.cc:32
void add(ACL *node)
appends the node to the collection and takes control over it
Definition: InnerNode.cc:35
An intermediate ACL tree node. Manages a collection of child tree nodes.
Definition: InnerNode.h:22
size_t lineParse()
Definition: InnerNode.cc:44
std::vector< ACL * > Nodes
a collection of nodes
Definition: InnerNode.h:18
virtual bool empty() const
Definition: InnerNode.cc:29
Nodes::size_type childrenCount() const
the number of children nodes
Definition: InnerNode.h:30
bool resumeMatchingAt(ACLChecklist *checklist, Acl::Nodes::const_iterator pos) const
Resumes matching (suspended by an async call) at the given position.
Definition: InnerNode.cc:95
Definition: Acl.h:40
std::vector< ACL * > nodes
children nodes of this intermediate node
Definition: InnerNode.h:53
virtual SBufList dump() const
Definition: InnerNode.cc:80
virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const =0
virtual void prepareForUse()
Definition: InnerNode.cc:22

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors