InnerNode.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 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 
38  void lineParse();
39 
41  void add(ACL *node);
42 
43 protected:
46  virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const = 0;
47 
48  /* ACL API */
49  virtual int match(ACLChecklist *checklist);
50 
51  // XXX: use refcounting instead of raw pointers
52  std::vector<ACL*> nodes;
53 };
54 
55 } // namespace Acl
56 
57 #endif /* SQUID_ACL_INNER_NODE_H */
58 
virtual bool empty() const
Definition: InnerNode.cc:28
Definition: Acl.h:39
An intermediate ACL tree node. Manages a collection of child tree nodes.
Definition: InnerNode.h:21
Definition: parse.c:104
void add(ACL *node)
appends the node to the collection and takes control over it
Definition: InnerNode.cc:34
virtual int match(ACLChecklist *checklist)
Matches the actual data in checklist against this ACL.
Definition: InnerNode.cc:86
void lineParse()
parses one "acl name type acl1 acl2..." line, appending to nodes
Definition: InnerNode.cc:44
std::list< SBuf > SBufList
Definition: forward.h:26
virtual SBufList dump() const
Definition: InnerNode.cc:77
bool resumeMatchingAt(ACLChecklist *checklist, Acl::Nodes::const_iterator pos) const
Resumes matching (suspended by an async call) at the given position.
Definition: InnerNode.cc:92
std::vector< ACL * > Nodes
a collection of nodes
Definition: InnerNode.h:18
virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const =0
Nodes::size_type childrenCount() const
the number of children nodes
Definition: InnerNode.h:30
std::vector< ACL * > nodes
children nodes of this intermediate node
Definition: InnerNode.h:52
virtual void prepareForUse()
Definition: InnerNode.cc:22

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors