Ninan Thomas wrote:
Quote:
I am posting this to two not so directly related groups. But i feel it
belongs to both.
I am trying to create a database at runtime in Berkeley DB and insert
and retrieve values from it. So I cannot pre compile the schema into a
C++ struct, as explained in the sleepycat documentation.
1) What is the most effecient way to do this? (This is a Berkeley DB
question) |
You are at the rigth way. Keep the elements using a vector, easy to use
with your algorithms, and keep persistence in a bdb. When you want to
write the db file, do dynamic allocation and write the complete buffer.
You cant do it any other way, because you cannot be confident of the
vector implementation; anyway, the raw_storage_iterator will not be of
any use for you, because the elements are an union of diferent types and
you must (?) choose in any way the member of the union you want to storage.