[odb-users] Mapping a templated wrapper class

R. Cortland Tompkins cort.tompkins at ipconfigure.com
Mon Sep 9 22:16:15 EDT 2013

> You can probably make it work since the callbacks allow you to detect
> the first/last calls. You could then pass your wrapper as the callback
> argument and trigger its serialization/deserialization.

On second appraisal the callbacks were much more tractable than I had
initially realized.  I modified my approach to serialize/deserialize
on-the-fly, went back to using value_traits instead of wrapper_traits, and
modified the MS and Oracle callbacks as required.

On-the-fly serialization is an improvement, but the ODB compiler still
cannot map my wrapper type automatically.  E.g.:

     unable to map C++ type
'::archiveable<::boost::property_tree::basic_ptree< ::std::basic_string<
char >,  ::std::basic_string< char > > >' used in data member 'ptree_'.

Perhaps the ODB compiler fails because my value_traits specializations are
only partial specializations? E.g.:

    template<typename T>
    struct odb::sqlite::default_value_traits<archiveable<T>, id_text>

Cort Tompkins

More information about the odb-users mailing list