Mapping an stxxl::vector to a File with Header

169 views Asked by At

I have a large binary (STL) file that begins with a known and fixed size header and then continues with a bunch of fixed size buffers (PODs) representing consecutive records.

I want to map the record part of the file to an stxxl::vector for fast out-of-core processing.
The stxxl::vector<> has a ctor that accepts a stxxl::file, but I don't know how to tell the ctor to start the file parsing from the correct offset.

Can I do this and if so how?

1

There are 1 answers

1
Timo Bingmann On

Yes, this should be possible to implement rather easily.

The stxxl::vector has a constructor which uses a file. vector_type v(&f);

This constructor just makes blocks which references the file blocks by offset. You could modify this constructor to add an extra header offset.