]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2601] fix doxygen and add override final
authorAndrei Pavel <andrei@isc.org>
Tue, 8 Nov 2022 09:18:28 +0000 (11:18 +0200)
committerRazvan Becheriu <razvan@isc.org>
Fri, 25 Nov 2022 16:15:33 +0000 (18:15 +0200)
src/bin/netconf/http_control_socket.h
src/bin/netconf/netconf_cfg_mgr.h
src/bin/netconf/netconf_config.h
src/bin/netconf/netconf_controller.h
src/bin/netconf/netconf_process.h
src/bin/netconf/stdout_control_socket.h
src/bin/netconf/tests/control_socket_unittests.cc
src/bin/netconf/unix_control_socket.h
src/lib/yang/translator.cc
src/lib/yang/translator.h

index b63022c7e0e6e274f0c9d8a400a2d567c9257407..6bc83a66f044999bbb7ab3e288a3e8efbc880841 100644 (file)
@@ -37,7 +37,7 @@ public:
     /// @param service The target service.
     /// @return The JSON element answer of config-get.
     /// @throw ControlSocketError when a communication error occurs.
-    virtual data::ConstElementPtr configGet(const std::string& service);
+    data::ConstElementPtr configGet(const std::string& service) override final;
 
     /// @brief Test configuration.
     ///
@@ -47,8 +47,8 @@ public:
     /// @param service The target service.
     /// @return The JSON element answer of config-test.
     /// @throw ControlSocketError when a communication error occurs.
-    virtual data::ConstElementPtr configTest(data::ConstElementPtr config,
-                                             const std::string& service);
+    data::ConstElementPtr configTest(data::ConstElementPtr config,
+                                     const std::string& service) override final;
 
     /// @brief Set configuration.
     ///
@@ -58,8 +58,8 @@ public:
     /// @param service The target service.
     /// @return The JSON element answer of config-set.
     /// @throw ControlSocketError when a communication error occurs.
-    virtual data::ConstElementPtr configSet(data::ConstElementPtr config,
-                                            const std::string& service);
+    data::ConstElementPtr configSet(data::ConstElementPtr config,
+                                    const std::string& service) override final;
 
 private:
     /// @brief Perform the actual communication.
index c7568d4094f4f4d5c9f6f5935143f1d5ec4aafaf..3a9f472a3b9357f4c8941e79bac1e7a98d2e8304 100644 (file)
@@ -90,7 +90,7 @@ public:
     ///
     /// @return a pointer to a configuration which can be parsed into
     /// the initial configuration object
-    virtual isc::data::ElementPtr toElement() const;
+    isc::data::ElementPtr toElement() const override final;
 
 private:
 
@@ -142,25 +142,24 @@ public:
     /// to be returned. This parameter is ignored for Netconf.
     ///
     /// @return Summary of the configuration in the textual format.
-    virtual std::string getConfigSummary(const uint32_t selection);
+    std::string getConfigSummary(const uint32_t selection) override final;
 
     /// @brief Return a list of all paths that contain passwords or secrets for
     /// kea-netconf.
     ///
     /// @return the list of lists of sequential JSON map keys needed to reach
     /// the passwords and secrets.
-    std::list<std::list<std::string>> jsonPathsToRedact() const;
+    std::list<std::list<std::string>> jsonPathsToRedact() const override final;
 
 protected:
-
     /// @brief Parses configuration of Netconf.
     ///
     /// @param config Pointer to a configuration specified for netconf.
     /// @param check_only Boolean flag indicating if this method should
     /// only verify correctness of the provided configuration.
     /// @return Pointer to a result of configuration parsing.
-    virtual isc::data::ConstElementPtr
-    parse(isc::data::ConstElementPtr config, bool check_only);
+    isc::data::ConstElementPtr
+    parse(isc::data::ConstElementPtr config, bool check_only) override final;
 
     /// @brief Creates a new, blank NetconfConfig context.
     ///
@@ -172,7 +171,7 @@ protected:
     /// error.
     ///
     /// @return Returns a ConfigPtr to the new context instance.
-    virtual process::ConfigPtr createNewContext();
+    process::ConfigPtr createNewContext() override final;
 };  // NetconfCfgMgr
 
 /// @brief Defines a shared pointer to NetconfCfgMgr.
index 8671c07503fd4aad6d3856dd71df0b8f670322e7..b4f6339c8848c3eebaf5939148820c7bd7bd8cbe 100644 (file)
@@ -127,7 +127,7 @@ public:
     /// @brief Unparse a configuration object
     ///
     /// @return a pointer to a configuration
-    virtual isc::data::ElementPtr toElement() const;
+    isc::data::ElementPtr toElement() const override final;
 
 private:
     /// @brief The socket type.
@@ -234,7 +234,7 @@ public:
     /// @brief Unparse a configuration object
     ///
     /// @return a pointer to a configuration
-    virtual isc::data::ElementPtr toElement() const;
+    isc::data::ElementPtr toElement() const override final;
 
 private:
     /// @brief The model name.
index 02d4f3f776b4a258a09666417aeacd3c875606d4..6bbc4e091d91d35426aaac39728d31936914184e 100644 (file)
@@ -56,7 +56,7 @@ public:
     /// This method ignores SIGHUP as configuration reloading is not yet
     /// supported.
     /// @param signum signal number to process.
-    virtual void processSignal(int signum);
+    void processSignal(int signum) override final;
 
 private:
 
@@ -69,7 +69,7 @@ private:
     /// Note the caller is responsible for destructing the process. This
     /// is handled by the base class, which wraps this pointer with a smart
     /// pointer.
-    virtual process::DProcessBase* createProcess();
+    process::DProcessBase* createProcess() override final;
 
     /// @brief Constructor is declared private to maintain the integrity of
     /// the singleton instance.
index 302f33c1a9654323d53a09da9b21093afd572f4a..0c8b6ce7029973e73b1803bd9f0a9f728937dcc3 100644 (file)
@@ -42,12 +42,12 @@ public:
     /// as a place to perform any derivation-specific initialization steps
     /// that are inappropriate for the constructor but necessary prior to
     /// launch.
-    virtual void init();
+    void init() override final;
 
     /// @brief Implements the process's event loop.
     ///
     /// @throw DProcessBaseError if an operational error is encountered.
-    virtual void run();
+    void run() override final;
 
     /// @brief Initiates the process's shutdown process.
     ///
@@ -62,8 +62,8 @@ public:
     /// non-zero means failure), and a string explanation of the outcome.
     ///
     /// @throw DProcessBaseError if an operational error is encountered.
-    virtual isc::data::ConstElementPtr
-    shutdown(isc::data::ConstElementPtr args);
+    isc::data::ConstElementPtr
+    shutdown(isc::data::ConstElementPtr args) override final;
 
     /// @brief Processes the given configuration.
     ///
@@ -78,9 +78,9 @@ public:
     /// @return an Element that contains the results of configuration composed
     /// of an integer status value (0 means successful, non-zero means failure),
     /// and a string explanation of the outcome.
-    virtual isc::data::ConstElementPtr
+    isc::data::ConstElementPtr
     configure(isc::data::ConstElementPtr config_set,
-              bool check_only = false);
+              bool check_only = false) override final;
 
     /// @brief Returns a pointer to the configuration manager.
     NetconfCfgMgrPtr getNetconfCfgMgr();
index 79a8a45fad2df747ed13c6808e690b26eb455717..78eca2984d9f097e274148cd67cbf65f69b8f562 100644 (file)
@@ -40,7 +40,7 @@ public:
     /// @param service The target service (ignored).
     /// @return The JSON element answer of config-get.
     /// @throw NotImplemented
-    virtual data::ConstElementPtr configGet(const std::string& service);
+    data::ConstElementPtr configGet(const std::string& service) override final;
 
     /// @brief Test configuration.
     ///
@@ -49,8 +49,8 @@ public:
     /// @param config The configuration to test (ignored).
     /// @param service The target service (ignored).
     /// @return The JSON element answer of config-test (fixed answer).
-    virtual data::ConstElementPtr configTest(data::ConstElementPtr config,
-                                             const std::string& service);
+    data::ConstElementPtr configTest(data::ConstElementPtr config,
+                                     const std::string& service) override final;
 
     /// @brief Set configuration.
     ///
@@ -59,8 +59,8 @@ public:
     /// @param config The configuration to set.
     /// @param service The target service.
     /// @return The JSON element answer of config-set (fixed answer).
-    virtual data::ConstElementPtr configSet(data::ConstElementPtr config,
-                                            const std::string& service);
+    data::ConstElementPtr configSet(data::ConstElementPtr config,
+                                    const std::string& service) override final;
 
 protected:
     /// @brief Alternative constructor for tests.
index 10a5d2fa244a459d439a629bbf298cd5ab48b709..c5cd387a98e1c38976c12449b135320d616cb625 100644 (file)
@@ -428,8 +428,7 @@ public:
     /// @brief Create a new request.
     ///
     /// @return Pointer to the new instance of the HttpRequest.
-    virtual HttpRequestPtr
-        createNewHttpRequest() const {
+    HttpRequestPtr createNewHttpRequest() const  override final {
         return (HttpRequestPtr(new PostHttpRequestJson()));
     }
 
@@ -438,9 +437,9 @@ protected:
     ///
     /// @param request Pointer to the HTTP request.
     /// @return Pointer to the generated HTTP response.
-    virtual HttpResponsePtr
+    HttpResponsePtr
     createStockHttpResponse(const HttpRequestPtr& request,
-                            const HttpStatusCode& status_code) const {
+                            const HttpStatusCode& status_code) const override final {
         // Data is in the request context.
         HttpVersion http_version(request->context()->http_version_major_,
                                  request->context()->http_version_minor_);
@@ -504,7 +503,7 @@ class TestHttpResponseCreatorFactory : public HttpResponseCreatorFactory {
 public:
 
     /// @brief Creates @ref TestHttpResponseCreator instance.
-    virtual HttpResponseCreatorPtr create() const {
+    HttpResponseCreatorPtr create() const override final {
         HttpResponseCreatorPtr response_creator(new TestHttpResponseCreator());
         return (response_creator);
     }
index a05c5091e5d6f1a46a93ccc9a59f0667f17253b1..1e64392bc2f4d29086adf7464a81a4e8cfe8551f 100644 (file)
@@ -37,7 +37,7 @@ public:
     /// @param service The target service (ignored).
     /// @return The JSON element answer of config-get.
     /// @throw ControlSocketError when a communication error occurs.
-    virtual data::ConstElementPtr configGet(const std::string& service);
+    data::ConstElementPtr configGet(const std::string& service) override final;
 
     /// @brief Test configuration.
     ///
@@ -47,8 +47,8 @@ public:
     /// @param config The configuration to test.
     /// @return The JSON element answer of config-test.
     /// @throw ControlSocketError when a communication error occurs.
-    virtual data::ConstElementPtr configTest(data::ConstElementPtr config,
-                                             const std::string& service);
+    data::ConstElementPtr configTest(data::ConstElementPtr config,
+                                     const std::string& service) override final;
 
     /// @brief Set configuration.
     ///
@@ -58,8 +58,8 @@ public:
     /// @param service The target service (ignored).
     /// @return The JSON element answer of config-set.
     /// @throw ControlSocketError when a communication error occurs.
-    virtual data::ConstElementPtr configSet(data::ConstElementPtr config,
-                                            const std::string& service);
+    data::ConstElementPtr configSet(data::ConstElementPtr config,
+                                    const std::string& service) override final;
 
 private:
     /// @brief Perform the actual communication.
index acae31538662b8e2fb03b3711f280463bbc60692..b2df24b57ccc799b8d79447fc873ec1842f0133a 100644 (file)
@@ -145,7 +145,7 @@ Translator::encode64(string const& input) {
 }
 
 DataNode
-Translator::findXPath(string const& xpath) {
+Translator::findXPath(string const& xpath) const {
     optional<DataNode> const& data_node(getData(xpath));
     if (!data_node) {
         isc_throw(NetconfError, "no data at xpath " << xpath);
@@ -287,7 +287,7 @@ Translator::initializeSerializer() {
 }
 
 
-bool Translator::schemaNodeExists(string const& xpath) {
+bool Translator::schemaNodeExists(string const& xpath) const {
     Context const& context(session_.getContext());
     try {
         context.findPath(xpath);
index b8ea89e5a2f4598c5f22d87cb5a2cc2afe64fb92..1d279d4a77d2f7a2b1eb3ea32198e92c1883c7ce 100644 (file)
@@ -35,14 +35,13 @@ public:
     ///
     /// @param storage ElementMap where result will be stored
     /// @param data_node parent data node of container type
-    /// @param key where to set the result in the {storage} map
     /// @param xpath relative xpath to search by
     /// @param translate function to be called to translate a data node to an element pointer
     template <typename T>
     void checkAndGet(isc::data::ElementPtr const& storage,
                      libyang::DataNode const& data_node,
                      std::string const& xpath,
-                     T translate) {
+                     T translate) const {
         libyang::Set<libyang::DataNode> const& nodes(data_node.findXPath(xpath));
         if (!nodes.empty()) {
             isc::data::ElementPtr const& element(translate(nodes.front()));
@@ -70,7 +69,7 @@ public:
                               libyang::DataNode const& data_node,
                               std::string const& key,
                               std::string const& xpath,
-                              T translate) {
+                              T translate) const {
         libyang::Set<libyang::DataNode> const& nodes(data_node.findXPath(xpath));
         if (!nodes.empty()) {
             isc::data::ElementPtr const& element(translate(nodes.front()));
@@ -85,7 +84,7 @@ public:
     ///
     /// @param storage ElementMap where result will be stored
     /// @param data_node parent data node of container type
-    /// @param name name of the parameter
+    /// @param name the name of the parameter to be set in storage
     void checkAndGetLeaf(isc::data::ElementPtr& storage,
                          libyang::DataNode const& data_node,
                          std::string const& name) const;
@@ -98,7 +97,8 @@ public:
     ///
     /// @param storage ElementMap where result will be stored
     /// @param data_node parent data node of container type
-    /// @param name name of the parameter
+    /// @param name the name of the parameter to be set in storage
+    /// @param yang_name the name by which to find the parameter in the YANG data node
     void checkAndGetDivergingLeaf(isc::data::ElementPtr& storage,
                                   libyang::DataNode const& data_node,
                                   std::string const& name,
@@ -109,7 +109,7 @@ public:
     ///
     /// @param storage ElementMap where result will be stored
     /// @param data_node parent data node of container type
-    /// @param name name of the parameter
+    /// @param name the name of the parameter to be set in storage
     void checkAndGetAndJsonifyLeaf(isc::data::ElementPtr& storage,
                                    libyang::DataNode const& data_node,
                                    const std::string& name) const;
@@ -121,7 +121,6 @@ public:
     /// @param xpath the xpath to the YANG node without the last node
     /// @param name the name of the YANG node which should also match the map
     /// key in the JSON configuration
-    /// @param type the sysrepo node type
     void checkAndJsonifyAndSetLeaf(isc::data::ConstElementPtr const& from,
                                    std::string const& xpath,
                                    std::string const& name);
@@ -147,8 +146,8 @@ public:
     ///
     /// @param from the parent configuration node from which to take the value
     /// @param xpath the xpath to the YANG node without the last node
-    /// @param name the name of the YANG node which should also match the map
-    /// key in the JSON configuration
+    /// @param name the name of the parameter to be set in storage
+    /// @param yang_name the name by which to find the parameter in the YANG data node
     /// @param type the sysrepo node type
     void checkAndSetDivergingLeaf(isc::data::ConstElementPtr const& from,
                                   std::string const& xpath,
@@ -161,8 +160,7 @@ public:
     ///
     /// @param from the parent configuration node from which to take the value
     /// @param xpath the xpath to the YANG node without the last node
-    /// @param name the name of the YANG node which should also match the map
-    /// key in the JSON configuration
+    /// @param name the name of the parameter to be set in storage
     /// @param type the sysrepo node type
     void checkAndSetLeafList(isc::data::ConstElementPtr const& from,
                              std::string const& xpath,
@@ -174,9 +172,6 @@ public:
     ///
     /// @param from the parent configuration node from which to take the value
     /// @param xpath the xpath to the YANG node without the last node
-    /// @param name the name of the YANG node which should also match the map
-    /// key in the JSON configuration
-    /// @param type the sysrepo node type
     void checkAndSetUserContext(isc::data::ConstElementPtr const& from,
                                 std::string const& xpath);
 
@@ -196,7 +191,7 @@ public:
     /// @return the requested YANG data node
     ///
     /// @throw NetconfError if no YANG data node was found
-    libyang::DataNode findXPath(std::string const& xpath);
+    libyang::DataNode findXPath(std::string const& xpath) const;
 
     /// @brief Run a function for a node and all its children.
     ///
@@ -210,7 +205,7 @@ public:
     /// @param f the function to be called on the node itself and each
     /// descendant
     template <typename functor_t>
-    void forAll(std::string const& xpath, functor_t f) {
+    void forAll(std::string const& xpath, functor_t f) const {
         std::optional<libyang::DataNode> const& data_node(session_.getData(xpath));
         if (!data_node) {
             return;
@@ -228,7 +223,7 @@ public:
     /// @param xpath the xpath to be checked
     ///
     /// @return true if the YANG node exists in the schema, false otherwise
-    bool schemaNodeExists(std::string const& xpath);
+    bool schemaNodeExists(std::string const& xpath) const;
 
     /// @brief Get a YANG data node found at the given absolute xpath.
     ///
@@ -283,7 +278,7 @@ public:
     isc::data::ElementPtr getList(libyang::DataNode const& data_node,
                                   std::string const& xpath,
                                   T& t,
-                                  isc::data::ElementPtr (T::*f)(libyang::DataNode const&)) {
+                                  isc::data::ElementPtr (T::*f)(libyang::DataNode const&)) const {
         try {
             libyang::Set<libyang::DataNode> const& nodes(data_node.findXPath(xpath));
             if (nodes.empty()) {
@@ -322,6 +317,7 @@ public:
     /// @param storage ElementMap where result will be stored
     /// @param data_node parent data node of container type
     /// @param name name of the parameter
+    /// @param yang_name the name by which to find the parameter in the YANG data node
     ///
     /// @throw MissingNode if leaf is not found
     void getMandatoryDivergingLeaf(isc::data::ElementPtr& storage,
@@ -358,6 +354,7 @@ public:
     /// @param xpath the xpath to the YANG node without the last node
     /// @param name the name of the YANG node which should also match the map
     /// key in the JSON configuration
+    /// @param yang_name the name by which to find the parameter in the YANG data node
     /// @param type the sysrepo node type
     void setMandatoryDivergingLeaf(isc::data::ConstElementPtr const& from,
                                    std::string const& xpath,