This class implements.. More...
#include <interface/PixelConfigList.h>
Public Member Functions | |
unsigned int | add (PixelConfig &aConfig) |
unsigned int | clone (unsigned int oldkey, std::string path, unsigned int version) |
unsigned int | numberOfConfigs () |
PixelConfig & | operator[] (unsigned int i) |
void | readfile (std::string filename) |
void | reload (std::string filename) |
unsigned int | size () |
void | writefile () |
Private Attributes | |
std::vector< PixelConfig > | configs |
This class implements..
A longer explanation will be placed here later
Definition at line 15 of file PixelConfigList.h.
unsigned int pos::PixelConfigList::add | ( | PixelConfig & | aConfig | ) | [inline] |
Definition at line 116 of file PixelConfigList.h.
References configs.
Referenced by pos::PixelConfigFile::makeKey().
unsigned int pos::PixelConfigList::clone | ( | unsigned int | oldkey, |
std::string | path, | ||
unsigned int | version | ||
) | [inline] |
Definition at line 98 of file PixelConfigList.h.
References configs, gather_cfg::cout, and pos::PixelConfig::update().
Referenced by pos::PixelAliasList::updateConfigAlias().
unsigned int pos::PixelConfigList::numberOfConfigs | ( | ) | [inline] |
PixelConfig& pos::PixelConfigList::operator[] | ( | unsigned int | i | ) | [inline] |
void pos::PixelConfigList::readfile | ( | std::string | filename | ) | [inline] |
Definition at line 42 of file PixelConfigList.h.
References pos::PixelConfig::add(), configs, gather_cfg::cout, recoMuon::in, GlobalPosition_Frontier_DevDB_cff::tag, tmp, and BeamSplash_cfg::version.
Referenced by pos::PixelConfigFile::getConfig(), and reload().
{ std::ifstream in(filename.c_str()); std::string tag; in >> tag; while(tag.substr(0,1) == "#") { in.ignore(4096, '\n'); //skips to endl; in >> tag; } unsigned int version=0; while(!in.eof()){ if (tag!="key"){ std::cout << "PixelConfigDB: tag="<<tag<<std::endl; assert(0); } unsigned int tmp_version; in >> tmp_version; if (version!=tmp_version){ std::cout << "PixelConfigDB: read version: "<<tmp_version<<" while expected " << version << std::endl; assert(0); } in >> tag; while(tag.substr(0,1) == "#") { in.ignore(4096, '\n'); //skips to endl; in >> tag; } PixelConfig aConfig; while (tag!="key"&&in.good()){ unsigned int tmp; in >>tmp; //std::cout << "adding: "<<tag<<" "<<tmp<<std::endl; aConfig.add(tag,tmp); in >> tag; while(tag.substr(0,1) == "#") { in.ignore(4096, '\n'); //skips to endl; in >> tag; } } configs.push_back(aConfig); version++; }; in.close(); }
void pos::PixelConfigList::reload | ( | std::string | filename | ) | [inline] |
Definition at line 128 of file PixelConfigList.h.
References configs, and readfile().
Referenced by pos::PixelConfigFile::getConfig().
unsigned int pos::PixelConfigList::size | ( | void | ) | [inline] |
void pos::PixelConfigList::writefile | ( | ) | [inline] |
Definition at line 19 of file PixelConfigList.h.
References configs, createBeamHaloJobs::directory, lut2db_cfg::filename, i, and dbtoconf::out.
Referenced by pos::PixelConfigFile::addVersionAlias(), and pos::PixelConfigFile::makeKey().
{ std::string directory=getenv("PIXELCONFIGURATIONBASE"); /* directory+="/PixelConfigDataExamples/"; */ directory+="/"; std::string filename=directory+"/configurations.txt"; std::ofstream out(filename.c_str()); assert(out.good()); for (unsigned int i=0;i<configs.size();i++){ //std::cout << "key "<<i<<std::endl; out << "key "<<i<<std::endl; configs[i].write(out); out <<std::endl; //std::cout <<std::endl; } }
std::vector<PixelConfig> pos::PixelConfigList::configs [private] |
Definition at line 138 of file PixelConfigList.h.
Referenced by add(), clone(), numberOfConfigs(), operator[](), readfile(), reload(), size(), and writefile().