BOSS 7.0.5
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 ()
 
uint32_t runNo ()
 
std::string currentFile () const
 
void next_file ()
 
uint32_t runNo ()
 

Static Public Member Functions

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

Detailed Description

Member Function Documentation

◆ currentFile() [1/2]

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

Definition at line 29 of file Event/RawFile/RawFile-00-00-10/RawFile/raw_ifstream.h.

29{ return *m_curFile; }

Referenced by RawFileReader::currentFile().

◆ currentFile() [2/2]

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

Definition at line 29 of file InstallArea/include/RawFile/RawFile/raw_ifstream.h.

29{ return *m_curFile; }

◆ instance() [1/2]

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}

Referenced by RawFileReader::RawFileReader().

◆ instance() [2/2]

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

◆ lock() [1/2]

static void raw_ifstream::lock ( )
inlinestatic

Definition at line 20 of file Event/RawFile/RawFile-00-00-10/RawFile/raw_ifstream.h.

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

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

◆ lock() [2/2]

static void raw_ifstream::lock ( )
inlinestatic

Definition at line 20 of file InstallArea/include/RawFile/RawFile/raw_ifstream.h.

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

◆ next_file() [1/2]

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}
file close()

◆ next_file() [2/2]

void raw_ifstream::next_file ( )

◆ release() [1/2]

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().

◆ release() [2/2]

static void raw_ifstream::release ( )
static

◆ runNo() [1/2]

uint32_t raw_ifstream::runNo ( )

Definition at line 71 of file raw_ifstream.cxx.

72{
73 return m_runParametersRecord.getRecord().run_number;
74}
const run_parameters_record & getRecord() const

Referenced by RawFileReader::runNo().

◆ runNo() [2/2]

uint32_t raw_ifstream::runNo ( )

◆ unlock() [1/2]

static void raw_ifstream::unlock ( )
inlinestatic

Definition at line 24 of file Event/RawFile/RawFile-00-00-10/RawFile/raw_ifstream.h.

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

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

◆ unlock() [2/2]

static void raw_ifstream::unlock ( )
inlinestatic

Definition at line 24 of file InstallArea/include/RawFile/RawFile/raw_ifstream.h.

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

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