#include <ContentReader.h>
Public Member Functions | |
ContentReader (DQMStore *the_bei) | |
void | give_files (std::string dir, std::list< std::string > &files, bool only_contents) |
MonitorElement * | give_ME (std::string filename) |
void | give_subdirs (std::string dir, std::list< std::string > &subdirs, std::string mode) |
void | give_subdirs_su (std::string dir, std::list< std::string > &subdirs) |
~ContentReader () | |
Private Attributes | |
DQMStore * | bei |
Definition at line 8 of file ContentReader.h.
ContentReader::ContentReader | ( | DQMStore * | the_bei | ) | [inline] |
ContentReader::~ContentReader | ( | ) | [inline] |
Definition at line 21 of file ContentReader.h.
{}
void ContentReader::give_files | ( | std::string | dir, |
std::list< std::string > & | files, | ||
bool | only_contents | ||
) |
Definition at line 36 of file ContentReader.cc.
References fetchall_from_DQM_v2::all_files, bei, lut2db_cfg::filename, DQMStore::get(), DQMStore::getMEs(), i, NULL, DQMStore::pwd(), DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by WebInterface::printContentViewerXML(), and WebInterface::printNavigatorXML().
{ // std::cout << "ContentReader was asked to find the subfiles of : " // << dir << std::endl; // for the interesting directory std::string old = bei->pwd(); bei->setCurrentFolder(dir); // get the monitorable files std::vector<std::string> all_files = bei->getMEs(); if (only_contents) { // and copy those that exist in the files list for (unsigned int i = 0; i < all_files.size(); i++) { std::string filename = bei->pwd() + "/" + all_files[i]; // if it does exist if (bei->get(filename) != NULL) { files.push_back(filename); } } // go back to original folder: bei->setCurrentFolder(old); } else { // and copy those that exist in the files list for (unsigned int i = 0; i < all_files.size(); i++) { std::string filename = bei->pwd() + "/" + all_files[i]; files.push_back(filename); } // go back to original folder: bei->setCurrentFolder(old); } }
MonitorElement * ContentReader::give_ME | ( | std::string | filename | ) |
Definition at line 78 of file ContentReader.cc.
References bei, and DQMStore::get().
Referenced by WebInterface::DrawGif().
{ MonitorElement *requested = bei->get(filename); return requested; }
void ContentReader::give_subdirs | ( | std::string | dir, |
std::list< std::string > & | subdirs, | ||
std::string | mode | ||
) |
Definition at line 5 of file ContentReader.cc.
References bei, DQMStore::containsAnyMonitorable(), DQMStore::getSubdirs(), i, DQMStore::pwd(), DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.
Referenced by WebInterface::printContentViewerXML(), and WebInterface::printNavigatorXML().
{ std::string old = bei->pwd(); bei->setCurrentFolder(dir); std::vector<std::string> all_subdirs = bei->getSubdirs(); // std::cout << "The directory " << bei->pwd() << " contains " << all_subdirs.size() << " subdirectories!" << std::endl; subdirs.push_back(".."); for (unsigned int i = 0; i < all_subdirs.size(); i++) { std::string subdir = dir + all_subdirs[i]; if (mode == "User") { if (bei->containsAnyMonitorable(subdir)) { subdirs.push_back(all_subdirs[i]); } } else if (mode == "SuperUser") { subdirs.push_back(all_subdirs[i]); } } bei->setCurrentFolder(old); }
void ContentReader::give_subdirs_su | ( | std::string | dir, |
std::list< std::string > & | subdirs | ||
) |
DQMStore* ContentReader::bei [private] |
Definition at line 12 of file ContentReader.h.
Referenced by ContentReader(), give_files(), give_ME(), and give_subdirs().