CMS 3D CMS Logo

Args Class Reference

List of all members.

Public Member Functions

 Args ()
 Args ()
 Args ()
 Args ()
 Args ()
 Args ()
std::vector< std::string > arguments () const
std::vector< std::string > arguments () const
std::vector< std::string > arguments () const
std::vector< std::string > arguments () const
std::vector< std::string > arguments () const
std::vector< std::string > arguments () const
std::string command () const
std::string command () const
std::string command () const
std::string command () const
std::string command () const
std::string command () const
void defineOption (const std::string &fOption, const std::string &fComment="")
void defineOption (const std::string &fOption, const std::string &fComment="")
void defineOption (const std::string &fOption, const std::string &fComment="")
void defineOption (const std::string &fOption, const std::string &fComment="")
void defineOption (const std::string &fOption, const std::string &fComment="")
void defineOption (const std::string &fOption, const std::string &fComment="")
void defineParameter (const std::string &fParameter, const std::string &fComment="")
void defineParameter (const std::string &fParameter, const std::string &fComment="")
void defineParameter (const std::string &fParameter, const std::string &fComment="")
void defineParameter (const std::string &fParameter, const std::string &fComment="")
void defineParameter (const std::string &fParameter, const std::string &fComment="")
void defineParameter (const std::string &fParameter, const std::string &fComment="")
std::string getParameter (const std::string &fKey)
std::string getParameter (const std::string &fKey)
std::string getParameter (const std::string &fKey)
std::string getParameter (const std::string &fKey)
std::string getParameter (const std::string &fKey)
std::string getParameter (const std::string &fKey)
bool optionIsSet (const std::string &fOption) const
bool optionIsSet (const std::string &fOption) const
bool optionIsSet (const std::string &fOption) const
bool optionIsSet (const std::string &fOption) const
bool optionIsSet (const std::string &fOption) const
bool optionIsSet (const std::string &fOption) const
void parse (int nArgs, char *fArgs[])
void parse (int nArgs, char *fArgs[])
void parse (int nArgs, char *fArgs[])
void parse (int nArgs, char *fArgs[])
void parse (int nArgs, char *fArgs[])
void parse (int nArgs, char *fArgs[])
void printOptionsHelp () const
void printOptionsHelp () const
void printOptionsHelp () const
void printOptionsHelp () const
void printOptionsHelp () const
void printOptionsHelp () const
 ~Args ()
 ~Args ()
 ~Args ()
 ~Args ()
 ~Args ()
 ~Args ()

Private Attributes

std::vector< std::string > mArgs
std::vector< std::string > mArgs
std::vector< std::string > mArgs
std::vector< std::string > mArgs
std::vector< std::string > mArgs
std::vector< std::string > mArgs
std::map< std::string,
std::string > 
mComments
std::map< std::string,
std::string > 
mComments
std::map< std::string,
std::string > 
mComments
std::map< std::string,
std::string > 
mComments
std::map< std::string,
std::string > 
mComments
std::map< std::string,
std::string > 
mComments
std::vector< std::string > mOptions
std::vector< std::string > mOptions
std::vector< std::string > mOptions
std::vector< std::string > mOptions
std::vector< std::string > mOptions
std::vector< std::string > mOptions
std::vector< std::string > mParameters
std::vector< std::string > mParameters
std::vector< std::string > mParameters
std::vector< std::string > mParameters
std::vector< std::string > mParameters
std::vector< std::string > mParameters
std::map< std::string,
std::string > 
mParsed
std::map< std::string,
std::string > 
mParsed
std::map< std::string,
std::string > 
mParsed
std::map< std::string,
std::string > 
mParsed
std::map< std::string,
std::string > 
mParsed
std::map< std::string,
std::string > 
mParsed
std::string mProgramName


Detailed Description

Definition at line 71 of file HcalPedestalValidator.cc.


Constructor & Destructor Documentation

Args::Args (  )  [inline]

Definition at line 73 of file HcalPedestalValidator.cc.

00073 {};

Args::~Args (  )  [inline]

Definition at line 74 of file HcalPedestalValidator.cc.

00074 {};

Args::Args (  )  [inline]

Definition at line 48 of file hcalCalibrationsCopy.cc.

00048 {};

Args::~Args (  )  [inline]

Definition at line 49 of file hcalCalibrationsCopy.cc.

00049 {};

Args::Args (  )  [inline]

Definition at line 61 of file hcalCalibrationsDbTool.cc.

00061 {};

Args::~Args (  )  [inline]

Definition at line 62 of file hcalCalibrationsDbTool.cc.

00062 {};

Args::Args (  )  [inline]

Definition at line 43 of file hcalDeleteObject.cc.

00043 {};

Args::~Args (  )  [inline]

Definition at line 44 of file hcalDeleteObject.cc.

00044 {};

Args::Args (  )  [inline]

Definition at line 43 of file hcalIovTool.cc.

00043 {};

Args::~Args (  )  [inline]

Definition at line 44 of file hcalIovTool.cc.

00044 {};

Args::Args (  )  [inline]

Definition at line 33 of file hcalPublishConditions.cc.

00033 {};

Args::~Args (  )  [inline]

Definition at line 34 of file hcalPublishConditions.cc.

00034 {};


Member Function Documentation

std::vector<std::string> Args::arguments (  )  const

std::vector<std::string> Args::arguments (  )  const

std::vector<std::string> Args::arguments (  )  const

std::vector<std::string> Args::arguments (  )  const

std::vector<std::string> Args::arguments (  )  const

std::vector< std::string > Args::arguments (  )  const

Definition at line 260 of file HcalPedestalValidator.cc.

References mArgs.

Referenced by main().

00260 {return mArgs;}

std::string Args::command (  )  const

std::string Args::command (  )  const

std::string Args::command (  )  const

std::string Args::command (  )  const

std::string Args::command (  )  const

std::string Args::command (  )  const

Definition at line 255 of file HcalPedestalValidator.cc.

References mProgramName.

Referenced by printHelp().

00255                                {
00256   int ipos = mProgramName.rfind ('/');
00257   return std::string (mProgramName, ipos+1);
00258 }

void Args::defineOption ( const std::string &  fOption,
const std::string &  fComment = "" 
)

void Args::defineOption ( const std::string &  fOption,
const std::string &  fComment = "" 
)

void Args::defineOption ( const std::string &  fOption,
const std::string &  fComment = "" 
)

void Args::defineOption ( const std::string &  fOption,
const std::string &  fComment = "" 
)

void Args::defineOption ( const std::string &  fOption,
const std::string &  fComment = "" 
)

void Args::defineOption ( const std::string &  fOption,
const std::string &  fComment = "" 
)

Definition at line 205 of file HcalPedestalValidator.cc.

References mComments, and mOptions.

Referenced by main().

00205                                                                             {
00206   mOptions.push_back (fOption);
00207   mComments [fOption] = fComment;
00208 }

void Args::defineParameter ( const std::string &  fParameter,
const std::string &  fComment = "" 
)

void Args::defineParameter ( const std::string &  fParameter,
const std::string &  fComment = "" 
)

void Args::defineParameter ( const std::string &  fParameter,
const std::string &  fComment = "" 
)

void Args::defineParameter ( const std::string &  fParameter,
const std::string &  fComment = "" 
)

void Args::defineParameter ( const std::string &  fParameter,
const std::string &  fComment = "" 
)

void Args::defineParameter ( const std::string &  fParameter,
const std::string &  fComment = "" 
)

Definition at line 210 of file HcalPedestalValidator.cc.

References mComments, and mParameters.

Referenced by main().

00210                                                                                   {   mParameters.push_back (fParameter);
00211   mComments [fParameter] = fComment;
00212 }

std::string Args::getParameter ( const std::string &  fKey  ) 

std::string Args::getParameter ( const std::string &  fKey  ) 

std::string Args::getParameter ( const std::string &  fKey  ) 

std::string Args::getParameter ( const std::string &  fKey  ) 

std::string Args::getParameter ( const std::string &  fKey  ) 

std::string Args::getParameter ( const std::string &  fKey  ) 

Definition at line 266 of file HcalPedestalValidator.cc.

References mParsed, and optionIsSet().

Referenced by main().

00266                                                    {
00267   if (optionIsSet (fKey)) return mParsed [fKey];
00268   return "";
00269 }

bool Args::optionIsSet ( const std::string &  fOption  )  const

bool Args::optionIsSet ( const std::string &  fOption  )  const

bool Args::optionIsSet ( const std::string &  fOption  )  const

bool Args::optionIsSet ( const std::string &  fOption  )  const

bool Args::optionIsSet ( const std::string &  fOption  )  const

bool Args::optionIsSet ( const std::string &  fOption  )  const

Definition at line 262 of file HcalPedestalValidator.cc.

References mParsed.

Referenced by getParameter(), and main().

00262                                                       {
00263   return mParsed.find (fOption) != mParsed.end ();
00264 }

void Args::parse ( int  nArgs,
char *  fArgs[] 
)

void Args::parse ( int  nArgs,
char *  fArgs[] 
)

void Args::parse ( int  nArgs,
char *  fArgs[] 
)

void Args::parse ( int  nArgs,
char *  fArgs[] 
)

void Args::parse ( int  nArgs,
char *  fArgs[] 
)

void Args::parse ( int  nArgs,
char *  fArgs[] 
)

Definition at line 214 of file HcalPedestalValidator.cc.

References arg, TestMuL1L2Filter_cff::cerr, lat::endl(), find(), mArgs, mOptions, mParameters, mParsed, and mProgramName.

Referenced by main().

00214                                            {
00215   if (nArgs <= 0) return;
00216   mProgramName = std::string (fArgs [0]);
00217   int iarg = 0;
00218   while (++iarg < nArgs) {
00219     std::string arg (fArgs [iarg]);
00220     if (arg [0] != '-') mArgs.push_back (arg);
00221     else {
00222       if (std::find (mOptions.begin(), mOptions.end (), arg) !=  mOptions.end ()) {
00223         mParsed [arg] = "";
00224       }
00225       if (std::find (mParameters.begin(), mParameters.end (), arg) !=  mParameters.end ()) {
00226         if (iarg >= nArgs) {
00227           std::cerr << "ERROR: Parameter " << arg << " has no value specified. Ignore parameter." << std::endl;
00228         }
00229         else {
00230           mParsed [arg] = std::string (fArgs [++iarg]);
00231         }
00232       }
00233     }
00234   }
00235 }

void Args::printOptionsHelp (  )  const

void Args::printOptionsHelp (  )  const

void Args::printOptionsHelp (  )  const

void Args::printOptionsHelp (  )  const

void Args::printOptionsHelp (  )  const

void Args::printOptionsHelp (  )  const

Definition at line 237 of file HcalPedestalValidator.cc.

References comment, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), i, it, mComments, mOptions, and mParameters.

Referenced by main(), and printHelp().

00237                                    {
00238   char buffer [1024];
00239   std::cout << "Parameters:" << std::endl;
00240   for (unsigned i = 0; i < mParameters.size (); i++) {
00241     std::map<std::string, std::string>::const_iterator it = mComments.find (mParameters [i]);
00242     std::string comment = it != mComments.end () ? it->second : "uncommented";
00243     sprintf (buffer, "  %-8s <value> : %s", (mParameters [i]).c_str(),  comment.c_str());
00244     std::cout << buffer << std::endl;
00245   }
00246   std::cout << "Options:" << std::endl;
00247   for (unsigned i = 0; i < mOptions.size (); i++) {
00248     std::map<std::string, std::string>::const_iterator it = mComments.find (mOptions [i]);
00249     std::string comment = it != mComments.end () ? it->second : "uncommented";
00250     sprintf (buffer, "  %-8s  : %s", (mOptions [i]).c_str(),  comment.c_str());
00251     std::cout << buffer << std::endl;
00252   }
00253 }


Member Data Documentation

std::vector<std::string> Args::mArgs [private]

Definition at line 47 of file hcalPublishConditions.cc.

std::vector<std::string> Args::mArgs [private]

Definition at line 57 of file hcalIovTool.cc.

std::vector<std::string> Args::mArgs [private]

Definition at line 57 of file hcalDeleteObject.cc.

std::vector<std::string> Args::mArgs [private]

Definition at line 75 of file hcalCalibrationsDbTool.cc.

std::vector<std::string> Args::mArgs [private]

Definition at line 62 of file hcalCalibrationsCopy.cc.

std::vector<std::string> Args::mArgs [private]

Definition at line 87 of file HcalPedestalValidator.cc.

Referenced by arguments(), and parse().

std::map<std::string, std::string> Args::mComments [private]

Definition at line 49 of file hcalPublishConditions.cc.

std::map<std::string, std::string> Args::mComments [private]

Definition at line 59 of file hcalIovTool.cc.

std::map<std::string, std::string> Args::mComments [private]

Definition at line 59 of file hcalDeleteObject.cc.

std::map<std::string, std::string> Args::mComments [private]

Definition at line 77 of file hcalCalibrationsDbTool.cc.

std::map<std::string, std::string> Args::mComments [private]

Definition at line 64 of file hcalCalibrationsCopy.cc.

std::map<std::string, std::string> Args::mComments [private]

Definition at line 89 of file HcalPedestalValidator.cc.

Referenced by defineOption(), defineParameter(), and printOptionsHelp().

std::vector<std::string> Args::mOptions [private]

Definition at line 45 of file hcalPublishConditions.cc.

std::vector<std::string> Args::mOptions [private]

Definition at line 55 of file hcalIovTool.cc.

std::vector<std::string> Args::mOptions [private]

Definition at line 55 of file hcalDeleteObject.cc.

std::vector<std::string> Args::mOptions [private]

Definition at line 73 of file hcalCalibrationsDbTool.cc.

std::vector<std::string> Args::mOptions [private]

Definition at line 60 of file hcalCalibrationsCopy.cc.

std::vector<std::string> Args::mOptions [private]

Definition at line 85 of file HcalPedestalValidator.cc.

Referenced by defineOption(), parse(), and printOptionsHelp().

std::vector<std::string> Args::mParameters [private]

Definition at line 46 of file hcalPublishConditions.cc.

std::vector<std::string> Args::mParameters [private]

Definition at line 56 of file hcalIovTool.cc.

std::vector<std::string> Args::mParameters [private]

Definition at line 56 of file hcalDeleteObject.cc.

std::vector<std::string> Args::mParameters [private]

Definition at line 74 of file hcalCalibrationsDbTool.cc.

std::vector<std::string> Args::mParameters [private]

Definition at line 61 of file hcalCalibrationsCopy.cc.

std::vector<std::string> Args::mParameters [private]

Definition at line 86 of file HcalPedestalValidator.cc.

Referenced by defineParameter(), parse(), and printOptionsHelp().

std::map<std::string, std::string> Args::mParsed [private]

Definition at line 48 of file hcalPublishConditions.cc.

std::map<std::string, std::string> Args::mParsed [private]

Definition at line 58 of file hcalIovTool.cc.

std::map<std::string, std::string> Args::mParsed [private]

Definition at line 58 of file hcalDeleteObject.cc.

std::map<std::string, std::string> Args::mParsed [private]

Definition at line 76 of file hcalCalibrationsDbTool.cc.

std::map<std::string, std::string> Args::mParsed [private]

Definition at line 63 of file hcalCalibrationsCopy.cc.

std::map<std::string, std::string> Args::mParsed [private]

Definition at line 88 of file HcalPedestalValidator.cc.

Referenced by getParameter(), optionIsSet(), and parse().

std::string Args::mProgramName [private]

Definition at line 84 of file HcalPedestalValidator.cc.

Referenced by command(), and parse().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:14:49 2009 for CMSSW by  doxygen 1.5.4