]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1205a] Moved cfg_to_element.h to src/lib/cc
authorFrancis Dupont <fdupont@isc.org>
Fri, 3 Mar 2017 12:49:21 +0000 (13:49 +0100)
committerFrancis Dupont <fdupont@isc.org>
Fri, 3 Mar 2017 12:49:21 +0000 (13:49 +0100)
src/lib/cc/Makefile.am
src/lib/cc/cfg_to_element.h [moved from src/lib/dhcpsrv/cfg_to_element.h with 84% similarity]
src/lib/dhcpsrv/Makefile.am
src/lib/dhcpsrv/libdhcpsrv.dox

index cbce1325e108bdade921a89c75cd0c3a6ca549bb..8fd120b84ad7ddfc80428ebaef5cf22a7531bed4 100644 (file)
@@ -6,7 +6,7 @@ AM_CXXFLAGS = $(KEA_CXXFLAGS)
 
 lib_LTLIBRARIES = libkea-cc.la
 libkea_cc_la_SOURCES = data.cc data.h
-libkea_cc_la_SOURCES += dhcp_config_error.h
+libkea_cc_la_SOURCES += cfg_to_element.h dhcp_config_error.h
 libkea_cc_la_SOURCES += command_interpreter.cc command_interpreter.h
 libkea_cc_la_SOURCES += simple_parser.cc simple_parser.h
 
@@ -18,7 +18,7 @@ libkea_cc_la_LDFLAGS = -no-undefined -version-info 1:0:0
 # Since data.h is now used in the hooks interface, it needs to be
 # installed on target system.
 libkea_cc_includedir = $(pkgincludedir)/cc
-libkea_cc_include_HEADERS = data.h dhcp_config_error.h
+libkea_cc_include_HEADERS = cfg_to_element.h data.h dhcp_config_error.h
 
 EXTRA_DIST = cc.dox
 
similarity index 84%
rename from src/lib/dhcpsrv/cfg_to_element.h
rename to src/lib/cc/cfg_to_element.h
index 2603204000d90c7fc6db4690719c6df8c107d181..3fc8214751de736cd0c6ec3a776d23d623b2dea8 100644 (file)
@@ -22,11 +22,10 @@ public:
         isc::Exception(file, line, what) { };
 };
 
-namespace dhcp {
+namespace data {
 
 /// @brief Abstract class for configuration Cfg_* classes
 ///
-template<typename ... Args>
 struct CfgToElement {
     /// Destructor
     virtual ~CfgToElement() { }
@@ -35,13 +34,12 @@ struct CfgToElement {
     ///
     /// Returns an element which must parse into the same objet, i.e.
     /// @code
-    /// for all valid config C parse(toElement(parse(C)) == parse(C)
+    /// for all valid config C parse(parse(C)->toElement()) == parse(C)
     /// @endcode
     ///
-    /// @param extras extra arguments
     /// @return a pointer to a configuration which can be parsed into
     /// the initial configuration object
-    virtual isc::data::ElementPtr toElement(Args... extras) const = 0;
+    virtual isc::data::ElementPtr toElement() const = 0;
 };
 
 }; // namespace isc::dhcp
index ca97321646f28e421ee382d4e41f22002fd6d6db..6c8f48bb0f3e2b1eba56f72a4be41f65f578b1ac 100644 (file)
@@ -85,7 +85,6 @@ libkea_dhcpsrv_la_SOURCES += alloc_engine.cc alloc_engine.h
 libkea_dhcpsrv_la_SOURCES += alloc_engine_log.cc alloc_engine_log.h
 libkea_dhcpsrv_la_SOURCES += base_host_data_source.h
 libkea_dhcpsrv_la_SOURCES += callout_handle_store.h
-libkea_dhcpsrv_la_SOURCES += cfg_to_element.h
 libkea_dhcpsrv_la_SOURCES += cfg_4o6.h
 libkea_dhcpsrv_la_SOURCES += cfg_db_access.cc cfg_db_access.h
 libkea_dhcpsrv_la_SOURCES += cfg_duid.cc cfg_duid.h
@@ -223,7 +222,6 @@ EXTRA_DIST += logging.spec
 # following headers are anticipated to be useful for the user libraries.
 libkea_dhcpsrv_includedir = $(pkgincludedir)/dhcpsrv
 libkea_dhcpsrv_include_HEADERS = \
-    cfg_to_element.h \
     cfg_option.h \
     cfg_4o6.h \
     d2_client_cfg.h \
index 6f3eec57d5f2c6f6483890f731a204140c66c4cd..7097b908aa9c1f3afacdf2757d164d4bb28e014b 100644 (file)
@@ -80,11 +80,11 @@ predecessor of the current configuration, the value of 2 identifies the
 one that occurred before it etc.
 
 All configuration classes are derived from the abstract base class
-\ref isc::dhcp::CfgBase and define the unparse virtual method
+\ref isc::data::CfgToElement and define the toElement virtual method
 which returns a \ref isc::data::ConstElementPtr which must be
 parsed into the same object, i.e. fullfil this property:
 @code
-for all valid C: parse(unparse(parse(C))) == parse(C)
+for all valid C: parse(parse(C)->toElement()) == parse(C)
 @endcode