|
Boost : |
From: remi.chateauneu_at_[hidden]
Date: 2007-05-12 09:33:58
Dean Michael Berris a écrit :
> On 5/11/07, remi.chateauneu_at_[hidden] <remi.chateauneu_at_[hidden]> wrote:
>
>> I would like to know if a library for reflection might be of interest.
>> A first release is available on http://sourceforge.net/projects/crd/ and
>> it uses, as data description, a class which is very close to boost::vector,
>> without explicitely referring to it, for the moment.
>>
>
> How is this different from something like Boost.Serialization?
>
Thanks for your interest.
This library does not specifically aim at serialization, but more
generally at providing for a given class, the list of its members.
Given such a list - a kind of tuple - it is possible to apply algorithms
which basically iterates over the members of this class. For example:
struct MyClass {
type1 _Field1 ;
type2 _Field2 ;
};
SQL queries:
"select <Field1>, <Field2> ... from table etc..."
Comparisons:
x._Field1 == y._Field1 && x._Field2 == y._Field2 ...
Serialization:
std::cout << _Field1 << _Field2 ...
XDR marshalling:
xdr_type1( &xdr, &_Field1 );
xdr_type2( &xdr, &_Field2 );
etc...
Most of these features are implemented and running. It is designed to
add more 'plugins' of this type - and of course Boost.Serialization is
worth trying. A class can have as many members list as needed, and does
not have to be changed because the members lists are different objects.
The need came out of applications with dozens of business classes, where
the database persistence routines had to be re-written all the time.
> Do you have more readable documentation about the library?
>
Unfortunately not for the moment, although the code is short (1100 lines
in four files, without test programs) and well-documented, with examples.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk