Browse Source

[3681] Corrections to documentation of the DatabaseConnection class.

Marcin Siodelski 9 years ago
parent
commit
da54e0518e
2 changed files with 16 additions and 15 deletions
  1. 2 2
      src/lib/dhcpsrv/database_connection.cc
  2. 14 13
      src/lib/dhcpsrv/database_connection.h

+ 2 - 2
src/lib/dhcpsrv/database_connection.cc

@@ -18,7 +18,6 @@
 
 #include <boost/algorithm/string.hpp>
 #include <boost/foreach.hpp>
-#include <boost/scoped_ptr.hpp>
 #include <vector>
 
 using namespace std;
@@ -26,7 +25,8 @@ using namespace std;
 namespace isc {
 namespace dhcp {
 
-std::string DatabaseConnection::getParameter(const std::string& name) const {
+std::string
+DatabaseConnection::getParameter(const std::string& name) const {
     ParameterMap::const_iterator param = parameters_.find(name);
     if (param == parameters_.end()) {
         isc_throw(BadValue, "Parameter " << name << " not found");

+ 14 - 13
src/lib/dhcpsrv/database_connection.h

@@ -12,8 +12,8 @@
 // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 // PERFORMANCE OF THIS SOFTWARE.
 
-#ifndef DATA_SOURCE_H
-#define DATA_SOURCE_H
+#ifndef DATABASE_CONNECTION_H
+#define DATABASE_CONNECTION_H
 
 #include <boost/noncopyable.hpp>
 #include <exceptions/exceptions.h>
@@ -45,18 +45,17 @@ public:
 };
 
 
-/// @brief Common Data Source Class
+/// @brief Common database connection class.
 ///
 /// This class provides functions that are common for establishing
 /// connection with different types of databases; enables operations
 /// on access parameters strings. In particular, it provides a way
 /// to parse parameters in key=value format. This class is expected
-/// to be a base class for all LeaseMgr and possibly HostDataSource
-/// derived classes.
+/// to be a base class for all @ref LeaseMgr and possibly
+/// @ref BaseHostDataSource derived classes.
 class DatabaseConnection : public boost::noncopyable {
-
 public:
-    /// Database configuration parameter map
+    /// @brief Database configuration parameter map
     typedef std::map<std::string, std::string> ParameterMap;
 
     /// @brief Constructor
@@ -67,9 +66,11 @@ public:
         :parameters_(parameters) {
     }
 
-    /// @brief returns value of the parameter
+    /// @brief Returns value of a connection parameter.
+    ///
+    /// @param name Name of the parameter which value should be returned.
+    /// @return Value of one of the connection parameters.
     /// @throw BadValue if parameter is not found
-    /// @return parameter
     std::string getParameter(const std::string& name) const;
 
     /// @brief Parse database access string
@@ -79,8 +80,8 @@ public:
     ///
     /// @param dbaccess Database access string.
     ///
-    /// @return std::map<std::string, std::string> Map of keyword/value pairs.
-    static DatabaseConnection::ParameterMap parse(const std::string& dbaccess);
+    /// @return @ref ParameterMap of keyword/value pairs.
+    static ParameterMap parse(const std::string& dbaccess);
 
     /// @brief Redact database access string
     ///
@@ -92,7 +93,7 @@ public:
     /// @return Redacted database access string.
     static std::string redactedAccessString(const ParameterMap& parameters);
 
-protected:
+private:
 
     /// @brief List of parameters passed in dbconfig
     ///
@@ -106,4 +107,4 @@ protected:
 }; // end of isc::dhcp namespace
 }; // end of isc namespace
 
-#endif // DATA_SOURCE_H
+#endif // DATABASE_CONNECTION_H