Kea 1.5.0
cfg_option_def.h
Go to the documentation of this file.
1// Copyright (C) 2014-2015,2017 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_OPTION_DEF_H
8#define CFG_OPTION_DEF_H
9
12#include <cc/cfg_to_element.h>
13#include <string>
14
15namespace isc {
16namespace dhcp {
17
31public:
32
41 void copyTo(CfgOptionDef& new_config) const;
42
45
46
51 bool equals(const CfgOptionDef& other) const;
52
58 bool operator==(const CfgOptionDef& other) const {
59 return (equals(other));
60 }
61
67 bool operator!=(const CfgOptionDef& other) const {
68 return (!equals(other));
69 }
70
72
85 void add(const OptionDefinitionPtr& def, const std::string& option_space);
86
94 OptionDefContainerPtr getAll(const std::string& option_space) const;
95
103 OptionDefinitionPtr get(const std::string& option_space,
104 const uint16_t option_code) const;
105
113 OptionDefinitionPtr get(const std::string& option_space,
114 const std::string& option_name) const;
115
118 return (option_definitions_);
119 }
120
124 virtual isc::data::ElementPtr toElement() const;
125
126private:
127
132 OptionDefSpaceContainer option_definitions_;
133
134};
135
137
138
139typedef boost::shared_ptr<CfgOptionDef> CfgOptionDefPtr;
140
142typedef boost::shared_ptr<const CfgOptionDef> ConstCfgOptionDefPtr;
143
145
146}
147}
148
149#endif // CFG_OPTION_DEF_H
Represents option definitions used by the DHCP server.
bool operator!=(const CfgOptionDef &other) const
Inequality operator.
void add(const OptionDefinitionPtr &def, const std::string &option_space)
Add new option definition.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
const OptionDefSpaceContainer & getContainer() const
Returns reference to container holding option definitions.
OptionDefContainerPtr getAll(const std::string &option_space) const
Return option definitions for particular option space.
bool equals(const CfgOptionDef &other) const
Check if configuration is equal to other configuration.
OptionDefinitionPtr get(const std::string &option_space, const uint16_t option_code) const
Return option definition for a particular option space and code.
bool operator==(const CfgOptionDef &other) const
Equality operator.
void copyTo(CfgOptionDef &new_config) const
Copies this configuration to a new configuration.
boost::shared_ptr< Element > ElementPtr
Definition: data.h:22
boost::shared_ptr< const CfgOptionDef > ConstCfgOptionDefPtr
Const pointer.
boost::shared_ptr< CfgOptionDef > CfgOptionDefPtr
Non-const pointer.
boost::shared_ptr< OptionDefinition > OptionDefinitionPtr
Pointer to option definition object.
boost::shared_ptr< OptionDefContainer > OptionDefContainerPtr
Pointer to an option definition container.
Defines the logger used by the top-level component of kea-dhcp-ddns.
Abstract class for configuration Cfg_* classes.