getline(infile, parastring);
}
- if (inbuffer != NULL)
- delete inbuffer;
-
- inbuffer = new boost::iostreams::filtering_istreambuf;
+ inbuffer = unique_ptr<boost::iostreams::filtering_istreambuf>(new boost::iostreams::filtering_istreambuf);
inbuffer->push( boost::iostreams::bzip2_decompressor() );
inbuffer->push(infile);
return 0;
}
-datread::~datread ()
-{
- if (inbuffer != NULL)
- delete inbuffer;
-}
-
int datread::readDataToMem (char *tmpData, long unsigned int dataSize)
{
int readturn = -1;
#include <ostream>
#include <fstream>
+#include <memory>
#include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/iostreams/filter/bzip2.hpp>
class datread {
public:
datread (const unsigned int& _blocksize, ostream *_log=NULL);
- ~datread ();
int openFile (const string& filename);
enum class Format {DAT, EDAT, SDAT};
void * getHeader (const string& headerid);
ifstream infile;
Format format;
string parastring;
- boost::iostreams::filtering_istreambuf *inbuffer;
+ unique_ptr<boost::iostreams::filtering_istreambuf> inbuffer;
ostream * const log;
int readDataToMem (char *tmpData, long unsigned int dataSize);
string filename;
void nextConfig();
char *confMem;
virtual void _newParas()=0;
+ virtual void _resetConfig()=0;
int nequi, nskip;
private:
virtual void _makeSweep()=0;