00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef ThePEG_Repository_H
00010 #define ThePEG_Repository_H
00011
00012
00013 #include "ThePEG/Config/ThePEG.h"
00014 #include "BaseRepository.h"
00015 #include "EventGenerator.h"
00016 #include "ThePEG/PDT/ParticleData.h"
00017 #include "ThePEG/PDT/MatcherBase.h"
00018
00019 namespace ThePEG {
00020
00045 class Repository: public BaseRepository {
00046
00047 public:
00048
00050 typedef map<string,EGPtr> GeneratorMap;
00051
00052 public:
00053
00059 Repository();
00060
00065 ~Repository();
00066
00067 public:
00068
00076 static void Register(IBPtr);
00077
00083 static void Register(IBPtr, string newName);
00085
00094 static void defaultParticle(tPDPtr);
00095
00100 static PDPtr defaultParticle(long id);
00101
00109 static tPDPtr findParticle(string name);
00110
00114 static const ParticleDataSet & allParticles() { return particles(); }
00115
00119 static const MatcherSet & allMatchers() { return matchers(); }
00120
00124 static tPMPtr findMatcher(string name);
00125
00131 static string copyParticle(tPDPtr, string);
00133
00140 static EGPtr makeRun(tEGPtr eg, string name);
00141
00146 static void saveRun(string EGname, string name, string filename);
00148
00155 static void load(string filename);
00156
00160 static void save(string filename);
00161
00165 static void save() { save(currentFileName()); }
00166
00170 static void stats(ostream &);
00172
00178 static void help(string command, ostream & os);
00179
00184 static void remove(tIBPtr);
00185
00192 static string remove(const ObjectSet & rmset);
00193
00202 static void read(istream & is, ostream & os, string prompt = "");
00203
00213 static void read(string filename, ostream & os);
00214
00221 static string exec(string cmd, ostream &);
00223
00224 private:
00225
00229 static void registerParticle(tPDPtr);
00230
00234 static void registerMatcher(tPMPtr);
00235
00239 static void execAndCheckReply(string, ostream &);
00240
00241 protected:
00242
00249 static ParticleMap & defaultParticles();
00250
00254 static ParticleDataSet & particles();
00255
00259 static MatcherSet & matchers();
00260
00264 static GeneratorMap & generators();
00265
00269 static string & currentFileName();
00270
00271 public:
00272
00277 static int & exitOnError();
00278
00285 static void cleanup();
00287
00288 private:
00289
00294 Repository(const Repository &);
00295
00300 Repository & operator=(const Repository &);
00301
00305 static int ninstances;
00306
00307
00308 };
00309
00310 }
00311
00312 #endif