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

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