Kea 2.7.5
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
105
107 static const std::map<std::string, int> nameToIndex;
108
110
114 CfgGlobals();
115
121 isc::data::ConstElementPtr get(const std::string& name) const;
122
128 isc::data::ConstElementPtr get(int index) const;
129
135 void set(const std::string& name, isc::data::ConstElementPtr value);
136
142 void set(int index, isc::data::ConstElementPtr value);
143
145 void clear();
146
148 typedef std::map<std::string, isc::data::ConstElementPtr> MapType;
149
154 const MapType valuesMap() const;
155
160
161protected:
163 std::vector<isc::data::ConstElementPtr> values_;
164};
165
167typedef boost::shared_ptr<CfgGlobals> CfgGlobalsPtr;
168
170typedef boost::shared_ptr<const CfgGlobals> ConstCfgGlobalsPtr;
171
172} // namespace isc::dhcp
173} // namespace isc
174
175#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.
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.
std::map< std::string, isc::data::ConstElementPtr > MapType
Type of name and value 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.