[odb-users] ODB Named pragmas

Emilio Garcia emilio.garcia at ice.csic.es
Tue May 18 03:14:16 EDT 2021


Hi team,

Many thanks for your support.

I saw the definition pragma link, but I was guessing if it should work 
with both value types and object types since the example shows only the 
first one.

Thanks again!

Emilio Garcia Quintana
emilio.garcia at ice.csic.es <mailto:emilio.garcia at ice.csic.es>
*Software Engineer*
Tel: +34 93 737 97 88 <tel:0034937379788>
Ext: 933002 <tel:933002>

Campus UAB, Carrer de Can Magrans, s/n
08193 Cerdanyola del Vallés

ICE Logo

Institute of Space Sciences (CSIC-IEEC)
http://www.ice.csic.es <http://www.ice.csic.es>

On 5/11/21 2:53 PM, Boris Kolpackov wrote:
> Emilio Garcia <emilio.garcia at ieec.cat> writes:
>
>> And I would like to have:
>>
>>     // person.hxx
>>     class person
>>     {
>>     ...
>>     };
>>
>>     // person-pragmas.hxx
>>
>>     #include "person.hxx"
>>
>>     #pragma db object(person)
>>     #pragma db member(person::id_) id
>>
>> I must admit that I did not tried yet, I just wanted to confirm with you if
>> it is possible and If it would have any side-effect before going into this
>> approach.
> There are two ways you can achieve this. The first is described in
> the introduction of Chapter 14, "ODB Pragma Language"[1] and
> involves using the --odb-epilogue option to non-invasively include
> the person-pragmas.hxx header when compiling person.hxx with the ODB
> compiler.
>
> The alternative solution is to use the definition pragma[2] and
> compile person-pragmas.hxx. One side-effect of this approach is
> that the generated person-odb.hxx file will include person-pragmas.hxx
> and not person.hxx directly.
>
> [1] https://codesynthesis.com/products/odb/doc/manual.xhtml#14
> [2] https://codesynthesis.com/products/odb/doc/manual.xhtml#14.3.7
>



More information about the odb-users mailing list