From ee83b6310775fe153f3296f234335e727ded3425 Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 22 Nov 2020 03:09:21 -0500 Subject: [PATCH] c++: add Plane::reparent_family() #1078 --- include/ncpp/Plane.hh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/ncpp/Plane.hh b/include/ncpp/Plane.hh index 728107068..d4e190848 100644 --- a/include/ncpp/Plane.hh +++ b/include/ncpp/Plane.hh @@ -321,6 +321,25 @@ namespace ncpp return reparent (const_cast(&newparent)); } + Plane* reparent_family (Plane *newparent = nullptr) const noexcept + { + ncplane *ret = ncplane_reparent_family (plane, newparent == nullptr ? nullptr : newparent->plane); + if (ret == nullptr) + return nullptr; + + return map_plane (ret); + } + + Plane* reparent_family (const Plane *newparent) const noexcept + { + return reparent_family (const_cast(newparent)); + } + + Plane* reparent_family (const Plane &newparent) const noexcept + { + return reparent_family (const_cast(&newparent)); + } + void home () const noexcept { ncplane_home (plane);