Closed billyquith closed 8 years ago
Is there any way of making this extensible?
I don't think it is possible, but thought I would ask the question.
One of the problems I have come up against is having multiple "user" types. It would be really nice if ponder::Value::type returned which user type it contains.
Well you get can get the class information from a UserObject?
Sorry for the slow response.
Actually, I forgot exactly the situation where I had problems with this, but I think it was something like:
... iterate through all members of a ponder::Class ...
switch (thisClass.property(i).type())
{
case ponder::stringType:
doSomething ();
break;
case ponder::userType:
doSomethingElse ();
break;
}
I think I was missing a way to get the class of the userType for a given property.
The property is abstract/generic. There is a ClassVisitor
which uses the visitor pattern to allow you to get the details.
Sorry, this was my mistake (again).
Thank you for your hint, I can see from the ClassVisitor
example that there is a ponder::UserProperty::getClass()
method which I can use to get at least the string identification for the class.
Don't worry about it. There are some aspects of this API that seem quite complicated. Perhaps look at the docs and see if they can be improved.
to: