11 #include <tr1/functional>
13 #include <QtCore/QMutexLocker>
22 using std::tr1::placeholders::_1;
30 if (_rootfiles.find(rootfilename) == _rootfiles.end())
32 _rootfiles[rootfilename] = TFile::Open(rootfilename.c_str(),options.c_str());
34 return _rootfiles[rootfilename];
40 rootfiles_t::iterator iFile(
41 find_if(_rootfiles.begin(),_rootfiles.end(),
42 std::tr1::bind<bool>(equal_to<TFile*>(),rootfile,
43 std::tr1::bind<TFile*>(&rootfiles_t::value_type::second,_1))));
44 if (iFile != _rootfiles.end())
static TFile * create(const std::string &rootfilename, const std::string &options="RECREATE")
create and return an instance of the rootfile
std::map< std::string, TFile * > rootfiles_t
easier code
static QMutex _mutex
Singleton Mutex to lock write operations.
contains singleton definition for creating root files
static void close(TFile *rootfile)
close root file
static rootfiles_t _rootfiles
container for all the root files