Alexander Nasonov wrote:
> class base_node // represent a base of a concrete class
> {
>     // ...
> 
>     //
>     virtual void* derived_to_base(void* base_ptr) const = 0;
> };

Oops, I made a little naming mistake: base_ptr should be derived_ptr.

BTW, compile-time retrospection could be used to find library-specific 
constructor. For example, Driver could have it:

class Driver : public Person
{
    std::string licence_id;
    Date licence_issue_date;

  public:

    Driver(const raw_object& raw)
      : Person(raw)
      , licence_id(raw.get(&Driver::licence_id))
      , licence_issue_date(raw.get(&Driver::licence_issue_date))
    {
    }

    // ..
};

If this information isn't available at compile-time you have to tell the 
framework about the constructor:

void describe_Driver(descriptor<Driver>& class_)
{
    class_("Driver").derived_from<Person>()
    [
        constructor<const raw_object&>(), // here
        member(&Driver::licence_id, "licence_id"),
        member(&Driver::licence_issue_date, "licence_issue_date")
    ];
}

-- 
Alexander Nasonov
Remove minus and all between minus and at from my e-mail for timely response


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to