[odb-users] odb c++ and data preprocessing before persist

Boris Kolpackov boris at codesynthesis.com
Thu Feb 12 04:23:13 EST 2015

Hi Nick,

Николай Стороженко <aheadgoon at gmail.com> writes:

> I am checking byte order of binary data that i recieved, and if it
> need i must run hton/ntoh functions for c struct members and than run
> persist function. I have no opportunity to convert byte order of data to
> network byte order before it transmitting to me. Callbacks cant help me,
> and i cant reload persist or other functions for dynamic byte order checks.

Check out virtual data members (Section 14.4.13, "virtual"). The idea
is to provide accessors and modifiers that will do the conversion. In
fact, you probably don't even need the virtual data member. You can
just specify special accessors/modifiers that (only) ODB should use
(see Section 14.4.5, "get/set/access").


More information about the odb-users mailing list