From: Tomek Mrugalski Date: Mon, 30 Nov 2015 21:10:58 +0000 (+0100) Subject: [3569_rebase] Merge branch 'trac3569' into trac3569_rebase X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Ftrac3569_rebase;p=thirdparty%2Fkea.git [3569_rebase] Merge branch 'trac3569' into trac3569_rebase # Conflicts: # src/lib/dhcpsrv/host_mgr.h --- 108acb67e96bc862c73a4529db53e6f6303bc071 diff --cc src/lib/dhcpsrv/base_host_data_source.h index ce458b15f4,b566134703..ccdd27242f --- a/src/lib/dhcpsrv/base_host_data_source.h +++ b/src/lib/dhcpsrv/base_host_data_source.h @@@ -194,26 -181,11 +195,29 @@@ public /// @param host Pointer to the new @c Host object being added. virtual void add(const HostPtr& host) = 0; + /// @brief Return backend type + /// + /// Returns the type of the backend (e.g. "mysql", "memfile" etc.) + /// + /// @return Type of the backend. + virtual std::string getType() const = 0; + + /// @brief Commit Transactions + /// + /// Commits all pending database operations. On databases that don't + /// support transactions, this is a no-op. + virtual void commit() {}; + + /// @brief Rollback Transactions + /// + /// Rolls back all pending database operations. On databases that don't + /// support transactions, this is a no-op. + virtual void rollback() {}; }; + /// @brief HostDataSource pointer + typedef boost::shared_ptr HostDataSourcePtr; + } } diff --cc src/lib/dhcpsrv/host_mgr.h index 051a0fb66b,193e8441fa..942f7b0297 --- a/src/lib/dhcpsrv/host_mgr.h +++ b/src/lib/dhcpsrv/host_mgr.h @@@ -198,15 -198,14 +198,23 @@@ public /// @param host Pointer to the new @c Host object being added. virtual void add(const HostPtr& host); + /// @brief Return backend type + /// + /// Returns the type of the backend (e.g. "mysql", "memfile" etc.) + /// + /// @return Type of the backend. + virtual std::string getType() const { + return (std::string("host_mgr")); + } + + /// @brief Returns pointer to the host data source + /// + /// May return NULL + /// @return pointer to the host data source (or NULL) + HostDataSourcePtr getHostDataSource() const { + return (alternate_source); + } + private: /// @brief Private default constructor.