]> sigrok.org Git - libsigrok.git/blobdiff - bindings/cxx/include/libsigrok/libsigrok.hpp
bindings: Add accessor to obtain parent object.
[libsigrok.git] / bindings / cxx / include / libsigrok / libsigrok.hpp
index 0bd27f3adffe7c3a7d0a965c0ba73b47962fa035..1936d4d5d2820c3de60e395d199e64442890199f 100644 (file)
@@ -149,6 +149,12 @@ protected:
        weak_ptr<Class> _weak_this;
 
 public:
+       /* Get parent object that owns this object. */
+       shared_ptr<Parent> parent()
+       {
+               return _parent;
+       }
+
        /* Note, this implementation will create a new smart_ptr if none exists. */
        shared_ptr<Class> shared_from_this()
        {