[odb-users] odb-epilogue conclusions

Christian Sell christian at gsvitec.com
Tue Dec 16 08:16:05 EST 2014


Hello,

 

after having solved my previous problem with invoking odb with the
--odb-epilogue option from within CMake, I am now faced with organizing the
epilogue headers. I dont remember reading anything about them, so I'll
quickly write down my findings:

 

when writing an epilogue header, you have to put in #include statements for
the mapped class AND for the epilogue headers of all persistent classes
referenced in the mapped class. For example, if you have classes Person and
Address,  like so:

 

//person.h:

class Person {

shared_ptr<Address> myaddress;

}

 

//Address.h:

class Address {

}

 

The epilogue header for Project will have to have

 

#include "person.h"

#include "address_epilogue.h"

 

This leads me to the conclusion that it might be best to lump all pragmas
for the whole project into one file, and pass that as epilogue to odb for
each input file..

 

Regards,

Chris



More information about the odb-users mailing list