billyquith/ponder

How to get UserObject from UserProperty ?

AntAgna opened this issue · 3 comments

In order to enumerate recursively trough properties of objects, I was using the constructor UserObject(const UserObject& parent, const UserProperty& member) to get a UserObject from a UserProperty.
But this constructor has been removed in commit 915bb38.

After a quick glance trough the code and the documentation, I could not find another way to get a UserObject from a UserProperty.

I added the simple method UserObject UserProperty::getObject(const UserObject& parentInstance) const, which provides this functionality without requiring parent-child information in UserObject.

Ok, I think I removed too much. 🔪

Just trying to get the naming right for this:

UserObject UserProperty::getObject(const UserObject& parentInstance)

Is it the parentInstance? Or just the objectInstance? The properties belong to the metaclass. So the relationship is more member than parent-child.

Yes, I wasn't sure how to name the parameter. objectInstance is a better choice.