CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
Args Class Reference

Public Member Functions

 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::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 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)
 
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 printOptionsHelp () const
 
void printOptionsHelp () const
 
void printOptionsHelp () const
 
void printOptionsHelp () const
 
void printOptionsHelp () const
 
 ~Args ()
 
 ~Args ()
 
 ~Args ()
 
 ~Args ()
 
 ~Args ()
 

Private Attributes

std::vector< std::string > mArgs
 
std::map< std::string,
std::string > 
mComments
 
std::vector< std::string > mOptions
 
std::vector< std::string > mParameters
 
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.

73 {};
Args::~Args ( )
inline

Definition at line 74 of file HcalPedestalValidator.cc.

74 {};
Args::Args ( )
inline

Definition at line 48 of file hcalCalibrationsCopy.cc.

48 {};
Args::~Args ( )
inline

Definition at line 49 of file hcalCalibrationsCopy.cc.

49 {};
Args::Args ( )
inline

Definition at line 43 of file hcalDeleteObject.cc.

43 {};
Args::~Args ( )
inline

Definition at line 44 of file hcalDeleteObject.cc.

44 {};
Args::Args ( )
inline

Definition at line 43 of file hcalIovTool.cc.

43 {};
Args::~Args ( )
inline

Definition at line 44 of file hcalIovTool.cc.

44 {};
Args::Args ( )
inline

Definition at line 33 of file hcalPublishConditions.cc.

33 {};
Args::~Args ( )
inline

Definition at line 34 of file hcalPublishConditions.cc.

34 {};

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

Definition at line 262 of file HcalPedestalValidator.cc.

References mArgs.

Referenced by main().

262 {return mArgs;}
std::vector< std::string > 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

Definition at line 257 of file HcalPedestalValidator.cc.

References mProgramName.

Referenced by printHelp().

257  {
258  int ipos = mProgramName.rfind ('/');
259  return std::string (mProgramName, ipos+1);
260 }
std::string mProgramName
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 207 of file HcalPedestalValidator.cc.

References mComments, and mOptions.

Referenced by main().

207  {
208  mOptions.push_back (fOption);
209  mComments [fOption] = fComment;
210 }
std::map< std::string, std::string > mComments
std::vector< std::string > mOptions
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 212 of file HcalPedestalValidator.cc.

References mComments, and mParameters.

Referenced by main().

212  { mParameters.push_back (fParameter);
213  mComments [fParameter] = fComment;
214 }
std::map< std::string, std::string > mComments
std::vector< std::string > mParameters
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 268 of file HcalPedestalValidator.cc.

References mParsed, and optionIsSet().

Referenced by Mixins._Parameterizable::hasParameter(), and main().

268  {
269  if (optionIsSet (fKey)) return mParsed [fKey];
270  return "";
271 }
std::map< std::string, std::string > mParsed
bool 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 264 of file HcalPedestalValidator.cc.

References mParsed.

Referenced by getParameter(), and main().

264  {
265  return mParsed.find (fOption) != mParsed.end ();
266 }
std::map< std::string, std::string > mParsed
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 216 of file HcalPedestalValidator.cc.

References dtNoiseDBValidation_cfg::cerr, spr::find(), mArgs, mOptions, mParameters, mParsed, and mProgramName.

Referenced by main().

216  {
217  if (nArgs <= 0) return;
218  mProgramName = std::string (fArgs [0]);
219  int iarg = 0;
220  while (++iarg < nArgs) {
221  std::string arg (fArgs [iarg]);
222  if (arg [0] != '-') mArgs.push_back (arg);
223  else {
224  if (std::find (mOptions.begin(), mOptions.end (), arg) != mOptions.end ()) {
225  mParsed [arg] = "";
226  }
227  if (std::find (mParameters.begin(), mParameters.end (), arg) != mParameters.end ()) {
228  if (iarg >= nArgs) {
229  std::cerr << "ERROR: Parameter " << arg << " has no value specified. Ignore parameter." << std::endl;
230  }
231  else {
232  mParsed [arg] = std::string (fArgs [++iarg]);
233  }
234  }
235  }
236  }
237 }
std::string mProgramName
std::vector< std::string > mOptions
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
A arg
Definition: Factorize.h:36
std::vector< std::string > mParameters
std::vector< std::string > mArgs
std::map< std::string, std::string > mParsed
void Args::printOptionsHelp ( ) const
void Args::printOptionsHelp ( ) const
void Args::printOptionsHelp ( ) const
void Args::printOptionsHelp ( ) const
void Args::printOptionsHelp ( ) const

Definition at line 239 of file HcalPedestalValidator.cc.

References comment, gather_cfg::cout, i, mComments, mOptions, and mParameters.

Referenced by main(), and printHelp().

239  {
240  char buffer [1024];
241  std::cout << "Parameters:" << std::endl;
242  for (unsigned i = 0; i < mParameters.size (); i++) {
243  std::map<std::string, std::string>::const_iterator it = mComments.find (mParameters [i]);
244  std::string comment = it != mComments.end () ? it->second : "uncommented";
245  sprintf (buffer, " %-8s <value> : %s", (mParameters [i]).c_str(), comment.c_str());
246  std::cout << buffer << std::endl;
247  }
248  std::cout << "Options:" << std::endl;
249  for (unsigned i = 0; i < mOptions.size (); i++) {
250  std::map<std::string, std::string>::const_iterator it = mComments.find (mOptions [i]);
251  std::string comment = it != mComments.end () ? it->second : "uncommented";
252  sprintf (buffer, " %-8s : %s", (mOptions [i]).c_str(), comment.c_str());
253  std::cout << buffer << std::endl;
254  }
255 }
int i
Definition: DBlmapReader.cc:9
std::map< std::string, std::string > mComments
std::vector< std::string > mOptions
std::vector< std::string > mParameters
tuple cout
Definition: gather_cfg.py:121
#define comment(par)
Definition: vmac.h:162

Member Data Documentation

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 89 of file HcalPedestalValidator.cc.

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

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 86 of file HcalPedestalValidator.cc.

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

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().