NetconfAccess: enable passing libnetconf2 (C++) session directly
Instead of implementing all possible constructors twice, rely on the
underlying library (or rather its C++ bindings) to do the right thing,
and use that as a connection handle.
Change-Id: I954edc9bfbd1c909479db6b92b929aab93762810
diff --git a/src/netconf_access.cpp b/src/netconf_access.cpp
index 78d80b1..4f4a923 100644
--- a/src/netconf_access.cpp
+++ b/src/netconf_access.cpp
@@ -98,6 +98,13 @@
datastoreInit();
}
+NetconfAccess::NetconfAccess(std::unique_ptr<libnetconf::client::Session>&& session)
+ : m_session(std::move(session))
+ , m_schema(new YangSchema())
+{
+ datastoreInit();
+}
+
NetconfAccess::NetconfAccess(const std::string& socketPath)
: m_schema(new YangSchema())
{