[odb-users] composite value type

Boris Kolpackov boris at codesynthesis.com
Mon Jun 2 11:19:07 EDT 2014


Hi,

MM <finjulhich at gmail.com> writes:
 
> I can come up with some encoding from these date_time types to std::string,
> to store and load, which i can then store to db.

It doesn't have to be a string. You could encode it as a number of
columns that capture the state using convenient data types, etc. In
other words, think of a struct that would capture the state of your
tuple using basic types like strings, integers, date-time types
from the Boost profile, etc.

> I was hoping the date_time profile included a direct representation of this.

Even if it did, it wouldn't help you much since in your case you have
pointers of an abstract year_based_generator that point to the concrete
generator implementations with their own states.

In fact, who manages the lifetime of these generators? If there is
some fixed "registry" of them, then maybe you could store a "key"
to this registry instead of the state and type of the generator.

Boris



More information about the odb-users mailing list