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 
10 #include <dhcp/option_definition.h>
12 #include <cc/cfg_to_element.h>
13 #include <string>
14 
15 namespace isc {
16 namespace dhcp {
17 
31 public:
32 
41  void copyTo(CfgOptionDef& new_config) const;
42 
45 
46  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 
126 private:
127 
132  OptionDefSpaceContainer option_definitions_;
133 
134 };
135 
137 
138 typedef boost::shared_ptr<CfgOptionDef> CfgOptionDefPtr;
140 
142 typedef boost::shared_ptr<const CfgOptionDef> ConstCfgOptionDefPtr;
143 
145 
146 }
147 }
148 
149 #endif // CFG_OPTION_DEF_H
isc::dhcp::CfgOptionDefPtr
boost::shared_ptr< CfgOptionDef > CfgOptionDefPtr
Non-const pointer.
Definition: cfg_option_def.h:139
isc::dhcp::OptionDefinitionPtr
boost::shared_ptr< OptionDefinition > OptionDefinitionPtr
Pointer to option definition object.
Definition: option_definition.h:51
isc::data::CfgToElement
Abstract class for configuration Cfg_* classes.
Definition: cfg_to_element.h:29
isc::dhcp::OptionSpaceContainer< OptionDefContainer, OptionDefinitionPtr, std::string >
isc::dhcp::CfgOptionDef::equals
bool equals(const CfgOptionDef &other) const
Check if configuration is equal to other configuration.
Definition: cfg_option_def.cc:39
isc::dhcp::CfgOptionDef
Represents option definitions used by the DHCP server.
Definition: cfg_option_def.h:30
isc::dhcp::CfgOptionDef::getContainer
const OptionDefSpaceContainer & getContainer() const
Returns reference to container holding option definitions.
Definition: cfg_option_def.h:117
isc
Defines the logger used by the top-level component of kea-dhcp-ddns.
Definition: agent_parser.cc:144
isc::dhcp::CfgOptionDef::operator!=
bool operator!=(const CfgOptionDef &other) const
Inequality operator.
Definition: cfg_option_def.h:67
isc::dhcp::CfgOptionDef::getAll
OptionDefContainerPtr getAll(const std::string &option_space) const
Return option definitions for particular option space.
Definition: cfg_option_def.cc:106
option_definition.h
isc::dhcp::CfgOptionDef::operator==
bool operator==(const CfgOptionDef &other) const
Equality operator.
Definition: cfg_option_def.h:58
cfg_to_element.h
isc::dhcp::CfgOptionDef::add
void add(const OptionDefinitionPtr &def, const std::string &option_space)
Add new option definition.
Definition: cfg_option_def.cc:79
isc::dhcp::ConstCfgOptionDefPtr
boost::shared_ptr< const CfgOptionDef > ConstCfgOptionDefPtr
Const pointer.
Definition: cfg_option_def.h:142
isc::data::ElementPtr
boost::shared_ptr< Element > ElementPtr
Definition: data.h:20
isc::dhcp::OptionDefContainerPtr
boost::shared_ptr< OptionDefContainer > OptionDefContainerPtr
Pointer to an option definition container.
Definition: option_definition.h:819
isc::dhcp::CfgOptionDef::toElement
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
Definition: cfg_option_def.cc:156
option_space_container.h
isc::dhcp::CfgOptionDef::copyTo
void copyTo(CfgOptionDef &new_config) const
Copies this configuration to a new configuration.
Definition: cfg_option_def.cc:21
isc::dhcp::CfgOptionDef::get
OptionDefinitionPtr get(const std::string &option_space, const uint16_t option_code) const
Return option definition for a particular option space and code.
Definition: cfg_option_def.cc:112