[odb-users] raw pointer to application's global array

MM finjulhich at gmail.com
Thu May 29 08:26:37 EDT 2014


also, in the virt member pragma

#pragma db member(foo) virtual(std::string) get(*this.foo_) set(set_foo)

My foo_ is actually public.

Can the setter be declared in the non intrusive header for the pragmas, as
a non member function?




On 29 May 2014 12:40, MM <finjulhich at gmail.com> wrote:

> On 29 May 2014 12:23, Boris Kolpackov <boris at codesynthesis.com> wrote:
>
>> Hi,
>>
>> MM <finjulhich at gmail.com> writes:
>>
>> > object actually has a couple of other members, 1 of which is
>> > std::string code
>> >
>> > The combination (foo_, code) is the unique identifier.
>> >
>> > Is it possible, non-intrusively, to have a auto-generated id?
>>
>> ODB only supports auto-generated ids for integers (by using the
>> corresponding underlying database's functionality). One way to
>> achieve the same for a string would be to generate UUIDs on the
>> application side. For example, you could use the Boost.Uuid
>> library. In that case it might even make sense to use
>> boost::uuids::uuid type instead of std::string (Section 23.6 in
>> the ODB manual).
>>
>> Boris
>>
> Ok, but can I have a virtual member integer that stands for auto generated
> id?
> If not, I'll just add a integer (std::uintx_t) as a member of that struct,
> and use that as the auto id.
>
> Thanks
>
>


More information about the odb-users mailing list