00001
00002
00003 #ifndef MYBLFUNCS_HH
00004 #define MYBLFUNCS_HH
00005
00006 #include <vector>
00007 #include <map>
00008 #include <iostream>
00009 #include <fstream>
00010
00011 #include "myglobals.hh"
00012 #include "G4Types.hh"
00013 #include "G4RotationMatrix.hh"
00014 #include "G4VisAttributes.hh"
00015 #include "G4Material.hh"
00016
00017 typedef std::vector<G4String> MyBLArgumentVector;
00018 typedef std::map<G4String,G4String> MyBLArgumentMap;
00019
00020 class MyBLFuncs {
00021 static std::map<G4String,G4String> *paramMap;
00022
00023 static void init();
00024 public:
00025 MyBLFuncs(){ init();}
00026 int parseArgs(const G4String &line, MyBLArgumentVector &argv,
00027 MyBLArgumentMap &namedArgs);
00028 G4String getString(G4String name);
00029 void setParam(G4String name, G4String value);
00030
00031 void setParam(G4String name, G4double value);
00032
00033 void setParam(G4String name, G4int value);
00034 G4String expand(G4String str);
00035
00036 private:
00037 enum TokenType { NONE, ARGNAME, ARGVALUE };
00038 static G4String nextToken(const G4String& line, G4String::size_type& place,
00039 TokenType& type);
00040 };
00041
00042 extern MyBLFuncs BLFuncs;
00043 #endif // MYBLFUNCS_HH