6int raw_ifstream::_nHandler = 0;
8pthread_mutex_t raw_ifstream::_pthread_lock = PTHREAD_MUTEX_INITIALIZER;
15 if ( _instance == 0 ) {
30 if ( _nHandler > 0 && --_nHandler == 0 ) {
31 if ( _instance->m_isOpen ) {
32 std::cout <<
"[RawFile] Closing: " << *(_instance->m_curFile) << std::endl;
43 : m_isOpen(
false), m_fnames(fnames)
45 if ( m_fnames.empty() ) {
49 m_curFile = m_fnames.begin();
59 std::cout <<
"[RawFile] Closing: " << *m_curFile << std::endl;
63 if ( ++m_curFile == m_fnames.end() ) {
76void raw_ifstream::init_fstream()
78 if ( access( m_curFile->c_str(), F_OK ) < 0 ) {
79 std::cerr <<
"[RawFile] Invalid file: " << *m_curFile << std::endl;
83 std::cout <<
"[RawFile] Prepare for reading: " << *m_curFile << std::endl;
85 open( m_curFile->c_str(), std::ios::binary );
89 (*this) >> m_fileStartRecord >> m_fileNameStrings >> m_runParametersRecord;
virtual void print() const
const run_parameters_record & getRecord() const
raw_ifstream(const std::vector< std::string > &fnames)
static raw_ifstream * instance(const std::vector< std::string > &fnames)