0

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?

Adi Shavit
  • 16,743
  • 5
  • 67
  • 137

1 Answers1

0

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.

Timo Bingmann
  • 294
  • 1
  • 4
  • That would be great. I'll look into the code to see if I can add this (maybe even make a PR if it works!). Thanks for an amazing library! – Adi Shavit Sep 18 '15 at 08:40