Kea 2.7.6
cfg_globals.h
Go to the documentation of this file.
1// Copyright (C) 2021-2024 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef CFG_GLOBALS_H
8#define CFG_GLOBALS_H
9
10#include <cc/cfg_to_element.h>
11#include <cc/data.h>
12#include <boost/shared_ptr.hpp>
13#include <map>
14#include <string>
15#include <vector>
16
17namespace isc {
18namespace dhcp {
19
26public:
27
29
108
110 static const std::map<std::string, int> nameToIndex;
111
113
117 CfgGlobals();
118
124 isc::data::ConstElementPtr get(const std::string& name) const;
125
131 isc::data::ConstElementPtr get(int index) const;
132
138 void set(const std::string& name, isc::data::ConstElementPtr value);
139
145 void set(int index, isc::data::ConstElementPtr value);
146
148 void clear();
149
151 typedef std::map<std::string, isc::data::ConstElementPtr> MapType;
152
157 const MapType valuesMap() const;
158
163
164protected:
166 std::vector<isc::data::ConstElementPtr> values_;
167};
168
170typedef boost::shared_ptr<CfgGlobals> CfgGlobalsPtr;
171
173typedef boost::shared_ptr<const CfgGlobals> ConstCfgGlobalsPtr;
174
175} // namespace isc::dhcp
176} // namespace isc
177
178#endif // CFG_GLOBALS_H
Class to store configured global parameters.
Definition cfg_globals.h:25
void clear()
Clear configured parameter values.
void set(const std::string &name, isc::data::ConstElementPtr value)
Set a configured parameter value by name.
std::map< std::string, isc::data::ConstElementPtr > MapType
Type of name and value map.
const MapType valuesMap() const
Returns configured parameters as a map.
CfgGlobals()
Instance members.
static const std::map< std::string, int > nameToIndex
Name to index map.
isc::data::ElementPtr toElement() const
Unparse configured global parameters.
isc::data::ConstElementPtr get(const std::string &name) const
Get a configured parameter value by name.
std::vector< isc::data::ConstElementPtr > values_
Vectors of values.
Index
Class members.
Definition cfg_globals.h:39
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:29
boost::shared_ptr< Element > ElementPtr
Definition data.h:28
boost::shared_ptr< const CfgGlobals > ConstCfgGlobalsPtr
Const shared pointer to a CfgGlobals instance.
boost::shared_ptr< CfgGlobals > CfgGlobalsPtr
Non-const shared pointer to a CfgGlobals instance.
Defines the logger used by the top-level component of kea-lfc.
Abstract class for configuration Cfg_* classes.