Skip to content
Snippets Groups Projects
Commit 01728687 authored by Christoph Lehmann's avatar Christoph Lehmann
Browse files

[BL] Dima's comments: updated doc, changed return value.

parent e3191b83
No related branches found
No related tags found
No related merge requests found
......@@ -94,9 +94,8 @@ getConfSubtreeOptional(std::string const& root)
if (subtree) {
markVisited(root);
boost::optional<ConfigTreeNew> t;
t.emplace(*subtree, *this, root);
return std::move(t);
return boost::optional<ConfigTreeNew>(std::move(
ConfigTreeNew(*subtree, *this, root)));
} else {
markVisited(root, true);
return boost::optional<ConfigTreeNew>();
......
......@@ -170,8 +170,8 @@ public:
/*! Creates a new instance wrapping the given Boost Property Tree.
*
* \param tree the Boost Property Tree to be wrapped
* \param onerror callback function to be called on error.
* \param onwarning callback function to be called on warning.
* \param error_cb callback function to be called on error.
* \param warning_cb callback function to be called on warning.
*
* The callback functions must be valid callable functions, i.e. not nullptr's.
* They are configurable in order to make unit tests of this class easier.
......@@ -185,9 +185,6 @@ public:
Callback const& error_cb = onerror,
Callback const& warning_cb = onwarning);
//! Used for wrapping a subtree
explicit ConfigTreeNew(PTree const& tree, ConfigTreeNew const& parent, std::string const& root);
//! copying is not compatible with the semantics of this class
ConfigTreeNew(ConfigTreeNew const&) = delete;
......@@ -314,6 +311,9 @@ private:
std::type_index type;
};
//! Used for wrapping a subtree
explicit ConfigTreeNew(PTree const& tree, ConfigTreeNew const& parent, std::string const& root);
//! Called if an error occurs. Will call the error callback.
//! This method only acts as a helper method.
void error(std::string const& message);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment