ATLAS Offline Software
Loading...
Searching...
No Matches
GeometryDBSvc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef GeometryDBSvc_h
6#define GeometryDBSvc_h
7
9
10#include "GaudiKernel/IInterface.h"
12
13#include <vector>
14#include <string>
15
17class IRDBRecordset;
18
24
25class GeometryDBSvc: public extends<AthService, IGeometryDBSvc>
26{
27public:
28 GeometryDBSvc(const std::string& name, ISvcLocator* sl);
29 virtual ~GeometryDBSvc();
30
31 virtual StatusCode initialize();
32 virtual StatusCode finalize();
33
34 virtual double getDouble(IRDBRecordset_ptr recordSet, const std::string & name, int index=0) const;
35 virtual int getInt(IRDBRecordset_ptr recordSet, const std::string & name, int index=0) const;
36 virtual std::string getString(IRDBRecordset_ptr recordSet, const std::string & name, int index=0) const;
37 virtual bool testField(IRDBRecordset_ptr recordSet, const std::string & name, int index=0) const;
38 virtual bool testFieldTxt(IRDBRecordset_ptr recordSet, const std::string & name, int index=0) const;
39 virtual unsigned int getTableSize(IRDBRecordset_ptr recordSet) const;
40
41 virtual double getDouble(const std::string & recordSetName, const std::string & name, int index=0) const;
42 virtual int getInt(const std::string & recordSetName, const std::string & name, int index=0) const;
43 virtual std::string getString(const std::string & recordSetName, const std::string & name, int index=0) const;
44 virtual bool testField(const std::string & recordSetName, const std::string & name, int index=0) const;
45 virtual unsigned int getTableSize(const std::string & recordSetName) const;
46
48 virtual void printParameters(const std::string & section = "") const;
49
51 virtual void printNotUsed(const std::string & section = "") const;
52
53
54private:
55
56 void setParameterFileName(const std::string & filename);
57 std::string parameterKey(const std::string & recordSetName, const std::string & name, int index) const;
58 bool getValue(const std::string & recordSetName, const std::string & name, int index, std::string & var) const;
59 bool getValue(const std::string & recordSetName, const std::string & name, int index, double & var) const;
60 bool getValue(const std::string & recordSetName, const std::string & name, int index, int & var) const;
61 bool getTableSizeFromTextFile(const std::string & recordSetName, int & var) const;
62
63 // Pointer to text file interface
65
66 // Properties
67 std::string m_textFileName;
70 std::vector<std::string> m_sections;
71
72
73};
74
75#endif
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
void section(const std::string &sec)
virtual ~GeometryDBSvc()
virtual StatusCode initialize()
Service init.
virtual bool testField(IRDBRecordset_ptr recordSet, const std::string &name, int index=0) const
virtual StatusCode finalize()
Service finalize.
GeometryDBSvc(const std::string &name, ISvcLocator *sl)
void setParameterFileName(const std::string &filename)
TextFileDBReader * m_textParameters
virtual void printNotUsed(const std::string &section="") const
Print paramaters from text file which are not used. If section is supplied only consider the paramete...
virtual bool testFieldTxt(IRDBRecordset_ptr recordSet, const std::string &name, int index=0) const
virtual double getDouble(IRDBRecordset_ptr recordSet, const std::string &name, int index=0) const
std::string m_textFileName
bool getTableSizeFromTextFile(const std::string &recordSetName, int &var) const
std::vector< std::string > m_sections
bool getValue(const std::string &recordSetName, const std::string &name, int index, std::string &var) const
virtual int getInt(IRDBRecordset_ptr recordSet, const std::string &name, int index=0) const
virtual std::string getString(IRDBRecordset_ptr recordSet, const std::string &name, int index=0) const
std::string parameterKey(const std::string &recordSetName, const std::string &name, int index) const
virtual unsigned int getTableSize(IRDBRecordset_ptr recordSet) const
virtual void printParameters(const std::string &section="") const
Print paramaters read in from text file. If section is supplied only consider the parameters in that ...
IRDBRecordset is an abstract interface to the RDB Recordsets, which represent a snapshot of HVS-tagge...
Class to read in a text file and allow easy retrieval of parameters.
Definition index.py:1