From ed21df8522ffba044be6860acd9c90582d1ddb8a Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Wed, 7 Jul 2021 14:17:43 +0200 Subject: [PATCH] add GVLayout constructor overload, passing the context and the graph as rvalue refs --- lib/gvc++/GVLayout.cpp | 5 +++++ lib/gvc++/GVLayout.h | 1 + 2 files changed, 6 insertions(+) diff --git a/lib/gvc++/GVLayout.cpp b/lib/gvc++/GVLayout.cpp index 63159e7bf..7ebad6f86 100644 --- a/lib/gvc++/GVLayout.cpp +++ b/lib/gvc++/GVLayout.cpp @@ -25,6 +25,11 @@ GVLayout::GVLayout(const std::shared_ptr &gvc, } } +GVLayout::GVLayout(GVContext &&gvc, CGraph::AGraph &&g, + const std::string &engine) + : GVLayout(std::make_shared(std::move(gvc)), + std::make_shared(std::move(g)), engine) {} + GVLayout::~GVLayout() { // m_gvc and m_g always either both point to an object or both are null assert((m_gvc != nullptr && m_g != nullptr) || diff --git a/lib/gvc++/GVLayout.h b/lib/gvc++/GVLayout.h index 1c1d43bf6..9f851bffc 100644 --- a/lib/gvc++/GVLayout.h +++ b/lib/gvc++/GVLayout.h @@ -26,6 +26,7 @@ class GVLAYOUT_API GVLayout { public: GVLayout(const std::shared_ptr &gvc, const std::shared_ptr &g, const std::string &engine); + GVLayout(GVContext &&gvc, CGraph::AGraph &&g, const std::string &engine); ~GVLayout(); // default copy since we manage resources through movable types -- 2.40.0