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/Node.h"
13 #include "base/Assure.h"
14 
15 #include <memory>
16 
17 namespace Acl
18 {
19 
22 template <class P>
24 {
25 public:
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 
33 protected:
34  /* Acl::Node 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 
std::vector< const Option * > Options
Definition: Options.h:217
SBufList dump() const override
std::list< SBuf > SBufList
Definition: forward.h:22
Definition: Acl.cc:33
bool empty() const override
void prepareForUse() override
#define Assure(condition)
Definition: Assure.h:35
void parse() override
parses node representation in squid.conf; dies on failures
~ParameterizedNode() override=default
const Acl::Options & lineOptions() override
Definition: Node.h:25
std::unique_ptr< Parameters > data

 

Introduction

Documentation

Support

Miscellaneous