[odb-users] Pimpl + Relations

Boris Kolpackov boris at codesynthesis.com
Tue Oct 2 08:39:39 EDT 2012

Hi Uwe,

cetoni GmbH - Uwe Kindler <uwe.kindler at cetoni.de> writes:

> I would like to know, if it is possible to move this member into
> the private implementation class LensMeasurmentPrivate and to use
> virtual member functions instead of the real data member.

Yes, any non-transient data member can be made virtual, including
object pointers and containers.

> I already tried this (see line 74 of code snippet). But this did not  
> work - ODB compiler tells me: invalid name in db pragma member. 

Line 74 in your code fragment looks like this:

> #pragma db member(boost::shared_ptr<CLens>) virtual(LensPtr) get(lens) set (setLens)

I think you mistakenly used the type rather than the name in the member()
clause. It probably should be something along these lines:

#pragma db member(Lens) virtual(LensPtr) get(lens) set(setLens)


More information about the odb-users mailing list