ParameterizedNode.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_PARAMETERIZEDNODE_H
10#define SQUID_SRC_ACL_PARAMETERIZEDNODE_H
11
12#include "acl/Acl.h"
13#include "base/Assure.h"
14
15#include <memory>
16
17namespace Acl
18{
19
22template <class P>
24{
25public:
26 using Parameters = P;
27
28 // to avoid dragging constructor parameters through each derived class, they
29 // are set in a leaf class constructor; \sa Acl::FinalizedParameterizedNode
30 ParameterizedNode() = default;
31 ~ParameterizedNode() override = default;
32
33protected:
34 /* ACL API */
35 void parse() override { Assure(data); data->parse(); }
36 void prepareForUse() override { data->prepareForUse(); }
37 SBufList dump() const override { return data->dump(); }
38 bool empty() const override { return data->empty(); }
39 const Acl::Options &lineOptions() override { return data->lineOptions(); }
40
43 std::unique_ptr<Parameters> data;
44};
45
46} // namespace Acl
47
48#endif /* SQUID_SRC_ACL_PARAMETERIZEDNODE_H */
49
#define Assure(condition)
Definition: Assure.h:35
Definition: Acl.h:46
const Acl::Options & lineOptions() override
void parse() override
parses node representation in squid.conf; dies on failures
bool empty() const override
std::unique_ptr< Parameters > data
SBufList dump() const override
~ParameterizedNode() override=default
void prepareForUse() override
Definition: Acl.cc:31
std::vector< const Option * > Options
Definition: Options.h:214
std::list< SBuf > SBufList
Definition: forward.h:23

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors