/home/cern/BDSIM_new/src/BDSMySQLTable.cc

00001 /* * BDSIM code.    Version 1.0
00002    * Author: Grahame A. Blair, Royal Holloway, Univ. of London.
00003    * Last modified 24.7.2002
00004    * Copyright (c) 2002 by G.A.Blair.  ALL RIGHTS RESERVED. 
00005 
00006 
00007    Author of this code: John C. Carter, Royal Holloway, Univ. of London.
00008    Last modified 12.10.2005
00009 */
00010 
00011 
00012 #include "BDSGlobalConstants.hh" // must be first in include list
00013 
00014 #include <cstdlib>
00015 #include "BDSMaterials.hh"
00016 #include "BDSMySQLTable.hh"
00017 
00018 using namespace std;
00019 
00020 #include"globals.hh"
00021 #include<string>
00022 #include<vector>
00023 
00024 BDSMySQLTable::BDSMySQLTable (G4String aTableName)
00025 {
00026   itsTableName = aTableName;
00027   itsNVariables = 0;
00028 }
00029 
00030 void BDSMySQLTable::AddVariable(G4String aName, G4String aType)
00031 {
00032   itsVar.push_back(new BDSMySQLVariable(aName,aType));
00033   itsNVariables++;
00034 }
00035 
00036 BDSMySQLVariable* BDSMySQLTable::GetVariable(G4String aVarName)
00037 {
00038   for (G4int i=0; i<(G4int)itsVar.size(); i++)
00039     {
00040       G4String::caseCompare cmpmode = G4String::ignoreCase;
00041       if( (itsVar[i])->GetName().compareTo(aVarName,cmpmode)==0) return itsVar[i];
00042     }
00043   return NULL; //if does not exist return null
00044 }
00045 
00046 BDSMySQLVariable* BDSMySQLTable::GetVariable(G4int aVarN)
00047 {
00048   return itsVar[aVarN];
00049 }
00050 
00051 
00052 
00053 BDSMySQLTable::~BDSMySQLTable()
00054 {
00055 }

Generated on Wed Mar 5 17:25:22 2008 for BDSIM by  doxygen 1.5.3