]> granicus.if.org Git - graphviz/commitdiff
add GVLayout construction overload, passing the graph as an rvalue ref
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Wed, 7 Jul 2021 13:35:52 +0000 (15:35 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sat, 7 Aug 2021 09:08:53 +0000 (11:08 +0200)
lib/gvc++/GVLayout.cpp
lib/gvc++/GVLayout.h

index 7ebad6f86fe86fdc96210d9becd01eb70ed455ad..feab64aac14dbbee795c881dff0b149c530d5cb3 100644 (file)
@@ -30,6 +30,10 @@ GVLayout::GVLayout(GVContext &&gvc, CGraph::AGraph &&g,
     : GVLayout(std::make_shared<GVContext>(std::move(gvc)),
                std::make_shared<CGraph::AGraph>(std::move(g)), engine) {}
 
+GVLayout::GVLayout(std::shared_ptr<GVContext> gvc, CGraph::AGraph &&g,
+                   const std::string &engine)
+    : GVLayout(gvc, std::make_shared<CGraph::AGraph>(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) ||
index 9f851bffc73ecee300bed2dfc8d2a08957a8dbba..cffd80747219fe2191cd5151850664496fe51762 100644 (file)
@@ -27,6 +27,8 @@ public:
   GVLayout(const std::shared_ptr<GVContext> &gvc,
            const std::shared_ptr<CGraph::AGraph> &g, const std::string &engine);
   GVLayout(GVContext &&gvc, CGraph::AGraph &&g, const std::string &engine);
+  GVLayout(std::shared_ptr<GVContext> gvc, CGraph::AGraph &&g,
+           const std::string &engine);
   ~GVLayout();
 
   // default copy since we manage resources through movable types