[odb-users] custom containers or not: boost::multi_array

MM finjulhich at gmail.com
Tue Jun 26 13:45:13 EDT 2018


Hello


class EL {
    std::uint32_t                          id_;
    std::vector<date>                  dates_;
    boost::multi_array<entry, 2> entries_;
};
/// dates_.size() == number or rows of entries_
/// number of cols of entries_ = N
/// entry is a struct that maps to a composite value type

My object target tables look like:

table "EL"
id
-------------
.
.
.


table "EL_rows"
ELid      date         entrycols
--------------------------------------
1             d1             entry11
1             d1             entry12
...
1             d1             entry1N

1             d2             entry21
1             d2             entry22
...
1             d2             entry2N

...

1             dM             entryM1
1             dM             entryM2
...
1             dM             entryMN
...
and so on for ELid 2 ....

If the class EL is constrainted in its definition, is the way to use a
custom container as explained in chapter 5.5?

The relationship that the row entries_[x] corresponds the date  dates_[x]
would have to be implemented somehow.

I'm at a loss as how to implement this really?


More information about the odb-users mailing list