[odb-users] ODB 1.4.0 and multiple profiles

Boris Kolpackov boris at codesynthesis.com
Wed May 18 02:51:12 EDT 2011


Uwe,

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

> I have a question regarding ODB profiles. We work with Qt so we would  
> need the ODB Qt profile. We also use some boost libraries so we would  
> need the QDB boost profile too. Because we prefer boost::shared_ptr to  
> QSharedPointer we would like to have boost::shared_ptr as default  
> pointer type for persistent objects. Is it possible to do this with ODB  
> - using profile boost and qt at the same time and making  
> boost::shared_ptr the default pointer type?

Nothing prevents you from using two profiles at the same time. The
easiest way to get boost::shared_ptr as the default pointer is to 
make sure the -p (or --profile) ODB compiler option for Boost comes
after Qt, for example:

odb -d mysql -p qt -p boost file.hxx

Alternatively, you can override the default pointer type with the
--default-pointer option explicitly:

odb -d mysql -p boost -p qt --default-pointer boost::shared_ptr file.hxx

Note that --default-pointer must come after all th -p options.

Boris



More information about the odb-users mailing list