bindings: Add accessor to obtain parent object.

This commit is contained in:
Martin Ling 2014-10-12 17:48:44 +01:00 committed by Bert Vermeulen
parent f591826cc7
commit 73a1eb017b
1 changed files with 6 additions and 0 deletions

View File

@ -149,6 +149,12 @@ protected:
weak_ptr<Class> _weak_this; weak_ptr<Class> _weak_this;
public: 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. */ /* Note, this implementation will create a new smart_ptr if none exists. */
shared_ptr<Class> shared_from_this() shared_ptr<Class> shared_from_this()
{ {