Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-01-31 13:40:22

Stefan Roiser <stefan.roiser_at_[hidden]> writes:

> On 30 Jan 2006, at 17:08, Stefan Seefeld wrote:
> With interaction with objects I meant e.g. through the meta-level
> instantiate a class, get/set the data member values, call a function
> on that instance, retrieve the function's return value and so on. I
> may have missed that, but I couldn't find examples on the synopsis
> page for this functionality.
> Reflex code for this would look something like
> Type t = Type::ByName("foo");
> Object instance = t.Construct();
> Object ret_obj = instance.Invoke("myFunction");

Very interesting. Where do you get the object code for
foo::myFunction? Or have you implemented a full C++ interpreter?

Have you considered something like the object interface of

  Type t = Type::ByName("foo"):
  Object instance = t();
  Object ret_obj = instance.member("myFunction")();

Then you'd also have, e.g.

  Object enlarged = instance & 5;

Dave Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at