CMS 3D CMS Logo

Public Member Functions | Private Attributes

pos::PixelConfig Class Reference

This class implements.. More...

#include <interface/PixelConfig.h>

List of all members.

Public Member Functions

void add (std::string dir, unsigned int version)
int find (std::string dir, unsigned int &version)
int update (std::string dir, unsigned int &version, unsigned int newversion)
std::vector< std::pair
< std::string, unsigned int > > 
versions ()
void write (std::ofstream &out)

Private Attributes

std::vector< std::pair
< std::string, unsigned int > > 
versions_

Detailed Description

This class implements..

A longer explanation will be placed here later

Definition at line 15 of file PixelConfig.h.


Member Function Documentation

void pos::PixelConfig::add ( std::string  dir,
unsigned int  version 
) [inline]

Definition at line 25 of file PixelConfig.h.

References versions_.

Referenced by pos::PixelConfigFile::makeKey(), and pos::PixelConfigList::readfile().

                                                 {
      std::pair<std::string,unsigned int> aPair(dir,version);
      versions_.push_back(aPair);    
    }
int pos::PixelConfig::find ( std::string  dir,
unsigned int &  version 
) [inline]

Definition at line 30 of file PixelConfig.h.

References first, i, and versions_.

                                                  {
//      std::cout << "[pos::PixelConfig::find()] versions_.size() = " << versions_.size() << std::endl ;
      for(unsigned int i=0;i<versions_.size();i++){
//      std::cout << "Looking :"<<versions_[i].first
//                <<" "<<versions_[i].second<<std::endl;
        if (versions_[i].first==dir) {
          version=versions_[i].second;
          return 0;
        }
      }
      return -1;
    }
int pos::PixelConfig::update ( std::string  dir,
unsigned int &  version,
unsigned int  newversion 
) [inline]

Definition at line 44 of file PixelConfig.h.

References first, i, and versions_.

Referenced by pos::PixelConfigList::clone().

                                                                             {
      for(unsigned int i=0;i<versions_.size();i++){
        //std::cout << "Looking :"<<versions_[i].first
        //            <<" "<<versions_[i].second<<std::endl;
        if (versions_[i].first==dir) {
          version=versions_[i].second;
          versions_[i].second=newversion;
          return 0;
        }
      }
      return -1;
    }
std::vector<std::pair<std::string,unsigned int> > pos::PixelConfig::versions ( ) [inline]

Definition at line 57 of file PixelConfig.h.

References versions_.

Referenced by pos::PixelConfigFile::getVersions().

                                                          {
      return versions_;
    }
void pos::PixelConfig::write ( std::ofstream &  out) [inline]

Definition at line 19 of file PixelConfig.h.

References i, and versions_.

                                {
      for (unsigned int i=0;i<versions_.size();i++){
        out << versions_[i].first<<"   "<<versions_[i].second<<std::endl;
      }
    }

Member Data Documentation

std::vector<std::pair<std::string,unsigned int> > pos::PixelConfig::versions_ [private]

Definition at line 63 of file PixelConfig.h.

Referenced by add(), find(), update(), versions(), and write().