Parcourir la source

[5134_rebase] Changes after review:

 - comments updated
 - parameters passed by const reference
 - .gitignore updated
 - unnecessary header removed
Tomek Mrugalski il y a 8 ans
Parent
commit
a904d5f7ea

+ 3 - 2
src/bin/agent/simple_parser.cc

@@ -49,7 +49,7 @@ const SimpleDefaults AgentSimpleParser::SOCKET_DEFAULTS = {
 /// --- end of default values -------------------------------------------------
 /// ---------------------------------------------------------------------------
 
-size_t AgentSimpleParser::setAllDefaults(isc::data::ElementPtr global) {
+size_t AgentSimpleParser::setAllDefaults(const isc::data::ElementPtr& global) {
     size_t cnt = 0;
 
     // Set global defaults first.
@@ -78,7 +78,8 @@ size_t AgentSimpleParser::setAllDefaults(isc::data::ElementPtr global) {
 }
 
 void
-AgentSimpleParser::parse(CtrlAgentCfgContextPtr ctx, isc::data::ConstElementPtr config,
+AgentSimpleParser::parse(const CtrlAgentCfgContextPtr& ctx,
+                         const isc::data::ConstElementPtr& config,
                          bool check_only) {
 
     // Let's get the HTTP parameters first.

+ 8 - 6
src/bin/agent/simple_parser.h

@@ -13,11 +13,12 @@
 namespace isc {
 namespace agent {
 
-/// @brief SimpleParser specialized for DHCPv4
+/// @brief SimpleParser specialized for Control Agent
+///
+/// This class is a @ref isc::data::SimpleParser dedicated to Control Agent.
+/// In particular, it contains all the default values for the whole
+/// agent and for the socket defaults.
 ///
-/// This class is a @ref isc::data::SimpleParser dedicated to DHCPv4 parser.
-/// In particular, it contains all the default values and names of the
-/// parameters that are to be derived (inherited) between scopes.
 /// For the actual values, see @file agent/simple_parser.cc
 class AgentSimpleParser : public isc::data::SimpleParser {
 public:
@@ -27,7 +28,7 @@ public:
     ///
     /// @param global scope to be filled in with defaults.
     /// @return number of default values added
-    static size_t setAllDefaults(isc::data::ElementPtr global);
+    static size_t setAllDefaults(const isc::data::ElementPtr& global);
 
     /// @brief Parses the control agent configuration
     ///
@@ -36,7 +37,8 @@ public:
     /// @param check_only - if true the configuration is verified only, not applied
     ///
     /// @throw ConfigError if any issues are encountered.
-    void parse(CtrlAgentCfgContextPtr ctx, isc::data::ConstElementPtr config,
+    void parse(const CtrlAgentCfgContextPtr& ctx,
+               const isc::data::ConstElementPtr& config,
                bool check_only);
 
     // see simple_parser.cc for comments for those parameters

+ 2 - 1
src/bin/agent/tests/.gitignore

@@ -1,2 +1,3 @@
-/ctrl_agent_unittest
+/run_unittest
 /ctrl_agent_process_tests.sh
+/test_libraries.h

+ 0 - 1
src/bin/agent/tests/basic_library.cc

@@ -15,7 +15,6 @@
 
 #include <config.h>
 #include <hooks/hooks.h>
-#include <fstream>
 
 using namespace isc::hooks;
 using namespace std;

+ 0 - 1
src/lib/hooks/tests/.gitignore

@@ -1,4 +1,3 @@
 /marker_file.h
 /test_libraries.h
-
 /run_unittests