1 #ifndef MULTIFILEINDEX_H
2 #define MULTIFILEINDEX_H
7 #include <typelib/registry.hh>
8 #include <boost/function.hpp>
14 class InputDataStream;
24 } __attribute__((packed));
26 std::vector<IndexEntry> index;
27 std::vector<LogFile *> logFiles;
28 std::vector<Stream *> streams;
29 std::map<Stream *, size_t> streamToGlobalIdx;
30 size_t globalSampleCount;
31 Typelib::Registry combinedRegistry;
46 return globalSampleCount;
51 if(globalSamplePos > globalSampleCount - 1)
52 throw std::runtime_error(
"Error, Sample out of index requested");
54 return index[globalSamplePos].globalStreamIdx;
61 if(globalSamplePos > globalSampleCount - 1)
62 throw std::runtime_error(
"Error, Sample out of index requested");
64 return index[globalSamplePos].stream;
69 if(globalSamplePos > globalSampleCount - 1)
70 throw std::runtime_error(
"Error, Sample out of index requested");
72 return index[globalSamplePos].sampleNrInStream;
83 return combinedRegistry;
86 bool createIndex(
const std::vector<LogFile *> &logfiles);
87 bool createIndex(
const std::vector<std::string> &fileNames);
90 boost::function<bool (Stream *stream)> streamCheck;
93 #endif // MULTIFILEINDEX_H
Definition: MultiFileIndex.hpp:16
bool createIndex(const std::vector< LogFile * > &logfiles)
Definition: MultiFileIndex.cpp:28
size_t getPosInStream(size_t globalSamplePos) const
Definition: MultiFileIndex.hpp:67
~MultiFileIndex()
Definition: MultiFileIndex.cpp:21
MultiFileIndex()
Definition: MultiFileIndex.cpp:16
const std::vector< Stream * > getAllStreams() const
Definition: MultiFileIndex.hpp:39
Typelib::Registry & getCombinedRegistry()
Definition: MultiFileIndex.hpp:81
void registerStreamCheck(boost::function< bool(Stream *stream)> test)
Definition: MultiFileIndex.cpp:147
size_t globalStreamIdx
Definition: MultiFileIndex.hpp:151
uint64_t sampleNrInStream
Definition: MultiFileIndex.hpp:148
size_t getGlobalStreamIdx(size_t globalSamplePos) const
Definition: MultiFileIndex.hpp:49
size_t getSize() const
Definition: MultiFileIndex.hpp:44
Stream * stream
Definition: MultiFileIndex.hpp:150
Stream * getSampleStream(size_t globalSamplePos) const
Definition: MultiFileIndex.hpp:59
IndexEntry()
Definition: MultiFileIndex.hpp:148