[odb-users] base class, derived, separate headers and derived references base

MM finjulhich at gmail.com
Wed Jul 1 14:45:31 EDT 2015


On 26 June 2015 at 16:32, Boris Kolpackov <boris at codesynthesis.com> wrote:

> Hi,
>
> MM <finjulhich at gmail.com> writes:
>
> > Is this something that may have been addressed after some particular
> > version?
> >
> > I run 2.3.0
>
> I think so. Why don't you try 2.4.0?
>
> Boris
>
After all, perhaps i'm having a different issue:


dir1/A.hpp
===================
namespace NS
{

struct A {
...
...const T* underlying;
...
};
struct selector {
  int id;
  int type;
};
void set_A_underlying(A&, const selector&);

}


dir1_odb/A.hpp
====================
#include <odb/core.hxx>
namespace NS
{
#pragma db value(selector) definition

#pragma db object(A) table("A") definition
#pragma db member(A::underlying) transient
#pragma db member(A::ulid) virtual(selector) \
  get( selector(this.underlying->type(), this.underlying->id)) \
  set(set_A_underlying (this,(?)))
}


Calling odb on dir1_odb/A.hpp with the proper options generates
successfully the A.hxx A.ixx A.cxx

but compiling with that generates this error:

error: ‘image_type’ in ‘class
odb::access::composite_value_traits<NS::selector, (odb::database_id)1u>’
does not name a type

It looks like no traits get generated for selector.

Rds,


More information about the odb-users mailing list