]> sigrok.org Git - libsigrok.git/commitdiff
bindings: Add accessor to obtain parent object.
authorMartin Ling <redacted>
Sun, 12 Oct 2014 16:48:44 +0000 (17:48 +0100)
committerBert Vermeulen <redacted>
Wed, 15 Oct 2014 11:44:44 +0000 (13:44 +0200)
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()
        {