[odb-users] composite value type

MM finjulhich at gmail.com
Mon Jun 2 04:45:23 EDT 2014


Hi,

Even after reading parts of the extremely well written manual, I am still
unclear how to go about this:

I have an odb object C

struct C {
  std::string s1, ..., s5;
  V v;
};

where V has 2 persistent members, a container and a string.

class V {
private:
  std::vector<
    std::tuple< boost::gregorian::year_based_generator*,
                     boost::gregorian::year_based_generator**,*
                     boost::posix_time::time_period[5u]
    >
  >  data_;

  std::string x_;
};

For a non-intrusive change of V. I would add accessors to data_ and to x_;

Now for data_, I am not too sure what this maps to.

I would have a table of Cs. Each row being a C instance. But the V part of
the row cannot map simply as a couple of columns. In practice, I know my
data_ vector will have at most 3/4 entries, and most of the time just 1
entry.

How would you go about this?

Secondly, for the boost profile, I cannot see any mappings for the types I
use here (time_period, year_based_generator).
What kind of solution can I go for?


Your help is appreciated immensely, you provide the best I have ever seen
in any forum:-)

Regards,


More information about the odb-users mailing list