BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
raw_ifstream Class Reference

#include <raw_ifstream.h>

+ Inheritance diagram for raw_ifstream:

Public Member Functions

std::string currentFile () const
 
void next_file ()
 

Static Public Member Functions

static raw_ifstreaminstance (const std::vector< std::string > &fnames)
 
static void release ()
 
static void lock ()
 
static void unlock ()
 

Detailed Description

Definition at line 13 of file raw_ifstream.h.

Member Function Documentation

◆ currentFile()

std::string raw_ifstream::currentFile ( ) const
inline

Definition at line 29 of file raw_ifstream.h.

29{ return *m_curFile; }

Referenced by RawFileReader::currentFile().

◆ instance()

raw_ifstream * raw_ifstream::instance ( const std::vector< std::string > &  fnames)
static

Definition at line 11 of file raw_ifstream.cxx.

12{
13 lock();
14
15 if ( _instance == 0 ) {
16 _instance = new raw_ifstream(fnames);
17 }
18
19 ++_nHandler;
20
21 unlock();
22
23 return _instance;
24}
static void unlock()
Definition: raw_ifstream.h:24
static void lock()
Definition: raw_ifstream.h:20

Referenced by RawFileReader::RawFileReader().

◆ lock()

static void raw_ifstream::lock ( )
inlinestatic

Definition at line 20 of file raw_ifstream.h.

20 {
21 int lstat = pthread_mutex_lock( &_pthread_lock );
22 assert( lstat == 0 );
23 };

Referenced by instance(), RawFileReader::nextEvent(), and release().

◆ next_file()

void raw_ifstream::next_file ( )

Definition at line 57 of file raw_ifstream.cxx.

58{
59 std::cout << "[RawFile] Closing: " << *m_curFile << std::endl;
60 close();
61 m_isOpen = false;
62
63 if ( ++m_curFile == m_fnames.end() ) {
64 --m_curFile;
65 throw ReachEndOfFileList();
66 }
67
68 init_fstream();
69}

◆ release()

void raw_ifstream::release ( )
static

Definition at line 26 of file raw_ifstream.cxx.

27{
28 lock();
29
30 if ( _nHandler > 0 && --_nHandler == 0 ) {
31 if ( _instance->m_isOpen ) {
32 std::cout << "[RawFile] Closing: " << *(_instance->m_curFile) << std::endl;
33 _instance->close();
34 }
35 delete _instance;
36 _instance = 0;
37 }
38
39 unlock();
40}

Referenced by RawFileReader::~RawFileReader().

◆ unlock()

static void raw_ifstream::unlock ( )
inlinestatic

Definition at line 24 of file raw_ifstream.h.

24 {
25 int lstat = pthread_mutex_unlock( &_pthread_lock );
26 assert( lstat == 0 );
27 };

Referenced by instance(), RawFileReader::nextEvent(), and release().


The documentation for this class was generated from the following files: