[odb-users] Re: Handling pimpl idiom in ODB

Boris Kolpackov boris at codesynthesis.com
Sun Aug 28 08:29:10 EDT 2011


Hi Uwe,

The support for composite value (and container) wrappers is in the
master. I also create an example that shows how to use this feature
to handle the C++ pimpl idiom:

http://www.codesynthesis.com/~boris/tmp/odb/pimpl-value.tar.gz

While at it, I discovered yet another limitation of this approach:
if you are using queries, you will have to specify the 'impl' value
type name before the data members, e.g., query::impl::age < 30 
instead of query::age < 30. This is quite ugly if you are using
queries and is the reason (along with other limitations I listed in
my previous email) why the above example is no in the odb-examples
package. I think the "recommended" way to handle the pimpl idiom in
ODB will be the "virtual data members" approach. However, other than
the mentioned limitations, the value type approach works fine.

I am planning to create another alpha release for 1.6.0 some time
soon, so you should have something packaged and ready to try by the
time you are back.

Boris



More information about the odb-users mailing list