ATLAS Offline Software
Public Member Functions | Public Attributes | Protected Attributes | Private Member Functions | Private Attributes | List of all members
pool::DstInfo Class Reference

#include <DstInfo.h>

Inheritance diagram for pool::DstInfo:
Collaboration diagram for pool::DstInfo:

Public Member Functions

 DstInfo ()
 Constructors. More...
 
virtual ~DstInfo ()
 
bool evalArgs (std::vector< std::string > &argv)
 Apply the criteria in the QualList to the argv[]. More...
 
std::string connect ()
 
std::pair< std::string, std::string > nameAndType (unsigned int)
 
std::string name (unsigned int)
 
std::string type (unsigned int)
 
unsigned int nDst ()
 
virtual void init ()
 init More...
 
bool hasQual (const std::string &arg) const
 Check if argument was found in the argv[]. More...
 
bool getOpt (const std::string &opt, std::string &optval) const
 check if option was present and return its (first) value in optval(!) More...
 
bool getOpt (const std::string &opt, int &optval) const
 check if option was present and return its (first) numerical value in optval (!) More...
 
bool getOpts (const std::string &opt, std::vector< std::string > &optvalvec) const
 check if option was present and return its values in optvalvec(!) More...
 
virtual bool evalArgsPass2 (std::vector< std::string > &, pool::Args2Container &)
 Second pass options processing. More...
 
bool valid () const
 Returns true if evalArgs has been called with no errors. More...
 
std::string name () const
 identifier More...
 
ArgQualgetArgQual (const std::string &a)
 
QualListgetArgQuals ()
 
std::vector< std::string > & allowedTypes ()
 Hack to bring in allowed types of Collections. More...
 
unsigned int nArgs (std::string)
 Number of arguments for a given qualifer, e.g. nArgs("-src") More...
 
void setArgQuals (QualList &quals)
 set the QualList More...
 
void ignoreMissingArgs (bool ignore)
 set flag to suppress error messages about missing arguments e.g. when -xmlInput is present More...
 

Public Attributes

keys
 STL member. More...
 
elements
 STL member. More...
 

Protected Attributes

bool m_argsfine
 
bool m_ignoreMissingArgs
 
std::vector< std::string > m_argv
 

Private Member Functions

void initTypes ()
 Fill the vector m_allowedTypes. More...
 

Private Attributes

std::string m_connection
 
std::vector< std::string > m_NameVec
 
std::vector< std::string > m_TypeVec
 
QualList m_quals
 
std::string m_id
 
std::vector< std::string > m_allowedTypes
 

Detailed Description

Definition at line 30 of file DstInfo.h.

Constructor & Destructor Documentation

◆ DstInfo()

pool::DstInfo::DstInfo ( )

Constructors.

Definition at line 58 of file DstInfo.h.

62  {
63  markers["-dst"].desc << *at << std::endl;
64  }
65  markers["-dstconnect"].desc << "[Output database connection string] " << std::endl
66  << "The connection string will be looked up in $CORAL_DBLOOKUP_PATH/dblookup.xml" << std::endl
67  << "Database user authentication is done using CORAL_AUTH_PATH/authentication.xml" << std::endl
68  << " or CORAL_AUTH_USER and CORAL_AUTH_PASSWORD variables" << std::endl;
69  this->setArgQuals(markers);
70  m_NameVec.clear();
71  m_TypeVec.clear();
72  }
73 
74  inline bool
75  DstInfo::evalArgs(std::vector<std::string>& argv)
76  {
77  bool retc = true;
78  retc = this->CmdLineArgs2::evalArgs(argv);
79  if (!retc) return retc;

◆ ~DstInfo()

virtual pool::DstInfo::~DstInfo ( )
inlinevirtual

Definition at line 44 of file DstInfo.h.

44 :
45  std::string m_connection;

Member Function Documentation

◆ allowedTypes()

std::vector<std::string>& pool::CmdLineArgs2::allowedTypes ( )
inlineinherited

Hack to bring in allowed types of Collections.

Definition at line 113 of file CmdLineArgs2.h.

◆ connect()

std::string pool::DstInfo::connect ( )
inline

Definition at line 49 of file DstInfo.h.

◆ evalArgs()

bool pool::DstInfo::evalArgs ( std::vector< std::string > &  argv)
inlinevirtual

Apply the criteria in the QualList to the argv[].

Reimplemented from pool::CmdLineArgs2.

Definition at line 82 of file DstInfo.h.

86  {
87  int ifirst = (*this)["-dst"].first;
88  int ilast = (*this)["-dst"].second;
89  std::string dstCollName = "";
90  std::string dstCollType = "";
91  int i = ifirst;
92  while( i < ilast ) {
93  dstCollName = std::string(argv[i]); ++i;
94  dstCollType = std::string(argv[i]);
95  // First check if it is a:
96  // file based or logical type collection
97  // Or is it gibberish, and they need to try again.
98  if ( std::find(this->allowedTypes().begin(),
99  this->allowedTypes().end(),
100  dstCollType) == this->allowedTypes().end() ) {
101  std::cerr << " ERROR Collection type " << dstCollType
102  << " is not presently handled by this program."
103  << std::endl;
104  retc = false;
105  }
106  m_NameVec.push_back( dstCollName );
107  m_TypeVec.push_back( dstCollType );
108  ++i;
109  } // end of m_nameAndTypeVec loop
110  } // end of -dst Qual
111 
112  return retc;
113 
114  }
115 
116  inline std::pair<std::string,std::string>
117  DstInfo::nameAndType(unsigned int ind)
118  {
119  if ( ind < m_TypeVec.size() )
120  return std::pair<std::string,std::string>(m_NameVec[ind],m_TypeVec[ind]);
121  else {

◆ evalArgsPass2()

virtual bool pool::CmdLineArgs2::evalArgsPass2 ( std::vector< std::string > &  ,
pool::Args2Container  
)
inlinevirtualinherited

Second pass options processing.

Reimplemented in pool::QueryInfo.

Definition at line 100 of file CmdLineArgs2.h.

◆ getArgQual()

ArgQual& pool::CmdLineArgs2::getArgQual ( const std::string &  a)
inlineinherited

Definition at line 109 of file CmdLineArgs2.h.

◆ getArgQuals()

QualList& pool::CmdLineArgs2::getArgQuals ( )
inlineinherited

Definition at line 110 of file CmdLineArgs2.h.

◆ getOpt() [1/2]

bool pool::CmdLineArgs2::getOpt ( const std::string &  opt,
int &  optval 
) const
inherited

check if option was present and return its (first) numerical value in optval (!)

◆ getOpt() [2/2]

bool pool::CmdLineArgs2::getOpt ( const std::string &  opt,
std::string &  optval 
) const
inherited

check if option was present and return its (first) value in optval(!)

◆ getOpts()

bool pool::CmdLineArgs2::getOpts ( const std::string &  opt,
std::vector< std::string > &  optvalvec 
) const
inherited

check if option was present and return its values in optvalvec(!)

◆ hasQual()

bool pool::CmdLineArgs2::hasQual ( const std::string &  arg) const
inherited

Check if argument was found in the argv[].

◆ ignoreMissingArgs()

void pool::CmdLineArgs2::ignoreMissingArgs ( bool  ignore)
inlineinherited

set flag to suppress error messages about missing arguments e.g. when -xmlInput is present

Definition at line 122 of file CmdLineArgs2.h.

◆ init()

void pool::CmdLineArgs2::init ( )
inlinevirtualinherited

init

Definition at line 141 of file CmdLineArgs2.h.

◆ initTypes()

void pool::CmdLineArgs2::initTypes ( )
privateinherited

Fill the vector m_allowedTypes.

◆ name() [1/2]

std::string pool::CmdLineArgs2::name ( ) const
inlineinherited

identifier

Definition at line 106 of file CmdLineArgs2.h.

◆ name() [2/2]

std::string pool::DstInfo::name ( unsigned int  ind)
inline

Definition at line 135 of file DstInfo.h.

139  {
140  if ( ind < m_TypeVec.size() ) return m_TypeVec[ind];
141  else {
142  std::cerr << "Out of range request for dst type" << std::endl;

◆ nameAndType()

std::pair< std::string, std::string > pool::DstInfo::nameAndType ( unsigned int  ind)
inline

Definition at line 124 of file DstInfo.h.

129  {
130  if ( ind < m_NameVec.size() ) return m_NameVec[ind];
131  else {
132  std::cerr << "Out of range request for dst name" << std::endl;

◆ nArgs()

unsigned int pool::CmdLineArgs2::nArgs ( std::string  )
inherited

Number of arguments for a given qualifer, e.g. nArgs("-src")

◆ nDst()

unsigned int pool::DstInfo::nDst ( )
inline

Definition at line 155 of file DstInfo.h.

◆ setArgQuals()

void pool::CmdLineArgs2::setArgQuals ( QualList quals)
inlineinherited

set the QualList

Definition at line 119 of file CmdLineArgs2.h.

◆ type()

std::string pool::DstInfo::type ( unsigned int  ind)
inline

Definition at line 145 of file DstInfo.h.

149  {
150  //return this->nArgs("-dst")/this->getArgQuals()["-dst"].argsize;
151  return this->nArgs("-dst");
152  }

◆ valid()

bool pool::CmdLineArgs2::valid ( ) const
inlineinherited

Returns true if evalArgs has been called with no errors.

Definition at line 103 of file CmdLineArgs2.h.

104 :
105 

Member Data Documentation

◆ elements

T std::map< K, T >::elements
inherited

STL member.

◆ keys

K std::map< K, T >::keys
inherited

STL member.

◆ m_allowedTypes

std::vector<std::string> pool::CmdLineArgs2::m_allowedTypes
privateinherited

Definition at line 137 of file CmdLineArgs2.h.

◆ m_argsfine

bool pool::CmdLineArgs2::m_argsfine
protectedinherited

Definition at line 126 of file CmdLineArgs2.h.

◆ m_argv

std::vector<std::string> pool::CmdLineArgs2::m_argv
protectedinherited

Definition at line 128 of file CmdLineArgs2.h.

◆ m_connection

std::string pool::DstInfo::m_connection
private

Definition at line 59 of file DstInfo.h.

◆ m_id

std::string pool::CmdLineArgs2::m_id
privateinherited

Definition at line 136 of file CmdLineArgs2.h.

◆ m_ignoreMissingArgs

bool pool::CmdLineArgs2::m_ignoreMissingArgs
protectedinherited

Definition at line 127 of file CmdLineArgs2.h.

◆ m_NameVec

std::vector<std::string> pool::DstInfo::m_NameVec
private

Definition at line 60 of file DstInfo.h.

◆ m_quals

QualList pool::CmdLineArgs2::m_quals
privateinherited

Definition at line 135 of file CmdLineArgs2.h.

◆ m_TypeVec

std::vector<std::string> pool::DstInfo::m_TypeVec
private

Definition at line 61 of file DstInfo.h.


The documentation for this class was generated from the following file:
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
pool::DstInfo::m_NameVec
std::vector< std::string > m_NameVec
Definition: DstInfo.h:60
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
LArCellConditions.argv
argv
Definition: LArCellConditions.py:112
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
pool::DstInfo::m_connection
std::string m_connection
Definition: DstInfo.h:59
pool::DstInfo::nameAndType
std::pair< std::string, std::string > nameAndType(unsigned int)
Definition: DstInfo.h:124
pool::CmdLineArgs2::setArgQuals
void setArgQuals(QualList &quals)
set the QualList
Definition: CmdLineArgs2.h:119
lumiFormat.i
int i
Definition: lumiFormat.py:92
pool::CmdLineArgs2::evalArgs
virtual bool evalArgs(std::vector< std::string > &argv)
Apply the criteria in the QualList to the argv[].
pool::DstInfo::evalArgs
bool evalArgs(std::vector< std::string > &argv)
Apply the criteria in the QualList to the argv[].
Definition: DstInfo.h:82
CoreClass.markers
list markers
Definition: CoreClass.py:17
pool::DstInfo::m_TypeVec
std::vector< std::string > m_TypeVec
Definition: DstInfo.h:61
pool::CmdLineArgs2::allowedTypes
std::vector< std::string > & allowedTypes()
Hack to bring in allowed types of Collections.
Definition: CmdLineArgs2.h:113
pool::CmdLineArgs2::nArgs
unsigned int nArgs(std::string)
Number of arguments for a given qualifer, e.g. nArgs("-src")
checkFileSG.ind
list ind
Definition: checkFileSG.py:118