![]() |
Kea
1.5.0
|
Classes | |
| class | BoolElement |
| struct | CfgToElement |
| Abstract class for configuration Cfg_* classes. More... | |
| class | DoubleElement |
| class | Element |
The Element class represents a piece of data, used by the command channel and configuration parts. More... | |
| class | IntElement |
| Notes: IntElement type is changed to int64_t. More... | |
| class | JSONError |
| A standard Data module exception that is thrown if a parse error is encountered when constructing an Element from a string. More... | |
| class | ListElement |
| class | MapElement |
| class | NullElement |
| struct | SimpleDefault |
| This array defines a single entry of default values. More... | |
| class | SimpleParser |
| A simple parser. More... | |
| class | StampedElement |
| This class represents configuration element which is associated with the modification timestamp. More... | |
| class | StampedValue |
| This class represents string or signed integer configuration element associated with the modification timestamp. More... | |
| class | StringElement |
| class | TypeError |
| A standard Data module exception that is thrown if a function is called for an Element that has a wrong type (e.g. More... | |
| struct | UserContext |
| Base class for user context. More... | |
Typedefs | |
| typedef boost::shared_ptr< const Element > | ConstElementPtr |
| typedef boost::shared_ptr< Element > | ElementPtr |
| typedef std::vector< std::string > | ParamsList |
| This defines a list of all parameters that are derived (or inherited) between contexts. More... | |
| typedef std::vector< SimpleDefault > | SimpleDefaults |
| This specifies all default values in a given scope (e.g. a subnet) More... | |
| typedef std::vector< StampedValuePtr > | StampedValueCollection |
| Collection of pointers to values. More... | |
| typedef boost::shared_ptr< StampedValue > | StampedValuePtr |
| Pointer to the stamped value. More... | |
Functions | |
| ElementPtr | copy (ConstElementPtr from, int level=100) |
| Copy the data up to a nesting level. More... | |
| bool | isEquivalent (ConstElementPtr a, ConstElementPtr b) |
| Compares the data with other using unordered lists. More... | |
| bool | isNull (ConstElementPtr p) |
| Checks whether the given ElementPtr is a NULL pointer. More... | |
| void | merge (ElementPtr element, ConstElementPtr other) |
| Merges the data from other into element. More... | |
| bool | operator!= (const Element &a, const Element &b) |
| std::ostream & | operator<< (std::ostream &out, const Element &e) |
| Insert the Element as a string into stream. More... | |
| std::ostream & | operator<< (std::ostream &out, const Element::Position &pos) |
| Insert Element::Position as a string into stream. More... | |
| bool | operator== (const Element &a, const Element &b) |
| void | prettyPrint (ConstElementPtr element, std::ostream &out, unsigned indent=0, unsigned step=2) |
| Pretty prints the data into stream. More... | |
| std::string | prettyPrint (ConstElementPtr element, unsigned indent=0, unsigned step=2) |
| Pretty prints the data into string. More... | |
| ConstElementPtr | removeIdentical (ConstElementPtr a, ConstElementPtr b) |
| Create a new ElementPtr from the first ElementPtr, removing all values that are equal in the second. More... | |
| void | removeIdentical (ElementPtr a, ConstElementPtr b) |
| Remove all values from the first ElementPtr that are equal in the second. More... | |
| typedef boost::shared_ptr<const Element> isc::data::ConstElementPtr |
| typedef boost::shared_ptr<Element> isc::data::ElementPtr |
| typedef std::vector<std::string> isc::data::ParamsList |
This defines a list of all parameters that are derived (or inherited) between contexts.
Definition at line 35 of file lib/cc/simple_parser.h.
| typedef std::vector<SimpleDefault> isc::data::SimpleDefaults |
This specifies all default values in a given scope (e.g. a subnet)
Definition at line 31 of file lib/cc/simple_parser.h.
| typedef std::vector<StampedValuePtr> isc::data::StampedValueCollection |
Collection of pointers to values.
Definition at line 24 of file stamped_value.h.
| typedef boost::shared_ptr< StampedValue > isc::data::StampedValuePtr |
Pointer to the stamped value.
Definition at line 21 of file stamped_value.h.
| ElementPtr isc::data::copy | ( | ConstElementPtr | from, |
| int | level = 100 |
||
| ) |
Copy the data up to a nesting level.
The copy is a deep copy so nothing is shared if it is not under the given nesting level.
| from | the pointer to the element to copy |
| level | nesting level (default is 100, 0 means shallow copy, negative means outbound and perhaps looping forever). |
| raises | a BadValue is a null pointer occurs. |
Definition at line 1114 of file data.cc.
References isc_throw, and isNull().
Referenced by isc::dhcp::ClientClassDictionary::ClientClassDictionary(), isc::data::UserContext::contextToElement(), isc::dhcp::SrvConfig::copy(), isc::perfdhcp::TestControl::generateDuid(), isc::yang::Adaptor::getContext(), isc::dhcp::Option::getOptionsCopy(), isc::ha::HAConfig::getOtherServersConfig(), isc::lease_cmds::Lease4Parser::parse(), isc::dhcp::DHCPQueueControlParser::parse(), isc::lease_cmds::Lease6Parser::parse(), isc::dhcp::Pkt4o6::setCopyRetrievedOptions(), isc::dhcp::Pkt::setCopyRetrievedOptions(), isc::dhcp::Pkt4::setFile(), isc::yang::TranslatorConfig::setServerKeaDhcpCommon(), isc::dhcp::Pkt4::setSname(), and isc::data::UserContext::toElement().
Here is the call graph for this function:| bool isc::data::isEquivalent | ( | ConstElementPtr | a, |
| ConstElementPtr | b | ||
| ) |
Compares the data with other using unordered lists.
This comparison function handles lists (JSON arrays) as unordered multi sets (multi means an item can occurs more than once as soon as it occurs the same number of times).
Definition at line 1251 of file data.cc.
Referenced by isc::test::runToElementTest().
| bool isc::data::isNull | ( | ConstElementPtr | p | ) |
Checks whether the given ElementPtr is a NULL pointer.
| p | The ElementPtr to check |
Definition at line 1043 of file data.cc.
Referenced by isc::data::UserContext::contextToElement(), copy(), isc::hooks::HooksConfig::equal(), isc::hooks::HooksConfig::toElement(), and isc::dhcp::SrvConfig::toElement().
| void isc::data::merge | ( | ElementPtr | element, |
| ConstElementPtr | other | ||
| ) |
Merges the data from other into element.
(on the first level). Both elements must be MapElements. Every string,value pair in other is copied into element (the ElementPtr of value is copied, this is not a new object) Unless the value is a NullElement, in which case the key is removed from element, rather than setting the value to the given NullElement. This way, we can remove values from for instance maps with configuration data (which would then result in reverting back to the default). Raises a TypeError if either ElementPtr is not a MapElement
Definition at line 1096 of file data.cc.
References isc_throw.
Referenced by isc::agent::AgentParser::parse(), isc::netconf::NetconfParser::parse(), isc::d2::D2Parser::parse(), isc::dhcp::Dhcp4Parser::parse(), isc::dhcp::Dhcp6Parser::parse(), isc::dhcp::Subnet4::toElement(), and isc::dhcp::Subnet6::toElement().
Definition at line 215 of file data.cc.
References isc::data::Element::equals().
Here is the call graph for this function:| std::ostream & isc::data::operator<< | ( | std::ostream & | out, |
| const Element & | e | ||
| ) |
Insert the Element as a string into stream.
This method converts the ElementPtr into a string with Element::str() and inserts it into the output stream out.
This function overloads the global operator<< to behave as described in ostream::operator<< but applied to ElementPtr objects.
| out | A std::ostream object on which the insertion operation is performed. |
| e | The ElementPtr object to insert. |
std::ostream object referenced by parameter out after the insertion operation. Definition at line 205 of file data.cc.
References isc::data::Element::str().
Here is the call graph for this function:| std::ostream & isc::data::operator<< | ( | std::ostream & | out, |
| const Element::Position & | pos | ||
| ) |
Insert Element::Position as a string into stream.
This operator converts the Element::Position into a string and inserts it into the output stream out.
| out | A std::ostream object on which the insertion operation is performed. |
| pos | The Element::Position structure to insert. |
std::ostream object referenced by parameter out after the insertion operation. Definition at line 44 of file data.cc.
References isc::data::Element::Position::str().
Here is the call graph for this function:Definition at line 211 of file data.cc.
References isc::data::Element::equals().
Here is the call graph for this function:| void isc::data::prettyPrint | ( | ConstElementPtr | element, |
| std::ostream & | out, | ||
| unsigned | indent = 0, |
||
| unsigned | step = 2 |
||
| ) |
Pretty prints the data into stream.
This operator converts the ConstElementPtr into a string and inserts it into the output stream out with an initial indentation indent and add at each level step spaces. For maps if there is a comment property it is printed first.
| element | A ConstElementPtr to pretty print |
| out | A std::ostream on which the print operation is performed |
| indent | An initial number of spaces to add each new line |
| step | A number of spaces to add to indentation at a new level |
Definition at line 1256 of file data.cc.
References isc_throw, and prettyPrint().
Referenced by isc::netconf::StdoutControlSocket::configSet(), isc::netconf::NetconfAgent::keaConfig(), isc::test::runToElementTest(), isc::netconf::NetconfAgent::update(), isc::netconf::NetconfAgent::validate(), isc::process::Daemon::writeConfigFile(), and isc::netconf::NetconfAgent::yangConfig().
Here is the call graph for this function:| std::string isc::data::prettyPrint | ( | ConstElementPtr | element, |
| unsigned | indent = 0, |
||
| unsigned | step = 2 |
||
| ) |
Pretty prints the data into string.
This operator converts the ConstElementPtr into a string with an initial indentation indent and add at each level step spaces. For maps if there is a comment property it is printed first.
| element | A ConstElementPtr to pretty print |
| indent | An initial number of spaces to add each new line |
| step | A number of spaces to add to indentation at a new level |
Definition at line 1361 of file data.cc.
Referenced by prettyPrint().
| ConstElementPtr isc::data::removeIdentical | ( | ConstElementPtr | a, |
| ConstElementPtr | b | ||
| ) |
Create a new ElementPtr from the first ElementPtr, removing all values that are equal in the second.
Both ElementPtrs MUST be MapElements. The returned ElementPtr will be a MapElement that only contains new and changed values (for ModuleCCSession and configuration update handlers). Raises a TypeError if a or b are not MapElements
Definition at line 1072 of file data.cc.
References isc_throw.
| void isc::data::removeIdentical | ( | ElementPtr | a, |
| ConstElementPtr | b | ||
| ) |
Remove all values from the first ElementPtr that are equal in the second.
Both ElementPtrs MUST be MapElements The use for this function is to end up with a MapElement that only contains new and changed values (for ModuleCCSession and configuration update handlers) Raises a TypeError if a or b are not MapElements
Definition at line 1048 of file data.cc.
References isc_throw.