void flush() { if ( ! flushed ) { flushed = true; implicitFlush(); PSGO->flush(); PSGO.reset(); uint64_t const offset = headerlength + PSGO->getWrittenBytes(); libmaus2::util::NumberSerialisation::serialiseNumber(*PMETA,offset); libmaus2::util::NumberSerialisation::serialiseNumber(*PMETA,valueswritten); PMETA->flush(); PMETA.reset(); assert ( POSI->tellp() == static_cast<int64_t>(offset) ); libmaus2::aio::InputStreamInstance::unique_ptr_type METAin(new libmaus2::aio::InputStreamInstance(metafn)); while ( METAin->peek() != std::istream::traits_type::eof() ) libmaus2::util::NumberSerialisation::serialiseNumber(*POSI,libmaus2::util::NumberSerialisation::deserialiseNumber(*METAin)); METAin.reset(); libmaus2::aio::FileRemoval::removeFile(metafn); // write index offset libmaus2::util::NumberSerialisation::serialiseNumber(*POSI,offset); POSI->flush(); POSI.reset(); } }
void flush() { assert ( pc != pe ); if ( curcnt ) { *(pc++) = rl_pair(cursym,curcnt); curcnt = 0; } implicitFlush(); // std::cerr << "Index size " << index.size()*2*sizeof(uint64_t) << " for " << this << std::endl;; if ( ! indexwritten ) { writer.flushBitStream(); uint64_t const indexpos = writer.getPos(); writeIndex(writer,index,indexpos,numsyms); indexwritten = true; } writer.flush(); }
void flush() { assert ( rc != re ); if ( currun.rlen ) { *(rc++) = currun; currun.rlen = 0; currun.sym = std::numeric_limits<int64_t>::min(); } implicitFlush(); // std::cerr << "Index size " << index.size()*2*sizeof(uint64_t) << " for " << this << std::endl;; if ( ! indexwritten ) { writer.flushBitStream(); uint64_t const indexpos = writer.getPos(); writeIndex(writer,index,indexpos); indexwritten = true; } writer.flush(); }
void flush() { if ( curcnt ) { *(pc++) = ptype(cursym,curcnt); implicitFlush(); curcnt = 0; } SGO.flush(); uint64_t const indexpos = SGO.getWrittenBytes(); writeIndex(indexpos); }
void encodeRun(SymBitRun const & SC) { if ( static_cast<SymBit const &>(SC) == static_cast<SymBit const &>(currun) ) { currun.rlen += SC.rlen; } else { if ( currun.rlen ) { *(rc++) = currun; if ( rc == re ) implicitFlush(); } currun = SC; } }
void encode(SymBit const & SC) { if ( SC == currun ) { currun.rlen += 1; } else { if ( currun.rlen ) { *(rc++) = currun; if ( rc == re ) implicitFlush(); } currun = SC; currun.rlen = 1; } }
void encode(uint64_t const sym) { if ( sym == cursym ) { curcnt++; } else if ( curcnt ) { *(pc++) = ptype(cursym,curcnt); if ( pc == pe ) implicitFlush(); cursym = sym; curcnt = 1; } else { assert ( sym != cursym ); cursym = sym; curcnt = 1; } }
void encode(uint64_t const v) { *(pc++) = v; if ( pc == pe ) implicitFlush(); }