Browse Source

[1205a] Moved cfg_to_element.h to src/lib/cc

Francis Dupont 8 years ago
parent
commit
f0c8777592

+ 2 - 2
src/lib/cc/Makefile.am

@@ -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
 

+ 3 - 5
src/lib/dhcpsrv/cfg_to_element.h

@@ -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

+ 0 - 2
src/lib/dhcpsrv/Makefile.am

@@ -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 \

+ 2 - 2
src/lib/dhcpsrv/libdhcpsrv.dox

@@ -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