]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/acl/InnerNode.h
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
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.
9 #ifndef SQUID_ACL_INNER_NODE_H
10 #define SQUID_ACL_INNER_NODE_H
18 typedef std::vector
<ACL
*> Nodes
; ///< a collection of nodes
20 /// An intermediate ACL tree node. Manages a collection of child tree nodes.
21 class InnerNode
: public ACL
24 // No ~InnerNode() to delete children. They are aclRegister()ed instead.
26 /// Resumes matching (suspended by an async call) at the given position.
27 bool resumeMatchingAt(ACLChecklist
*checklist
, Acl::Nodes::const_iterator pos
) const;
29 /// the number of children nodes
30 Nodes::size_type
childrenCount() const { return nodes
.size(); }
33 virtual void prepareForUse();
34 virtual bool empty() const;
35 virtual SBufList
dump() const;
37 /// parses one "acl name type acl1 acl2..." line, appending to nodes
40 /// appends the node to the collection and takes control over it
44 /// checks whether the nodes match, starting with the given one
45 /// kids determine what a match means for their type of intermediate nodes
46 virtual int doMatch(ACLChecklist
*checklist
, Nodes::const_iterator start
) const = 0;
49 virtual int match(ACLChecklist
*checklist
);
51 // XXX: use refcounting instead of raw pointers
52 std::vector
<ACL
*> nodes
; ///< children nodes of this intermediate node
57 #endif /* SQUID_ACL_INNER_NODE_H */