X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=BamMultiReader.h;h=f1a2bb242e450785c5cacf32517d393a93fc9e1a;hb=aa89df8c4510f88b2101ce91e8c46b99387560bd;hp=0464256814f31349b42a0355c438e466308fb99b;hpb=12d1865e534b6561d0becb68afef351ebf0f74f8;p=bamtools.git diff --git a/BamMultiReader.h b/BamMultiReader.h index 0464256..f1a2bb2 100644 --- a/BamMultiReader.h +++ b/BamMultiReader.h @@ -13,6 +13,8 @@ // C++ includes #include +#include +#include // for pair using namespace std; @@ -22,7 +24,8 @@ using namespace std; namespace BamTools { -enum BamReaderState { START, END, CLOSED }; +// index mapping reference/position pairings to bamreaders and their alignments +typedef multimap, pair > AlignmentIndex; class BamMultiReader { @@ -89,21 +92,18 @@ class BamMultiReader { // utility void PrintFilenames(void); - void UpdateAlignments(void); - + void DumpAlignmentIndex(void); // private implementation private: - // TODO perhaps, for legibility, I should use a struct to wrap them all up - // But this may actually make things more confusing, as I'm only - // operating on them all simultaneously during GetNextAlignment - // calls. - // all these vectors are ordered the same - // readers.at(N) refers to the same reader as alignments.at(N) and readerStates.at(N) - vector readers; // the set of readers which we operate on - vector alignments; // the equivalent set of alignments we use to step through the files - vector readerStates; // states of the various readers - // alignment position? + + // the set of readers and alignments which we operate on, maintained throughout the life of this class + vector > readers; + + // readers and alignments sorted by reference id and position, to keep track of the lowest (next) alignment + // when a reader reaches EOF, its entry is removed from this index + AlignmentIndex alignments; + vector fileNames; };