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_ACL_INNER_NODE_H
10#define SQUID_ACL_INNER_NODE_H
11
12#include "acl/Acl.h"
13#include <vector>
14
15namespace Acl
16{
17
18typedef std::vector<ACL*> Nodes;
19
21class InnerNode: public ACL
22{
23public:
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 void prepareForUse() override;
34 bool empty() const override;
35 SBufList dump() const override;
36
39 size_t lineParse();
40
42 void add(ACL *node);
43
44protected:
47 virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const = 0;
48
49 /* ACL API */
50 int match(ACLChecklist *checklist) override;
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: Acl.h:46
An intermediate ACL tree node. Manages a collection of child tree nodes.
Definition: InnerNode.h:22
Nodes::size_type childrenCount() const
the number of children nodes
Definition: InnerNode.h:30
bool empty() const override
Definition: InnerNode.cc:29
std::vector< ACL * > nodes
children nodes of this intermediate node
Definition: InnerNode.h:53
size_t lineParse()
Definition: InnerNode.cc:44
virtual int doMatch(ACLChecklist *checklist, Nodes::const_iterator start) const =0
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
void prepareForUse() override
Definition: InnerNode.cc:22
int match(ACLChecklist *checklist) override
Matches the actual data in checklist against this ACL.
Definition: InnerNode.cc:89
void add(ACL *node)
appends the node to the collection and takes control over it
Definition: InnerNode.cc:35
SBufList dump() const override
Definition: InnerNode.cc:80
Definition: Acl.cc:31
std::vector< ACL * > Nodes
a collection of nodes
Definition: InnerNode.h:18
std::list< SBuf > SBufList
Definition: forward.h:23
Definition: parse.c:104

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors