Page MenuHomeHEPForge

No OneTemporary

This file is larger than 256 KB, so syntax highlighting was skipped.
This document is not UTF8. It was detected as ISO-8859-1 (Latin 1) and converted to UTF8 for display.
Index: tags/agile-1.2.0/include/AGILe/AGILe.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/AGILe.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/AGILe.hh (revision 755)
@@ -0,0 +1,27 @@
+#ifndef AGILE_AGILe_HH
+#define AGILE_AGILe_HH
+
+// Macro to help with overzealous compiler warnings
+#ifdef UNUSED
+#elif defined(__GNUC__)
+# define UNUSED(x) UNUSED_ ## x __attribute__((unused))
+#elif defined(__LCLINT__)
+# define UNUSED(x) /*@unused@*/ x
+#else
+# define UNUSED(x) x
+#endif
+
+#ifdef LIB_SUFFIX
+#define SYSDSO string(LIB_SUFFIX)
+#else
+#define SYSDSO string(".so")
+#endif
+
+// Bring selected STL/Boost classes into the AGILe namespace
+#include "AGILe/AGILeSTL.hh"
+#include "AGILe/AGILeBoost.hh"
+
+#include "AGILe/Tools/AGILePaths.hh"
+#include "AGILe/Tools/Logging.hh"
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/Cascade/Cascade.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/Cascade/Cascade.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/Cascade/Cascade.hh (revision 755)
@@ -0,0 +1,82 @@
+#ifndef AGILE_CASCADE_HH
+#define AGILE_CASCADE_HH
+
+#include "AGILe/Generator.hh"
+#include "HepMC/IO_HEPEVT.h"
+
+namespace AGILe {
+
+
+ /// Abstract base class for Cascade interface
+ /// @author Andy Buckley
+ /// @author Holger Schulz
+ class Cascade : public Generator {
+ public:
+ /// Standard constructor
+ Cascade();
+
+ /// Destructor
+ virtual ~Cascade() { }
+
+ /// Set up initial state from supplied params
+ void setGenSpecificInitialState(PdgCode p1 = PROTON, double e1 = 6000.0,
+ PdgCode p2 = PROTON, double e2 = 7000.0);
+
+ /// Make sure that generic setParam is visible.
+ using Generator::setParam;
+
+ ///// Make sure that FPythia setParam is visible.
+ //using FPythia::setParam;
+
+ /// Pass an string parameter to the generator.
+ virtual bool setParam(const string& name, const string& value);
+
+ /// Generator name
+ virtual const string getName() const{
+ return "Cascade";
+ }
+
+ /// Run the generator for one event
+ void makeEvent(HepMC::GenEvent& evt);
+
+
+ /// Set the random number generator seed.
+ //virtual void setSeed(const int value) {
+ //setParam("ISEED", value);
+ //}
+
+
+ //string getPDFSet(PdgCode pid);
+ //int getPDFMember(PdgCode pid);
+ //string getPDFScheme(PdgCode pid)const;
+
+ /// Return the generated cross section in pb.
+ virtual const double getCrossSection();
+
+ //virtual const string getVersion();
+
+ /// Tidy up after ourselves
+ void finalize();
+
+ protected:
+ /// Set up default params etc.
+ void initialize();
+
+ /// Fill a HepMC event
+ void fillEvent(HepMC::GenEvent& evt);
+
+ /// Internal storage of initial state params
+ string _particleName1, _particleName2;
+ double _e1, _e2;
+
+ /// Event counter
+ int _nevt;
+
+ /// HEPEVT->HepMC converter
+ HepMC::IO_HEPEVT _hepevt;
+ };
+
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/Cascade/CascadeWrapper.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/Cascade/CascadeWrapper.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/Cascade/CascadeWrapper.hh (revision 755)
@@ -0,0 +1,66 @@
+#ifndef AGILE_CASCADE_WRAPPER_HH
+#define AGILE_CASCADE_WRAPPER_HH
+
+#include <ctype.h>
+#include "AGILe/FortranWrappers.hh"
+
+
+
+extern "C" {
+ #define FC_CASINI FC_FUNC(casini, CASINI)
+ void FC_CASINI();
+ #define FC_Steer FC_FUNC(steer, Steer)
+ void FC_Steer();
+ #define FC_CASCADE FC_FUNC(cascade, CASCADE)
+ void FC_CASCADE();
+ #define FC_CASCHA FC_FUNC(cascha, CASCHA)
+ void FC_CASCHA();
+ #define FC_PYTCHA FC_FUNC(pytcha, PYTCHA)
+ void FC_PYTCHA();
+ #define FC_ARICHA FC_FUNC(aricha, ARICHA)
+ void FC_ARICHA();
+ #define FC_ARINIT FC_FUNC(arinit, ARINIT)
+ void FC_ARINIT(const char *);
+ #define FC_CAEND FC_FUNC(caend, CAEND)
+ void FC_CAEND(int *);
+ #define FC_EVENT FC_FUNC(event, EVENT)
+ void FC_EVENT();
+ #define FC_CAUPEVNT FC_FUNC(caupevnt, CAUPEVNT)
+ void FC_CAUPEVNT();
+ #define FC_PTIME FC_FUNC(ptime, PTIME)
+ void FC_PTIME(const char *, int* , int* );
+ // Pythia routines
+ #define FC_PYHEPC FC_FUNC(pyhepc, PYHEPC)
+ void FC_PYHEPC(int*);
+ //#define FC_RM48IN FC_FUNC(rm48in, RM48IN)
+ //void FC_RM48IN(int ISEED, int N1, int N2);
+
+ #define FC_PYINIT FC_FUNC(pyinit, PYINIT)
+ void FC_PYINIT(const char*,const char*,const char*,double*,int,int,int);
+ #define FC_PYGIVE FC_FUNC(pygive, PYGIVE)
+ void FC_PYGIVE(const char*,int);
+ #define FC_INITPYDATA FC_FUNC(initpydata, INITPYDATA)
+ void FC_INITPYDATA();
+
+}
+void call_pyinit(const char* frame, const char* beam, const char* target, double win);
+void call_pygive(const char* frame );
+
+void call_ptime(const char * name, int j, int k);
+void call_steer();
+void call_casini();
+void call_cascade();
+void call_cascha();
+void call_pytcha();
+void call_aricha();
+void call_arinit(const char * name);
+
+// A pythia routine
+void call_pyhepc(int mode);
+
+void call_caend(int i);
+void call_event();
+void call_caupevnt();
+// This is for setting the random seed
+//void call_rm48in(int ISEED, int N1, int N2);
+#endif
Index: tags/agile-1.2.0/include/AGILe/Cascade/CascadeWrapper2.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/Cascade/CascadeWrapper2.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/Cascade/CascadeWrapper2.hh (revision 755)
@@ -0,0 +1,228 @@
+#ifndef AGILE_CASCADE_WRAPPER2_HH
+#define AGILE_CASCADE_WRAPPER2_HH
+
+//////////////////////////////////////////////////////////////////////////
+// Cascade common block declarations
+// hschulz@physik.hu-berlin.de, February 2010
+// Version 2.01 December 2007
+// Wrapper for FORTRAN version of Cascade
+//////////////////////////////////////////////////////////////////////////
+
+#include <ctype.h>
+#include <cstring>
+#include "AGILe/Cascade/CascadeWrapper.hh"
+
+
+extern "C" {
+ /// Cascade common block declarations.
+ //Beams (to access info)
+ #define FC_CABEAM FC_FUNC(cabeam, CABEAM)
+ extern struct {
+ double PBEAM[2];
+ double KBEAM[2];
+ double PBE1,PBE2;
+ } FC_CABEAM;
+
+ // Parameters for process steering
+ #define FC_CAINPU FC_FUNC(cainpu, CAINPU)
+ extern struct {
+ // int NFRAG,ILEPTO,IHF, ?
+ // not used: ISEMIH
+ double PLEPIN,PPIN; //momenta of incoming lepton, proton
+ //int LEPI,HADI; // PDGids of incoming particles
+ int IFPS,INTER,ILHA; // parton shower, inclusion of priordial kt for diff processes, interaction type switch
+ } FC_CAINPU;
+
+ // ???
+ #define FC_CAHERUP FC_FUNC(caherup, CAHERUP)
+ extern struct {
+ int Ilha; // Ilha sets treatment of remnants
+ } FC_CAHERUP;
+
+
+ // Parameters for nuber of generation tries...
+ #define FC_CAEFFIC FC_FUNC(caeffic, CAEFFIC)
+ extern struct {
+ double AVGI,SD;
+ int NIN,NOUT;
+ } FC_CAEFFIC;
+
+ // Buchmueller ???
+ #define FC_BUCHMUE FC_FUNC(buchmue, BUCHMUE)
+ extern struct {
+ double C1,Cg;
+ } FC_BUCHMUE;
+
+ // My first attempt, resolved photons, see manual section 4.7
+ #define FC_COLCON FC_FUNC(colcon, COLCON)
+ extern struct {
+ int ICOLORA,IRESPRO,IRPA,IRPB,IRPC,IRPD,IRPE,IRPF,IRPG;
+ } FC_COLCON;
+
+ // Parameters for diffraction
+ #define FC_DIFFR FC_FUNC(diffr, DIFFR)
+ extern struct {
+ double T2MAX,XF,ALPHP,RN2,EPSP,QMI,YMI,QMA,YMA;
+ int NG,NPOM;
+ } FC_DIFFR;
+
+ // Parameters for hard subprocess selection (DIS)
+ #define FC_DISDIF FC_FUNC(disdif, DISDIF)
+ extern struct {
+ int IDIR,IDISIDF;
+ } FC_DISDIF;
+
+ // Parameters for min/max electron scattering angle (degree)
+ #define FC_ELECT FC_FUNC(elect, ELECT)
+ extern struct {
+ double THEMA,THEMI;
+ } FC_ELECT;
+
+ // Parameters for electroweak stuff: sin2thetaWeinberg, M_W^2
+ #define FC_EWEAK FC_FUNC(eweak, EWEAK)
+ extern struct {
+ double SIN2W,MW2;
+ } FC_EWEAK;
+
+ // Parameters for structure function F2 ???
+ #define FC_F2INT FC_FUNC(f2int, F2INT)
+ extern struct {
+ // double ? F2DIS,F2DIS,F2PI;
+ } FC_F2INT;
+
+ // Parameters for bookkeeping inside event record format???
+ #define FC_HARD FC_FUNC(hard, HARD)
+ extern struct {
+ int NFT; // total number of final particles in 2to2 processes
+ int NIA1,NIR1,NIA2,NIR2,NF1,NF2;
+ } FC_HARD;
+
+
+ // Parameters for exponential low Q2 suppression (possible tuning parameter)
+ #define FC_LOWQ2 FC_FUNC(lowq2, LOWQ2)
+ extern struct {
+ double Q2SUPP;
+ } FC_LOWQ2;
+
+ // Parameters for accessing information of ???
+ #define FC_MEINFO FC_FUNC(meinfo, MEINFO)
+ extern struct {
+ double ZQGKI,XPGKI,PHIGKI;
+ } FC_MEINFO;
+
+ // Parameters for
+ #define FC_OALPINI FC_FUNC(oalpini, OALPINI)
+ extern struct {
+ int IFULL,IQCDGRID; // Switches for lowest order or quark parton model process, O(a_S) generation on a grid
+ } FC_OALPINI;
+
+ // Parameters for
+ #define FC_PARAE FC_FUNC(parae, PARAE)
+ extern struct {
+ double Q2; // actual Q2 of gammas in lepto-production
+ double Q2Q; // Scale mu^2 of hard scattering in a_S and structure functions
+ // PCM???
+ } FC_PARAE;
+
+ // Parameters for
+ #define FC_PARAM FC_FUNC(param, PARAM)
+ extern struct {
+ double ALPHS,ALPH; // actual a_S, a_em
+ double PI; // well ... pi!
+ //double ? IWEI
+ } FC_PARAM;
+
+ // Parameters for
+ #define FC_PARAT FC_FUNC(parat, PARAT)
+ extern struct {
+ double AM[18]; // vector of final state particle masse
+ double SHAT; // s^hat in hard sub processes
+ double YMAX,YMIN; // upper and lower boundaries for y
+ double QMAX,QMIN; // upper and lower boundaries for Q2 of photons
+ double XMAX,XMIN; // upper and lower boundaries for x
+ } FC_PARAT;
+
+ // Parameters for random seed
+ #define FC_ISEED FC_FUNC(iseed, ISEED)
+ extern struct {
+ int ISEED;
+ } FC_ISEED;
+
+ // Parameters for PTCUT
+ #define FC_PTCUT FC_FUNC(ptcut, PTCUT)
+ extern struct {
+ double PT2CUT[100];
+ } FC_PTCUT;
+
+ // Parameters for run setup
+ #define FC_RAPA FC_FUNC(rapa, RAPA)
+ extern struct {
+ int IPRO;
+ } FC_RAPA;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+
+
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/Generator.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/Generator.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/Generator.hh (revision 755)
@@ -0,0 +1,315 @@
+// -*- C++ -*-
+#ifndef AGILE_GENERATOR_HH
+#define AGILE_GENERATOR_HH
+
+#include "AGILe/AGILe.hh"
+#include "AGILe/Utils.hh"
+#include "AGILe/Particle.hh"
+#include "AGILe/GeneratorState.hh"
+#include "HepMC/GenEvent.h"
+
+namespace AGILe {
+
+
+ /// @author Andy Buckley
+ class Generator {
+ public:
+
+ /// Really just syntactic sugar for bool returns from setParam
+ enum Result { SUCCESS=1, FAILURE=0 };
+
+
+ /// Standard constructor.
+ Generator() :
+ _initialstateset(false),
+ _initialized(false),
+ _versionSet(false)
+ { }
+
+
+ /// Destructor.
+ virtual ~Generator() { }
+
+
+ /// Define initial state.
+ void setInitialState(int p1 = PROTON, double e1 = 7000.0,
+ int p2 = PROTON, double e2 = 7000.0)
+ {
+ setGenSpecificInitialState(p1, e1, p2, e2);
+ /// @todo Make sure it was successful - exception handling
+ _initialstateset = true;
+ Beam beam1, beam2;
+ beam1.name = p1;
+ beam2.name = p2;
+ beam1.energy = e1;
+ beam2.energy = e2;
+ beam1.position = 1;
+ beam2.position = 2;
+ _myState.setBeams(beam1, beam2);
+ }
+
+
+ virtual const GeneratorState& getState() {
+ string myName = getName();
+ _myState.setName(myName);
+ _myState.setVersion(getVersion());
+ _myState.setCrossSection(getCrossSection());
+ PDF pdf;
+ foreach (Beam b, _myState.getBeams()) {
+ pdf.particleId = b.name;
+ pdf.set = getPDFSet(b.name);
+ pdf.member = getPDFMember(b.name);
+ pdf.scheme = getPDFScheme(b.name);
+ _myState.addPDF(pdf);
+ }
+ return _myState;
+ }
+
+
+ virtual void setState(const GeneratorState& state) {
+ throw runtime_error("This ain't ready yet, it's just here as an interface placeholder. Sorry.");
+ }
+
+
+ /// Get generator name.
+ virtual const std::string getName() const {
+ /// @todo This doesn't get used polymophically if the calling function is the base class
+ /// @todo Move to a member variable cf. Rivet Projs/Analyses
+ return "Generator";
+ }
+
+
+ virtual void setVersion(const std::string& version) {
+ _myVersion = version;
+ _versionSet = true;
+ }
+
+
+ /// Used as a last resort to determine the generator version.
+ /// Ideally a specific generator will know its own version and overwrite
+ /// this. Some generators (e.g. FHerwig) don't know this.
+ virtual const std::string getVersion() {
+ if (!_versionSet) {
+ /// @todo This getName() doesn't get used polymophically
+ getLog() << Log::ERROR
+ << "You asked the generator " << getName()
+ << " what version it is, but it doesn't know!\n"
+ << "You should set the version with a call to setVersion(string)" << endl;
+ throw runtime_error("Version unknown for generator");
+ }
+ return _myVersion;
+ }
+
+
+ /// Get the PDF set used by the generator, e.g. HWLHAPDF (for herwig)
+ /// or one of the default sets.
+ virtual std::string getPDFSet(PdgCode pid) {
+ throw runtime_error("Have not implemented getPDFSet in " + getName());
+ }
+
+
+ /// Get the PDF id number for a given particle
+ virtual int getPDFMember(PdgCode pid) {
+ throw runtime_error("Have not implemented getPDFMember in " + getName());
+ }
+
+
+ /// Get the PDF scheme used by the generator (LHAPDF or other)
+ virtual std::string getPDFScheme(PdgCode pid) const {
+ throw runtime_error("Have not implemented getPDFScheme in " + getName());
+ }
+
+
+ /// Set the random number generator seed.
+ virtual void setSeed(const int value) {
+ if (_initialized) {
+ getLog() << Log::ERROR
+ << "Can't set seed: generator has already been initialized" << endl;
+ throw (runtime_error("Tried to set RNG seed after generator initialization"));
+ }
+ _myState.addSeed(value);
+ }
+
+
+ /// Pass an int-valued parameter to the generator.
+ virtual bool setParam(const std::string& name, const int& value) {
+ if (_initialized) {
+ getLog() << Log::ERROR
+ << "Can't set parameter " << name
+ << ": generator has already been initialized" << endl;
+ throw runtime_error("Tried to set param after generator initialization");
+ }
+ return setParam(name, toString(value));
+ }
+
+
+ /// Pass an int-valued parameter to the generator.
+ virtual bool setParam(const std::string& name, const unsigned int& value) {
+ if (_initialized) {
+ getLog() << Log::ERROR
+ << "Can't set parameter " << name
+ << ": generator has already been initialized" << endl;
+ throw runtime_error("Tried to set param after generator initialization");
+ }
+ return setParam(name, toString(value));
+ }
+
+
+ /// Pass an int-valued parameter to the generator.
+ virtual bool setParam(const std::string& name, const long& value) {
+ if (_initialized) {
+ getLog() << Log::ERROR
+ << "Can't set parameter " << name
+ << ": generator has already been initialized" << endl;
+ throw runtime_error("Tried to set param after generator initialization");
+ }
+ return setParam(name, toString(value));
+ }
+
+
+ /// Pass an int-valued parameter to the generator.
+ virtual bool setParam(const std::string& name, const unsigned long& value) {
+ if (_initialized) {
+ getLog() << Log::ERROR
+ << "Can't set parameter " << name
+ << ": generator has already been initialized" << endl;
+ throw runtime_error("Tried to set param after generator initialization");
+ }
+ return setParam(name, toString(value));
+ }
+
+
+ /// Pass a double/float-valued parameter to the generator.
+ virtual bool setParam(const std::string& name, const double& value) {
+ if (_initialized) {
+ getLog() << Log::ERROR
+ << "Can't set parameter " << name
+ << ": generator has already been initialized" << endl;
+ throw runtime_error("Tried to set param after generator initialization.");
+ }
+ return setParam(name, toString(value));
+ }
+
+
+ /// Pass a double/float-valued parameter to the generator.
+ virtual bool setParam(const std::string& name, const float& value) {
+ if (_initialized) {
+ getLog() << Log::ERROR
+ << "Can't set parameter " << name
+ << ": generator has already been initialized" << endl;
+ throw runtime_error("Tried to set param after generator initialization");
+ }
+ return setParam(name, toString(value));
+ }
+
+
+ /// Pass a bool-valued parameter to the generator.
+ virtual bool setParam(const std::string& name, const bool& value) {
+ if (_initialized) {
+ getLog() << Log::ERROR
+ << "Can't set parameter " << name
+ << ": generator has already been initialized" << endl;
+ throw runtime_error("Tried to set param after generator initialization");
+ }
+ return setParam(name, toString(value));
+ }
+
+
+ /// Pass a string-valued parameter to the generator.
+ virtual bool setParam(const std::string& name, const std::string& value) {
+ if (_initialized) {
+ getLog() << Log::ERROR
+ << "Can't set parameter " << name
+ << ": generator has already been initialized" << endl;
+ throw runtime_error("Tried to set param after generator initialization");
+ }
+ _myState.setParam(name, value);
+ return true;
+ }
+
+
+ /// Run one event.
+ virtual void makeEvent(HepMC::GenEvent& evt) {
+ if (!_initialized) initialize();
+ clearEvent(evt);
+ _myState.addEvent();
+ }
+
+
+ /// Return the generated cross section in pb.
+ virtual const double getCrossSection() {
+ getLog() << Log::ERROR
+ << " Have not implemented getCrossSection in generator "
+ << getName() << endl;
+ throw runtime_error("Tried to access cross-section in Generator base class");
+ return _crossSection;
+ }
+
+
+ /// Finalise.
+ virtual void finalize() = 0;
+
+
+ protected:
+
+ /// Get named logger
+ Log& getLog() const {
+ return Log::getLog("AGILe." + getName());
+ }
+
+
+ /// Set initial state implementation details
+ virtual void
+ setGenSpecificInitialState(int p1 = PROTON, double e1 = 7000.0,
+ int p2 = PROTON, double e2 = 7000.0) = 0;
+
+
+ /// Initialise.
+ virtual void initialize() {
+ if (!_initialstateset) setInitialState();
+ }
+
+
+ /// Clear the supplied event.
+ virtual void clearEvent(HepMC::GenEvent& evt) {
+ evt.clear();
+ }
+
+
+ protected:
+
+ double _crossSection;
+
+ /// Flag for detecting whether the setInitialState method has run.
+ bool _initialstateset;
+
+ /// Flag for detecting whether the initialization method has run.
+ bool _initialized;
+
+ /// Collection of translated names for particles
+ map<PdgCode, std::string> _particleNames;
+
+
+ private:
+
+ GeneratorState _myState;
+
+ bool _versionSet;
+
+ string _myVersion;
+ };
+
+
+ ////////////////////////////////////////////////
+
+
+ /// Class factory for dynamic generator loading.
+ typedef Generator* (*Creator)();
+
+
+ /// Class destroyer for dynamic generator loading.
+ typedef void Destroyer(Generator*);
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/GeneratorState.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/GeneratorState.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/GeneratorState.hh (revision 755)
@@ -0,0 +1,153 @@
+// -*- C++ -*-
+#ifndef AGILE_GENERATOR_STATE_HH
+#define AGILE_GENERATOR_STATE_HH
+
+#include "AGILe/AGILe.hh"
+#include "AGILe/Particle.hh"
+
+namespace AGILe {
+
+ struct Beam{
+ PdgCode name;
+ double energy;
+ int position;
+ };
+
+
+ struct PDF{
+ PdgCode particleId;
+ string set;
+ int member;
+ string scheme;
+ };
+
+
+ class GeneratorState {
+ public:
+
+ GeneratorState() {
+ _nEvents = 0;
+ _crossSection = 0.0;
+ }
+
+
+ template <typename T>
+ const GeneratorState& setParam(const string &name, const T &value) {
+ stringstream s;
+ s << value;
+ return setParam(name, s.str());
+ }
+
+
+ const GeneratorState& setParam(const string & name, const string &value) {
+ _stringParams[name] = value;
+ return *this;
+ }
+
+
+ const GeneratorState& addSeed(const int &seed) {
+ _seeds.push_back(seed);
+ return *this;
+ }
+
+
+ const vector<int>& getSeeds() const {
+ return _seeds;
+ }
+
+
+ /// @todo Why not return self?
+ const bool setCrossSection(const double xs) {
+ _crossSection = xs;
+ return true;
+ }
+
+
+ const double getCrossSection() const {
+ return _crossSection;
+ }
+
+
+ const int getNEvents()const {
+ return _nEvents;
+ }
+
+
+ const GeneratorState& addEvent() {
+ ++_nEvents;
+ return *this;
+ }
+
+
+ const GeneratorState& setBeams(const Beam beam1,
+ const Beam beam2) {
+ _beams.clear();
+ _beams.push_back(beam1);
+ _beams.push_back(beam2);
+ return *this;
+ }
+
+
+ const void addPDF(PDF pdf) {
+ _pDFs[pdf.particleId] = pdf;
+ }
+
+
+ const GeneratorState& setName(const string& name) {
+ _genName = name;
+ return *this;
+ }
+
+
+ const void setVersion(const string& ver) {
+ _genVersion = ver;
+ }
+
+
+ const string version() const {
+ return _genVersion;
+ }
+
+
+ const string& name() const {
+ return _genName;
+ }
+
+
+ const vector<Beam>& getBeams() const {
+ return _beams;
+ }
+
+
+ const PDF& getPDF(PdgCode pid) const {
+ map<PdgCode, PDF>::const_iterator pdfIt = _pDFs.find(pid);
+ if (pdfIt!=_pDFs.end()) {
+ return pdfIt->second;
+ }
+ throw runtime_error("PDF unknown for PDG code "+ pid);
+ }
+
+
+ private:
+
+ vector<Beam> _beams;
+
+ int _nEvents;
+ double _luminosity;
+ double _crossSection;
+
+ string _genName;
+ string _genVersion;
+
+ map<PdgCode, PDF> _pDFs;
+
+ vector<int> _seeds;
+ map<string, string> _stringParams;
+
+ };
+
+
+ ostream &operator<<(ostream& os, const GeneratorState& state);
+
+}
+#endif
Index: tags/agile-1.2.0/include/AGILe/AGILeBoost.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/AGILeBoost.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/AGILeBoost.hh (revision 755)
@@ -0,0 +1,19 @@
+#ifndef AGILE_AGILEBOOST_HH
+#define AGILE_AGILEBOOST_HH
+
+#include "boost/smart_ptr.hpp"
+#include "boost/lexical_cast.hpp"
+#include "boost/assign.hpp"
+
+#include <boost/algorithm/string.hpp>
+
+#include "boost/foreach.hpp"
+#define foreach BOOST_FOREACH
+
+namespace AGILe {
+ using boost::shared_ptr;
+ using boost::lexical_cast;
+ using namespace boost::assign;
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/FHerwig/FHerwig.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/FHerwig/FHerwig.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/FHerwig/FHerwig.hh (revision 755)
@@ -0,0 +1,80 @@
+// -*- C++ -*-
+#ifndef AGILE_FHERWIG_HH
+#define AGILE_FHERWIG_HH
+
+#include "AGILe/Generator.hh"
+
+namespace AGILe {
+
+ /// Abstract base class for the Fortran-based Herwig generator series
+ /// @author Andy Buckley
+ /// @date 2006-06-12
+ class FHerwig : public Generator {
+ public:
+ /// Standard constructor
+ FHerwig();
+
+ /// @todo Can we avoid the virtual function overhead? Is it really
+ /// significant, considering it's added to all the underlying generator
+ /// computation and complexity? Design considerations, polymorphism: should
+ /// *all* generators make all methods virtual "just in case" they're
+ /// eventually subclassed? (Ans: probably not, better to make them virtual
+ /// "on demand" when a situation like the Jimmy subclassing happens.)
+
+ /// Destructor
+ virtual ~FHerwig() {}
+
+ /// Set up initial state from supplied params.
+ virtual void setGenSpecificInitialState(PdgCode p1 = PROTON, double e1 = 7000.0,
+ PdgCode p2 = PROTON, double e2 = 7000.0);
+
+ /// Run the generator for one event.
+ virtual void makeEvent(HepMC::GenEvent& evt);
+
+ /// Set the random number generator seed.
+ virtual void setSeed(const int value);
+
+ /// Make sure that generic setParam is visible.
+ using Generator::setParam;
+
+ /// Pass a parameter to the generator.
+ virtual bool setParam(const string& name, const string& value);
+
+ /// Tidy up after ourselves
+ virtual void finalize();
+
+ /// Generator name
+ virtual const string getName() const{
+ return "Herwig";
+ }
+
+ string getPDFSet(PdgCode pid);
+ int getPDFMember(PdgCode pid);
+ string getPDFScheme(PdgCode pid)const;
+
+ const virtual double getCrossSection();
+
+ protected:
+ /// Set up default params etc.
+ virtual void initialize();
+
+ /// Fill a HepMC event
+ virtual void fillEvent(HepMC::GenEvent& evt);
+
+ bool _doHadronise;
+ bool _unitWeight;
+
+ private:
+
+ int beamNumber(PdgCode pid);
+ enum { AUTPDF_LENGTH=20 };
+ enum { SEED_OFFSET=17 };
+
+ /// Event counter
+ int _nevt;
+
+ };
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/FHerwig/FHerwigWrapper.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/FHerwig/FHerwigWrapper.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/FHerwig/FHerwigWrapper.hh (revision 755)
@@ -0,0 +1,66 @@
+#ifndef AGILE_FHERWIGWRAPPER_HH
+#define AGILE_FHERWIGWRAPPER_HH
+
+#include <ctype.h>
+#include "AGILe/FortranWrappers.hh"
+#include "HepMC/IO_HERWIG.h"
+#include "HepMC/HEPEVT_Wrapper.h"
+
+
+extern "C" {
+
+ // Herwig
+ #define FC_HWIGIN FC_FUNC(hwigin, HWIGIN)
+ void FC_HWIGIN(void);
+ #define FC_HWIGUP FC_FUNC(hwigup, HWIGUP)
+ void FC_HWIGUP(void);
+ #define FC_HWUINC FC_FUNC(hwuinc, HWUINC)
+ void FC_HWUINC(void);
+ #define FC_HWUSTA FC_FUNC(hwusta, HWUSTA)
+ void FC_HWUSTA(const char*, int);
+ #define FC_HWEINI FC_FUNC(hweini, HWEINI)
+ void FC_HWEINI(void);
+ #define FC_HWUINE FC_FUNC(hwuine, HWUINE)
+ void FC_HWUINE(void);
+ #define FC_HWEPRO FC_FUNC(hwepro, HWEPRO)
+ void FC_HWEPRO(void);
+ #define FC_HWUPRO FC_FUNC(hwupro, HWUPRO)
+ void FC_HWUPRO(void);
+ #define FC_HWBGEN FC_FUNC(hwbgen, HWBGEN)
+ void FC_HWBGEN(void);
+ #define FC_HWDHOB FC_FUNC(hwdhob, HWDHOB)
+ void FC_HWDHOB(void);
+ #define FC_HWCFOR FC_FUNC(hwcfor, HWCFOR)
+ void FC_HWCFOR(void);
+ #define FC_HWCDEC FC_FUNC(hwcdec, HWCDEC)
+ void FC_HWCDEC(void);
+ #define FC_HWDHAD FC_FUNC(hwdhad, HWDHAD)
+ void FC_HWDHAD(void);
+ #define FC_HWDHVY FC_FUNC(hwdhvy, HWDHVY)
+ void FC_HWDHVY(void);
+ #define FC_HWMEVT FC_FUNC(hwmevt, HWMEVT)
+ void FC_HWMEVT(void);
+ #define FC_HWUFNE FC_FUNC(hwufne, HWUFNE)
+ void FC_HWUFNE(void);
+ #define FC_HWEFIN FC_FUNC(hwefin, HWEFIN)
+ void FC_HWEFIN(void);
+ #define FC_HWUDPR FC_FUNC(hwudpr, HWUDPR)
+ void FC_HWUDPR(void);
+ #define FC_HWUEPR FC_FUNC(hwuepr, HWUEPR)
+ void FC_HWUEPR(void);
+ #define FC_HWUPUP FC_FUNC(hwupup, HWUPUP)
+ void FC_HWUPUP(void);
+ #define FC_HWUIDT FC_FUNC(hwuidt, HWUIDT)
+ void FC_HWUIDT(const int*, int*, int*, char**);
+
+ // Get common block size
+ #define FC_HWGETHEPEVTSIZE FC_FUNC(hwgethepevtsize, HWGETHEPEVTSIZE)
+ int FC_HWGETHEPEVTSIZE(void);
+
+ // AlpGen matching routine
+ #define FC_UPVETO FC_FUNC(upveto, UPVETO)
+ void FC_UPVETO(int*);
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/FHerwig/FHerwigJimmy.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/FHerwig/FHerwigJimmy.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/FHerwig/FHerwigJimmy.hh (revision 755)
@@ -0,0 +1,47 @@
+// -*- C++ -*-
+#ifndef AGILE_FHERWIGJIMMY_HH
+#define AGILE_FHERWIGJIMMY_HH
+
+#include "AGILe/Generator.hh"
+#include "AGILe/FHerwig/FHerwig.hh"
+
+
+namespace AGILe {
+
+ /// Abstract base class for the Fortran-based Herwig generator series
+ /// @author Andy Buckley
+ /// @date 2007-10-14
+ class FHerwigJimmy : public FHerwig {
+ public:
+ /// Standard constructor
+ FHerwigJimmy();
+
+ /// Destructor
+ ~FHerwigJimmy() { }
+
+ /// Run the generator for one event.
+ void makeEvent(HepMC::GenEvent& evt);
+
+ /// Make sure that generic setParam is visible.
+ using Generator::setParam;
+
+ /// Pass a parameter to the generator.
+ bool setParam(const string& name, const string& value);
+
+ /// Generator name
+ virtual const string getName() const{
+ return "HerwigJimmy";
+ }
+
+ /// Tidy up after ourselves
+ void finalize();
+
+ protected:
+ /// Set up default params etc.
+ void initialize();
+ };
+
+}
+
+#endif
+
Index: tags/agile-1.2.0/include/AGILe/FHerwig/JimmyWrapper.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/FHerwig/JimmyWrapper.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/FHerwig/JimmyWrapper.hh (revision 755)
@@ -0,0 +1,39 @@
+#ifndef AGILE_JIMMY_WRAPPER_HH
+#define AGILE_JIMMY_WRAPPER_HH
+
+#include <ctype.h>
+#include "AGILe/FortranWrappers.hh"
+
+
+extern "C" {
+
+ // Jimmy
+ #define FC_JMINIT FC_FUNC(jminit, JMINIT)
+ void FC_JMINIT(void);
+ #define FC_JIMMIN FC_FUNC(jimmin, JIMMIN)
+ void FC_JIMMIN(void);
+ #define FC_HWMSCT FC_FUNC(hwmsct, HWMSCT)
+ void FC_HWMSCT(int*);
+ #define FC_JMEFIN FC_FUNC(jmefin, JMEFIN)
+ void FC_JMEFIN(void);
+
+ // COMMON / JMPARM / PTJIM, YGAMMA, JMZMIN, JMRAD(264)
+ // & ,PHAD, JMU2, JMV2, JMARRY( 6+MAXMS,0:NPSIMP )
+ // & ,NLOST, TOTSCAT, ANOMOFF, JCMVAR, JMUEO
+ // & ,JMPTYP(NPROC), JMBUG, FN_TYPE, MSFLAG, MAXMSTRY
+ const int npsimp = 16;
+ const int maxms = 100;
+ const int nproc = 117;
+ #define FC_JMPARM FC_FUNC(jmparm, JMPARM)
+ extern struct {
+ double PTJIM,YGAMMA,JMZMIN,JMRAD[264],PHAD,JMU2,JMV2,JMARRY[npsimp+1][6+maxms];
+ double NLOST, TOTSCAT;
+ int ANOMOFF, JCMVAR, JMUEO, JMPTYP[nproc], JMBUG, FN_TYPE;
+ int MSFLAG, MAXMSTRY;
+ // ANOMOFF is F77 logical.
+ } FC_JMPARM;
+
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/FHerwig/FHerwigWrapper65.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/FHerwig/FHerwigWrapper65.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/FHerwig/FHerwigWrapper65.hh (revision 755)
@@ -0,0 +1,144 @@
+#ifndef AGILE_HERWIGWRAPPER65_HH
+#define AGILE_HERWIGWRAPPER65_HH
+
+#include <ctype.h>
+#include "AGILe/FHerwig/FHerwigWrapper.hh"
+
+/// Herwig common block declarations
+/// Adapted from HepMC wrapper for Herwig by Matt Dobbs
+
+
+extern "C" {
+
+ // COMMON/HWPROC/EBEAM1,EBEAM2,PBEAM1,PBEAM2,IPROC,MAXEV
+ #define FC_HWPROC FC_FUNC(hwproc, HWPROC)
+ extern struct {
+ double EBEAM1,EBEAM2,PBEAM1,PBEAM2;
+ int IPROC,MAXEV;
+ } FC_HWPROC;
+
+
+ // CHARACTER*8 PART1,PART2
+ // COMMON/HWBMCH/PART1,PART2
+ #define FC_HWBMCH FC_FUNC(hwbmch, HWBMCH)
+ extern struct {
+ char PART1[8],PART2[8];
+ } FC_HWBMCH;
+
+
+ // INTEGER IPART1,IPART2
+ // COMMON/HWBEAM/IPART1,IPART2
+ #define FC_HWBEAM FC_FUNC(hwbeam, HWBEAM)
+ extern struct {
+ int IPART1,IPART2;
+ } FC_HWBEAM;
+
+
+ // COMMON/HWEVNT/AVWGT,EVWGT,GAMWT,TLOUT,WBIGST,WGTMAX,WGTSUM,WSQSUM,
+ // & IDHW(NMXHEP),IERROR,ISTAT,LWEVT,MAXER,MAXPR,NOWGT,NRN(2),NUMER,
+ // & NUMERU,NWGTS,GENSOF
+ const int herwig_hepevt_size = 10000;
+ #define FC_HWEVNT FC_FUNC(hwevnt, HWEVNT)
+ extern struct {
+ double AVWGT,EVWGT,GAMWT,TLOUT,WBIGST,WGTMAX,WGTSUM,WSQSUM;
+ int IDHW[herwig_hepevt_size],IERROR,ISTAT,LWEVT,MAXER,MAXPR,
+ NOWGT,NRN[2],NUMER,NUMERU,NWGTS;
+ int GENSOF; // Beware! in F77 this is logical
+ } FC_HWEVNT;
+
+
+ // C Basic parameters (and quantities derived from them)
+ // COMMON/HWPRAM/AFCH(16,2),ALPHEM,B1LIM,BETAF,BTCLM,CAFAC,CFFAC,
+ // & CLMAX,CLPOW,CLSMR(2),CSPEED,ENSOF,ETAMIX,F0MIX,F1MIX,F2MIX,GAMH,
+ // & GAMW,GAMZ,GAMZP,GEV2NB,H1MIX,PDIQK,PGSMX,PGSPL(4),PHIMIX,PIFAC,
+ // & PRSOF,PSPLT(2),PTRMS,PXRMS,QCDL3,QCDL5,QCDLAM,QDIQK,QFCH(16),QG,
+ // & QSPAC,QV,SCABI,SWEIN,TMTOP,VFCH(16,2),VCKM(3,3),VGCUT,VQCUT,
+ // & VPCUT,ZBINM,EFFMIN,OMHMIX,ET2MIX,PH3MIX,GCUTME,
+ // & IOPREM,IPRINT,ISPAC,LRSUD,LWSUD,MODPDF(2),NBTRY,NCOLO,NCTRY,
+ // & NDTRY,NETRY,NFLAV,NGSPL,NSTRU,NSTRY,NZBIN,IOP4JT(2),NPRFMT,
+ // & AZSOFT,AZSPIN,CLDIR(2),HARDME,NOSPAC,PRNDEC,PRVTX,SOFTME,ZPRIME,
+ // & PRNDEF,PRNTEX,PRNWEB
+ #define FC_HWPRAM FC_FUNC(hwpram, HWPRAM)
+ extern struct {
+ double AFCH[2][16],ALPHEM,B1LIM,BETAF,BTCLM,CAFAC,CFFAC,
+ CLMAX,CLPOW,CLSMR[2],CSPEED,ENSOF,ETAMIX,F0MIX,F1MIX,F2MIX,GAMH,
+ GAMW,GAMZ,GAMZP,GEV2NB,H1MIX,PDIQK,PGSMX,PGSPL[4],PHIMIX,PIFAC,
+ PRSOF,PSPLT[2],PTRMS,PXRMS,QCDL3,QCDL5,QCDLAM,QDIQK,QFCH[16],QG,
+ QSPAC,QV,SCABI,SWEIN,TMTOP,VFCH[2][16],VCKM[3][3],VGCUT,VQCUT,
+ VPCUT,ZBINM,EFFMIN,OMHMIX,ET2MIX,PH3MIX,GCUTME;
+ int IOPREM,IPRINT,ISPAC,LRSUD,LWSUD,MODPDF[2],NBTRY,NCOLO,NCTRY,
+ NDTRY,NETRY,NFLAV,NGSPL,NSTRU,NSTRY,NZBIN,IOP4JT[2],NPRFMT;
+ int AZSOFT,AZSPIN,CLDIR[2],HARDME,NOSPAC,PRNDEC,PRVTX,SOFTME,
+ ZPRIME,PRNDEF,PRNTEX,PRNWEB; // In F77 these are logical
+ } FC_HWPRAM;
+
+
+ // COMMON/HWPRCH/AUTPDF(2),BDECAY
+ #define FC_HWPRCH FC_FUNC(hwprch, HWPRCH)
+ extern struct {
+ char AUTPDF[2][20],BDECAY;
+ } FC_HWPRCH;
+
+
+ // COMMON /HW6506/PDFX0,PDFPOW
+ #define FC_HW6506 FC_FUNC(hw6506, HW6506)
+ extern struct {
+ double PDFX0,PDFPOW;
+ } FC_HW6506;
+
+
+ // COMMON/HWUCLU/CLDKWT(NMXCDK),CTHRPW(12,12),PRECO,RESN(12,12),
+ // & RMIN(12,12),LOCN(12,12),NCLDK(NMXCDK),NRECO,CLRECO
+ const int nmxcdk = 4000;
+ #define FC_HWUCLU FC_FUNC(hwuclu, HWUCLU)
+ extern struct {
+ double CLDKWT[nmxcdk],CTHRPW[12][12],PRECO,RESN[12][12],RMIN[12][12];
+ int LOCN[12][12],NCLDK[nmxcdk],NRECO;
+ int CLRECO; //< CLRECO is F77 logical.
+ } FC_HWUCLU;
+
+
+ // COMMON/HWHARD/ASFIXD,CLQ(7,6),COSS,COSTH,CTMAX,DISF(13,2),EMLST,
+ // & EMMAX,EMMIN,EMPOW,EMSCA,EPOLN(3),GCOEF(7),GPOLN,OMEGA0,PHOMAS,
+ // & PPOLN(3),PTMAX,PTMIN,PTPOW,Q2MAX,Q2MIN,Q2POW,Q2WWMN,Q2WWMX,QLIM,
+ // & SINS,THMAX,Y4JT,TMNISR,TQWT,XX(2),XLMIN,XXMIN,YBMAX,YBMIN,YJMAX,
+ // & YJMIN,YWWMAX,YWWMIN,WHMIN,ZJMAX,ZMXISR,IAPHIG,IBRN(2),IBSH,
+ // & ICO(10),IDCMF,IDN(10),IFLMAX,IFLMIN,IHPRO,IPRO,MAPQ(6),MAXFL,
+ // & BGSHAT,COLISR,FSTEVT,FSTWGT,GENEV,HVFCEN,TPOL,DURHAM
+ #define FC_HWHARD FC_FUNC(hwhard, HWHARD)
+ extern struct {
+ double ASFIXD,CLQ[6][7],COSS,COSTH,CTMAX,DISF[2][13],EMLST,EMMAX,
+ EMMIN,EMPOW,EMSCA,EPOLN[3],GCOEF[7],GPOLN,OMEGA0,PHOMAS,PPOLN[3],
+ PTMAX,PTMIN,PTPOW,Q2MAX,Q2MIN,Q2POW,Q2WWMN,Q2WWMX,QLIM,
+ SINS,THMAX,Y4JT,TMNISR,TQWT,XX[2],XLMIN,XXMIN,YBMAX,YBMIN,YJMAX,
+ YJMIN,YWWMAX,YWWMIN,WHMIN,ZJMAX,ZMXISR;
+ int IAPHIG,IBRN[2],IBSH,ICO[10],IDCMF,IDN[10],IFLMAX,IFLMIN,IHPRO,
+ IPRO,MAPQ[6],MAXFL,BGSHAT,COLISR,FSTEVT,FSTWGT,GENEV,HVFCEN,TPOL,DURHAM;
+ } FC_HWHARD;
+
+
+ #define FC_HWDIST FC_FUNC(hwdist, HWDIST)
+ extern struct {
+ double EXAG, GEV2MM, HBAR, PLTCUT, VMIN2, VTXPIP[5],
+ XMIX[2], XMRCT[2], YMIX[2], YMRCT[2];
+ int IOPDKL;
+ int MAXDKL, MIXING, PIPSMR;
+ } FC_HWDIST;
+
+
+ #define FC_HWPROP FC_FUNC(hwprop, HWPROP)
+ extern struct {
+ double RLTIM[501], RMASS[501], RSPIN[501];
+ int ICHRG[501], IDPDG[501], IFLAV[501], NRES;
+ int VTOCDK[501], VTORDK[501];
+ int QORQQB[501], QBORQQ[501];
+ } FC_HWPROP;
+
+
+ // HERWIG block data initializer: call "hwudat();" before starting
+ #define FC_HWPUDAT FC_FUNC(hwudat, HWUDAT)
+ void FC_HWUDAT(void);
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/Utils.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/Utils.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/Utils.hh (revision 755)
@@ -0,0 +1,120 @@
+#ifndef AGILE_UTILS_HH
+#define AGILE_UTILS_HH
+
+#include "AGILe/AGILe.hh"
+#include <algorithm>
+
+namespace AGILe {
+
+
+ inline int nocase_cmp(const string& s1, const string& s2) {
+ string::const_iterator it1 = s1.begin();
+ string::const_iterator it2 = s2.begin();
+ while ( (it1 != s1.end()) && (it2 != s2.end()) ) {
+ if(::toupper(*it1) != ::toupper(*it2)) { // < Letters differ?
+ // Return -1 to indicate smaller than, 1 otherwise
+ return (::toupper(*it1) < ::toupper(*it2)) ? -1 : 1;
+ }
+ // Proceed to the next character in each string
+ ++it1;
+ ++it2;
+ }
+ size_t size1 = s1.size(), size2 = s2.size(); // Cache lengths
+ // Return -1,0 or 1 according to strings' lengths
+ if (size1 == size2) return 0;
+ return (size1 < size2) ? -1 : 1;
+ }
+
+
+ inline string toLower(const string& s) {
+ return boost::to_lower_copy(s);
+ }
+
+
+ inline string toUpper(const string& s) {
+ return boost::to_upper_copy(s);
+ }
+
+
+ template <typename Real>
+ inline bool fuzzyEquals(Real a, Real b, Real tolerance = 0.001) {
+ const double absavg = fabs(a + b)/2.0;
+ const double absdiff = fabs(a - b);
+ return (absavg == 0.0 && absdiff == 0.0) || absdiff/absavg < tolerance;
+ }
+
+
+ /// Split a string with single-character delimiters, ignoring zero-length
+ /// substrings. Designed for getting elements of filesystem paths, naturally.
+ inline std::vector<std::string> split(string path, const string delim = ":") {
+ if (delim.length() != 1) {
+ throw runtime_error("Rivet::split(string): delimiter must be a single character.");
+ }
+ /// @todo Reduce copying of vectors somehow?
+ std::vector<std::string> dirs;
+ boost::split(dirs, path, boost::is_any_of(delim));
+ return dirs;
+ }
+
+
+
+ template <typename T>
+ inline std::string toString(const T& value) {
+ std::string strval = lexical_cast<std::string>(value);
+ //std::cout << "*" << value << "*" << strval << "*" << std::endl;
+ return strval;
+ }
+
+ template <typename T>
+ inline T as(const std::string& strvalue) {
+ T tval = lexical_cast<T>(strvalue);
+ return tval;
+ }
+
+ template <>
+ inline bool as<bool>(const std::string& value) {
+ if (nocase_cmp(value, "true") == 0 || nocase_cmp(value, "yes") == 0 || nocase_cmp(value, "on") == 0) return true;
+ if (nocase_cmp(value, "false") == 0 || nocase_cmp(value, "no") == 0 || nocase_cmp(value, "off") == 0) return false;
+ return as<int>(value);
+ }
+
+ inline int asInt(const std::string& value) { return as<int>(value); }
+ inline double asDouble(const std::string& value) { return as<double>(value); }
+ inline bool asBool(const std::string& value) { return as<bool>(value); }
+
+
+}
+#endif
+
+
+#ifndef CEDARSTD
+#define CEDARSTD
+namespace std {
+
+ template <typename T>
+ inline void operator+=(std::set<T>& s1, const std::set<T>& s2) {
+ for (typename std::set<T>::const_iterator s = s2.begin(); s != s2.end(); ++s) {
+ s1.insert(*s);
+ }
+ }
+
+ template <typename T>
+ inline void operator+=(std::vector<T>& s1, const std::vector<T>& s2) {
+ for (typename std::vector<T>::const_iterator s = s2.begin(); s != s2.end(); ++s) {
+ s1.push_back(*s);
+ }
+ }
+
+ template <typename T>
+ inline string join(const std::vector<T>& v, const std::string& sep = " ") {
+ std::stringstream out;
+ for (size_t i = 0; i < v.size(); ++i) {
+ if (i != 0) out << sep;
+ out << v[i];
+ }
+ return out.str();
+ }
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/Tools/Logging.fhh
===================================================================
--- tags/agile-1.2.0/include/AGILe/Tools/Logging.fhh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/Tools/Logging.fhh (revision 755)
@@ -0,0 +1,8 @@
+#ifndef AGILE_LOGGING_FHH
+#define AGILE_LOGGING_FHH
+
+namespace AGILe {
+ class Log;
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/Tools/AGILePaths.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/Tools/AGILePaths.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/Tools/AGILePaths.hh (revision 755)
@@ -0,0 +1,27 @@
+// -*- C++ -*-
+#ifndef AGILE_AgilePaths_HH
+#define AGILE_AgilePaths_HH
+
+namespace AGILe {
+
+
+ /// Get library install path
+ const std::string getLibPath();
+
+ /// Get data install path
+ const std::string getDataPath();
+
+ /// Get Agile data install path
+ const std::string getAGILeDataPath();
+
+
+ /// Get AGILe generator library search paths (cf. Genser root directory)
+ const std::vector<std::string> getGenPaths();
+
+ /// Get LCG platform tag
+ const std::string getLCGPlatformTag();
+
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/Tools/Logging.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/Tools/Logging.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/Tools/Logging.hh (revision 755)
@@ -0,0 +1,175 @@
+#ifndef AGILE_LOGGING_HH
+#define AGILE_LOGGING_HH
+
+#include "AGILe/AGILe.hh"
+
+namespace AGILe {
+
+
+ class Log {
+ public:
+
+ /// Log priority levels.
+ enum Level {
+ TRACE = 0, DEBUG = 10, INFO = 20, WARN = 30, WARNING = 30, ERROR = 40, CRITICAL = 50, ALWAYS = 50
+ };
+
+ /// Typedef for a collection of named logs.
+ typedef std::map<const std::string, Log*> LogMap;
+
+ /// Typedef for a collection of named log levels.
+ typedef std::map<const std::string, int> LevelMap;
+
+ /// Typedef for a collection of shell color codes, accessed by log level.
+ typedef std::map<int, std::string> ColorCodes;
+
+ private:
+ /// A static std::map of existing logs: we don't make more loggers than necessary.
+ static LogMap existingLogs;
+
+ /// A static std::map of default log levels.
+ static LevelMap defaultLevels;
+
+ /// A static std::map of shell color codes for the log levels.
+ static ColorCodes colorCodes;
+
+ /// Shell color code for the end of the log levels.
+ static std::string endColorCode;
+
+ /// Show timestamp?
+ static bool showTimestamp;
+
+ /// Show log level?
+ static bool showLogLevel;
+
+ /// Show logger name?
+ static bool showLoggerName;
+
+ /// Use shell colour escape codes?
+ static bool useShellColors;
+
+ public:
+ /// Set the log levels
+ static void setLevel(const std::string& name, int level);
+ static void setLevels(LevelMap& logLevels);
+
+ static void setShowTimestamp(const bool showTime=true) {
+ showTimestamp = showTime;
+ }
+
+ static void setShowLevel(const bool showLevel=true) {
+ showLogLevel = showLevel;
+ }
+
+ static void setShowLoggerName(const bool showName=true) {
+ showLoggerName = showName;
+ }
+
+ static void setUseColors(const bool useColors=true) {
+ useShellColors = useColors;
+ }
+
+ protected:
+ /// @name Hidden constructors etc.
+ //@{
+ /// Constructor 1
+ Log(const std::string& name);
+
+ /// Constructor 2
+ Log(const std::string& name, int level);
+
+ /// Copy constructor
+ //Log(const Log&);
+
+ /// Copy assignment operator
+ //Log& operator=(const Log&);
+ //@}
+
+ static std::string getColorCode(int level);
+
+ public:
+ /// Get a logger with the given name. The level will be taken from the
+ /// "requestedLevels" static std::map or will be INFO by default.
+ static Log& getLog(const std::string& name);
+
+ public:
+ /// Get the priority level of this logger.
+ int getLevel() const {
+ return _level;
+ }
+
+ /// Set the priority level of this logger.
+ Log& setLevel(int level) {
+ _level = level;
+ return *this;
+ }
+
+ /// Get a log level enum from a string.
+ static Level getLevelFromName(const std::string& level);
+
+ /// Get the string representation of a log level.
+ static std::string getLevelName(int level);
+
+ /// Get the name of this logger.
+ std::string getName() const {
+ return _name;
+ }
+
+ /// Set the name of this logger.
+ Log& setName(const std::string& name) {
+ _name = name;
+ return *this;
+ }
+
+ /// Will this log level produce output on this logger at the moment?
+ bool isActive(int level) const {
+ return (level >= _level);
+ }
+
+ /// @name Explicit log methods
+ //@{
+ void trace(const std::string& message) { log(TRACE, message); }
+
+ void debug(const std::string& message) { log(DEBUG, message); }
+
+ void info(const std::string& message) { log(INFO, message); }
+
+ void warn(const std::string& message) { log(WARN, message); }
+
+ void error(const std::string& message) { log(ERROR, message); }
+
+ void always(const std::string& message) { log(ALWAYS, message); }
+ //@}
+
+ private:
+ /// This logger's name
+ std::string _name;
+
+ /// Threshold level for this logger.
+ int _level;
+
+ protected:
+ /// Write a message at a particular level.
+ void log(int level, const std::string& message);
+
+ /// Turn a message string into the current log format.
+ std::string formatMessage(int level, const std::string& message);
+
+ public:
+
+ /// A null output stream, used for piping discarded output to nowhere.
+ /// @todo Hide this...
+ std::ostream* const _nostream;
+
+ /// The streaming operator can use Log's internals.
+ friend std::ostream& operator<<(Log& log, int level);
+
+ };
+
+ /// Streaming output to a logger must have a Log::Level/int as its first argument.
+ std::ostream& operator<<(Log& log, int level);
+
+}
+
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/Particle.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/Particle.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/Particle.hh (revision 755)
@@ -0,0 +1,56 @@
+#ifndef AGILE_PARTICLE_HH
+#define AGILE_PARTICLE_HH
+
+namespace AGILe {
+
+ typedef int PdgCode;
+
+ /// Enumeration of available beam particles (using PDG IDs where available)
+ enum ParticleName {
+ ELECTRON = 11,
+ POSITRON = -11,
+ PROTON = 2212,
+ ANTIPROTON = -2212,
+ PHOTON = 22,
+ NEUTRON = 2112,
+ ANTINEUTRON = 2112,
+ MUON = 13,
+ ANTIMUON = -13,
+ NU_E = 12,
+ NU_EBAR = -12,
+ NU_MU = 14,
+ NU_MUBAR = -14,
+ NU_TAU = 16,
+ NU_TAUBAR = -16,
+ PIPLUS = 211,
+ PIMINUS = -211,
+ TAU = 15,
+ ANTITAU = -15,
+ EMINUS = 11,
+ EPLUS = -11,
+ P = 2212,
+ PBAR = -2212,
+ GAMMA = 22,
+ ANY = 10000,
+ PHOTOELECTRON,
+ PHOTOPOSITRON,
+ PHOTOMUON,
+ PHOTOANTIMUON,
+ PHOTOTAU,
+ PHOTOANTITAU
+ };
+
+
+ // /// Get the particle enum corresponding to the supplied string.
+ // inline const Particle strToBeam(const std::string& beamname) {
+ // if (beamname == "ELECTRON" || beamname == "E-") return ELECTRON;
+ // if (beamname == "POSITRON" || beamname == "E+") return POSITRON;
+ // if (beamname == "PROTON" || beamname == "P") return PROTON;
+ // if (beamname == "ANTIPROTON" || beamname == "PBAR") return ANTIPROTON;
+ // if (beamname == "PHOTON" || beamname == "GAMMA") return PHOTON;
+ // throw std::runtime_error("Couldn't parse beam string into a valid beam particle");
+ // }
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/Run.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/Run.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/Run.hh (revision 755)
@@ -0,0 +1,63 @@
+// -*- C++ -*-
+#ifndef AGILE_RUN_HH
+#define AGILE_RUN_HH
+
+#include "AGILe/AGILe.hh"
+#include "AGILe/Generator.hh"
+#include "HepMC/GenEvent.h"
+#include "HepMC/IO_GenEvent.h"
+
+namespace AGILe {
+
+
+ /// @author Andy Buckley
+ class Run {
+ public:
+
+ /// Make a generator run with a particular gen
+ Run(Generator& gen);
+
+ /// Make a generator run with a particular gen and I/O target
+ Run(Generator& gen, const std::string& evtfile="-");
+
+ /// Destructor
+ ~Run();
+
+ /// Choose whether to filter out unphysical particles
+ void doFilter(bool filt=true);
+
+ /// Generate an event and send it to the writer if it exists
+ bool makeEvent();
+
+ /// Get the current generated event
+ const HepMC::GenEvent& event() const {
+ return _evt;
+ }
+
+ /// Return an event summary string
+ std::string eventSummary() const;
+
+
+ private:
+
+ /// Generator used in this run
+ Generator* _gen;
+
+ /// Flag to decide whether or not to strip unphysical particles out of events
+ bool _filter;
+
+ /// Current HepMC event
+ HepMC::GenEvent _evt;
+
+ /// Output stream for HepMC writer
+ shared_ptr<std::ostream> _ostr;
+
+ /// HepMC I/O writer
+ shared_ptr<HepMC::IO_GenEvent> _io;
+
+ };
+
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/AGILeSTL.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/AGILeSTL.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/AGILeSTL.hh (revision 755)
@@ -0,0 +1,47 @@
+#ifndef AGILE_AgileSTL_HH
+#define AGILE_AgileSTL_HH
+
+#include <typeinfo>
+#include <set>
+#include <map>
+#include <string>
+#include <vector>
+#include <stdexcept>
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+#include <list>
+
+namespace AGILe {
+
+ using std::set;
+ using std::map;
+ using std::multimap;
+ using std::type_info;
+ using std::string;
+ using std::less;
+ using std::vector;
+ using std::list;
+ using std::pair;
+ using std::make_pair;
+ using std::runtime_error;
+ using std::exception;
+ using std::min;
+ using std::stringstream;
+ using std::istringstream;
+ using std::ostringstream;
+ using std::max;
+
+ // Prefer to encourage Log::getLog()
+ // using std::cout;
+ // using std::cerr;
+
+ using std::ostream;
+ using std::istream;
+ using std::cin;
+ using std::setw;
+ using std::endl;
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/FortranWrappers.hh.in
===================================================================
--- tags/agile-1.2.0/include/AGILe/FortranWrappers.hh.in (revision 0)
+++ tags/agile-1.2.0/include/AGILe/FortranWrappers.hh.in (revision 755)
@@ -0,0 +1,13 @@
+/* Define to dummy `main' function (if any) required to link to the Fortran
+ libraries. */
+#undef FC_DUMMY_MAIN
+
+/* Define if F77 and FC dummy `main' functions are identical. */
+#undef FC_DUMMY_MAIN_EQ_F77
+
+/* Define to a macro mangling the given C identifier (in lower and upper
+ case), which must not contain underscores, for linking with Fortran. */
+#undef FC_FUNC
+
+/* As FC_FUNC, but for C identifiers containing underscores. */
+#undef FC_FUNC_
Index: tags/agile-1.2.0/include/AGILe/FPythia/FPythia.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/FPythia/FPythia.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/FPythia/FPythia.hh (revision 755)
@@ -0,0 +1,77 @@
+#ifndef AGILE_FPYTHIA_HH
+#define AGILE_FPYTHIA_HH
+
+#include "AGILe/Generator.hh"
+#include "HepMC/IO_HEPEVT.h"
+
+namespace AGILe {
+
+ /// Abstract base class for the Fortran-based Pythia 6 generator series
+ /// @author Andy Buckley
+ class FPythia : public Generator {
+ public:
+ /// Standard constructor
+ FPythia();
+
+ /// Destructor
+ virtual ~FPythia() { }
+
+ /// Set up initial state from supplied params
+ void setGenSpecificInitialState(PdgCode p1 = PROTON, double e1 = 7000.0,
+ PdgCode p2 = PROTON, double e2 = 7000.0);
+
+ const string getName() const {
+ return "PYTHIA";
+ }
+
+
+ /// Run the generator for one event
+ void makeEvent(HepMC::GenEvent& evt);
+
+
+ /// Set the random number generator seed.
+ virtual void setSeed(const int value) {
+ setParam("MRPY(1)", value);
+ }
+
+
+ /// Make sure that generic setParam is visible.
+ using Generator::setParam;
+
+
+ /// Pass an string parameter to the generator.
+ virtual bool setParam(const string& name, const string& value);
+
+ string getPDFSet(PdgCode pid);
+ int getPDFMember(PdgCode pid);
+ string getPDFScheme(PdgCode pid)const;
+
+ /// Return the generated cross section in pb.
+ virtual const double getCrossSection();
+
+ virtual const string getVersion();
+
+ /// Tidy up after ourselves
+ void finalize();
+
+ protected:
+ /// Set up default params etc.
+ void initialize();
+
+ /// Fill a HepMC event
+ void fillEvent(HepMC::GenEvent& evt);
+
+ /// Internal storage of initial state params
+ string _particleName1, _particleName2;
+ double _e1, _e2;
+
+ /// Event counter
+ int _nevt;
+
+ /// HEPEVT->HepMC converter
+ HepMC::IO_HEPEVT _hepevt;
+ };
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/FPythia/FPythiaWrapper.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/FPythia/FPythiaWrapper.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/FPythia/FPythiaWrapper.hh (revision 755)
@@ -0,0 +1,36 @@
+#ifndef AGILE_FPYTHIAWRAPPER_HH
+#define AGILE_FPYTHIAWRAPPER_HH
+
+#include <ctype.h>
+#include "AGILe/FortranWrappers.hh"
+
+extern "C" {
+ #define FC_PYHEPC FC_FUNC(pyhepc, PYHEPC)
+ void FC_PYHEPC(int*);
+ #define FC_PYINIT FC_FUNC(pyinit, PYINIT)
+ void FC_PYINIT(const char*,const char*,const char*,double*,int,int,int);
+ #define FC_PYGIVE FC_FUNC(pygive, PYGIVE)
+ void FC_PYGIVE(const char*,int);
+ #define FC_PYLIST FC_FUNC(pylist, PYLIST)
+ void FC_PYLIST(int*);
+ #define FC_PYSTAT FC_FUNC(pystat, PYSTAT)
+ void FC_PYSTAT(int*);
+ #define FC_PYEVNT FC_FUNC(pyevnt, PYEVNT)
+ void FC_PYEVNT();
+ #define FC_UPINIT FC_FUNC(upinit, UPINIT)
+ void FC_UPINIT();
+ #define FC_UPEVNT FC_FUNC(upevnt, UPENVT)
+ void FC_UPEVNT();
+ #define FC_INITPYDATA FC_FUNC(initpydata, INITPYDATA)
+ void FC_INITPYDATA();
+}
+
+// Define methods to hide the subtle syntax necessary to call Fortran from C++
+void call_pyhepc(int mode);
+void call_pyinit(const char* frame, const char* beam, const char* target, double win);
+void call_pygive(const char* frame );
+void call_pylist(int mode);
+void call_pystat(int mode);
+void call_pyevnt();
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/FPythia/FPythiaWrapper62.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/FPythia/FPythiaWrapper62.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/FPythia/FPythiaWrapper62.hh (revision 755)
@@ -0,0 +1,98 @@
+#ifndef AGILE_FPYTHIAWRAPPER62_HH
+#define AGILE_FPYTHIAWRAPPER62_HH
+
+//////////////////////////////////////////////////////////////////////////
+// Pythia common block declarations
+// Matt.Dobbs@Cern.CH, November 2000
+// Version 6.200 update October 2001
+// Adapted by Andy Buckley, July 2006 and September 2007
+// Wrapper for FORTRAN version of Pythia
+//////////////////////////////////////////////////////////////////////////
+
+#include <ctype.h>
+#include <cstring>
+#include "AGILe/FPythia/FPythiaWrapper.hh"
+
+
+extern "C" {
+
+ #define FC_PYJETS FC_FUNC(pyjets, PYJETS)
+ const int pyjets_maxn = 4000;
+ extern struct {
+ int n, npad, k[5][pyjets_maxn];
+ double p[5][pyjets_maxn], v[5][pyjets_maxn];
+ } FC_PYJETS;
+
+
+ #define FC_PYDAT1 FC_FUNC(pydat1, PYDAT1)
+ extern struct {
+ int mstu[200];
+ double paru[200];
+ int mstj[200];
+ double parj[200];
+ } FC_PYDAT1;
+
+
+ #define FC_PYDAT2 FC_FUNC(pydat2, PYDAT2)
+ extern struct {
+ int kchg[4][500];
+ double pmas[4][500], parf[2000], vckm[4][4];
+ } FC_PYDAT2;
+
+
+ #define FC_PYDAT3 FC_FUNC(pydat3, PYDAT3)
+ extern struct {
+ int mdcy[3][500], mdme[2][8000];
+ double brat[8000];
+ int kfdp[5][8000];
+ } FC_PYDAT3;
+
+
+ #define FC_PYDATR FC_FUNC(pydatr, PYDATR)
+ extern struct {
+ int mrpy[6];
+ double rrpy[100];
+ } FC_PYDATR;
+
+
+ #define FC_PYSUBS FC_FUNC(pysubs, PYSUBS)
+ extern struct {
+ int msel, mselpd, msub[500], kfin[81][2];
+ double ckin[200];
+ } FC_PYSUBS;
+
+
+ #define FC_PYPARS FC_FUNC(pypars, PYPARS)
+ extern struct {
+ int mstp[200];
+ double parp[200];
+ int msti[200];
+ double pari[200];
+ } FC_PYPARS;
+
+
+ #define FC_PYINT1 FC_FUNC(pyint1, PYINT1)
+ extern struct {
+ int mint[400];
+ double vint[400];
+ } FC_PYINT1;
+
+
+ #define FC_PYINT2 FC_FUNC(pyint2, PYINT2)
+ extern struct {
+ int iset[500], kfpr[2][500];
+ double coef[20][500];
+ int icol[2][4][40]; // was [320] was [40][4][2]
+ } FC_PYINT2;
+
+
+ #define FC_PYINT5 FC_FUNC(pyint5, PYINT5)
+ extern struct {
+ int ngenpd, ngen[3][501];
+ double xsec[3][501];
+ } FC_PYINT5;
+
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/Loader.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/Loader.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/Loader.hh (revision 755)
@@ -0,0 +1,20 @@
+#ifndef AGILE_LOADER_HH
+#define AGILE_LOADER_HH
+
+#include "AGILe/Generator.hh"
+
+namespace AGILe {
+
+ /// @todo Make this a singleton class with automatic init and finalize
+ namespace Loader {
+ void initialize();
+ std::vector<std::string> getAvailableGens();
+ void loadGenLibs(const std::string& genname);
+ Generator* createGen();
+ void destroyGen(Generator* gen);
+ void finalize();
+ }
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/AlpGen/AlpGen.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/AlpGen/AlpGen.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/AlpGen/AlpGen.hh (revision 755)
@@ -0,0 +1,33 @@
+#ifndef AGILE_ALPGEN_HH
+#define AGILE_ALPGEN_HH
+
+#include "AGILe/Generator.hh"
+
+namespace AGILe {
+
+
+ /// Abstract base class for AlpGen interface
+ /// @author Andy Buckley
+ class AlpGen : public Generator {
+ public:
+ /// Constructor.
+ AlpGen() { }
+
+ /// Destructor.
+ ~AlpGen() { }
+
+ /// Make sure that generic setParam is visible.
+ //using Generator::setParam;
+
+ /// Pass a parameter to the generator.
+ bool setParam(const string& name, const string& value);
+
+ // Reqd for compilation
+ void finalize() { }
+ void setGenSpecificInitialState(int, double, int, double) { }
+ };
+
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/AlpGen/AlpGenWrapper.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/AlpGen/AlpGenWrapper.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/AlpGen/AlpGenWrapper.hh (revision 755)
@@ -0,0 +1,30 @@
+#ifndef AGILE_ALPGEN_WRAPPER_HH
+#define AGILE_ALPGEN_WRAPPER_HH
+
+#include <ctype.h>
+#include "AGILe/FortranWrappers.hh"
+
+
+/// Alpgen common block declarations
+extern "C" {
+
+ // common/AHio/Nunit,NunitOut,NunitIni,filename
+ #define FC_AHIO FC_FUNC(ahio, AHIO)
+ extern struct {
+ int NUNIT,NUNITOUT,NUNITINI;
+ char FILENAME[100];
+ } FC_AHIO;
+
+ // Inputs for the matching algorithm:
+ // integer iexc,npfst,nplst,nljets,njstart,njlast,ickkw
+ // double precision etclus,rclus,etaclmax
+ // common/AHopts/etclus,rclus,etaclmax,iexc,npfst,nplst,nljets,njstart,njlast,ickkw
+ #define FC_AHOPTS FC_FUNC(ahopts, AHIO)
+ extern struct {
+ double ETCLUS,RCLUS,ETACLMAX;
+ int IEXC,NPFST,NPLST,NLJETS,NJSTART,NJLAST,ICKKW;
+ } FC_AHOPTS;
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/AlpGen/AlpGenFHerwigJimmy.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/AlpGen/AlpGenFHerwigJimmy.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/AlpGen/AlpGenFHerwigJimmy.hh (revision 755)
@@ -0,0 +1,40 @@
+#ifndef AGILE_ALPGENFHERWIGJIMMY_HH
+#define AGILE_ALPGENFHERWIGJIMMY_HH
+
+#include "AGILe/Generator.hh"
+#include "AGILe/AlpGen/AlpGen.hh"
+#include "AGILe/FHerwig/FHerwigJimmy.hh"
+
+namespace AGILe {
+
+
+ /// Abstract base class for AlpGen + Herwig + Jimmy interface
+ /// @author Andy Buckley
+ /// @date 2009-06-30
+ class AlpGenFHerwigJimmy : public FHerwigJimmy {
+ public:
+ /// Standard constructor
+ AlpGenFHerwigJimmy();
+
+ /// Destructor
+ ~AlpGenFHerwigJimmy() { }
+
+ /// Make sure that generic setParam is visible.
+ using Generator::setParam;
+
+ /// Pass a parameter to the generator
+ bool setParam(const string& name, const string& value);
+
+ /// Generate events
+ void makeEvent(HepMC::GenEvent& evt);
+
+
+ private:
+
+ // Store an AlpGen interface instance for param passing
+ AlpGen _alpgen;
+ };
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/AlpGen/AlpGenFPythia.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/AlpGen/AlpGenFPythia.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/AlpGen/AlpGenFPythia.hh (revision 755)
@@ -0,0 +1,38 @@
+#ifndef AGILE_ALPGENFPYTHIA_HH
+#define AGILE_ALPGENFPYTHIA_HH
+
+#include "AGILe/Generator.hh"
+#include "AGILe/AlpGen/AlpGen.hh"
+#include "AGILe/FPythia/FPythia.hh"
+
+namespace AGILe {
+
+
+ /// Abstract base class for AlpGen interface
+ /// @author Jon Butterworth
+ /// @author Andy Buckley
+ class AlpGenFPythia : public FPythia {
+ public:
+ /// Standard constructor.
+ AlpGenFPythia();
+
+ /// Destructor.
+ ~AlpGenFPythia() { }
+
+ /// Make sure that generic setParam is visible.
+ using Generator::setParam;
+
+ /// Pass a parameter to the generator.
+ bool setParam(const string& name, const string& value);
+
+
+ private:
+
+ // Store an AlpGen interface instance for param passing
+ AlpGen _alpgen;
+ };
+
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/AlpGen/AlpGenFHerwig.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/AlpGen/AlpGenFHerwig.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/AlpGen/AlpGenFHerwig.hh (revision 755)
@@ -0,0 +1,41 @@
+#ifndef AGILE_ALPGENFHERWIG_HH
+#define AGILE_ALPGENFHERWIG_HH
+
+#include "AGILe/Generator.hh"
+#include "AGILe/AlpGen/AlpGen.hh"
+#include "AGILe/FHerwig/FHerwig.hh"
+
+
+namespace AGILe {
+
+ /// Abstract base class for AlpGen interface
+ /// @author Jon Butterworth
+ /// @author Andy Buckley
+ /// @date 2007-10-16
+ class AlpGenFHerwig : public FHerwig {
+ public:
+ /// Standard constructor
+ AlpGenFHerwig();
+
+ /// Destructor
+ ~AlpGenFHerwig() { }
+
+ /// Make sure that generic setParam is visible.
+ using Generator::setParam;
+
+ /// Pass a parameter to the generator
+ bool setParam(const string& name, const string& value);
+
+ /// Generate events
+ void makeEvent(HepMC::GenEvent& evt);
+
+
+ private:
+
+ // Store an AlpGen interface instance for param passing
+ AlpGen _alpgen;
+ };
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/Charybdis/CharybdisFHerwig.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/Charybdis/CharybdisFHerwig.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/Charybdis/CharybdisFHerwig.hh (revision 755)
@@ -0,0 +1,38 @@
+#ifndef AGILE_CHARYBDISFHERWIG_HH
+#define AGILE_CHARYBDISFHERWIG_HH
+
+#include "AGILe/Generator.hh"
+#include "AGILe/Charybdis/Charybdis.hh"
+#include "AGILe/FHerwig/FHerwig.hh"
+
+namespace AGILe {
+
+
+ /// Abstract base class for Charybdis interface
+ /// @author Doug Gingrich
+ /// @author Andy Buckley
+ class CharybdisFHerwig : public FHerwig {
+ public:
+ /// Standard constructor
+ CharybdisFHerwig();
+
+ /// Destructor
+ ~CharybdisFHerwig() { }
+
+ /// Make sure that generic setParam is visible.
+ using FHerwig::setParam;
+
+ /// Pass a parameter to the generator
+ bool setParam(const string& name, const string& value);
+
+ private:
+
+ // Store a Charybdis interface instance for param passing
+ Charybdis _charybdis;
+
+ };
+
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/Charybdis/Charybdis.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/Charybdis/Charybdis.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/Charybdis/Charybdis.hh (revision 755)
@@ -0,0 +1,34 @@
+#ifndef AGILE_CHARYBDIS_HH
+#define AGILE_CHARYBDIS_HH
+
+#include "AGILe/Generator.hh"
+#include "AGILe/Charybdis/CharybdisWrapper.hh"
+
+namespace AGILe {
+
+
+ /// Abstract base class for Charybdis interface
+ /// @author Andy Buckley
+ class Charybdis : public Generator {
+ public:
+ /// Standard constructor
+ Charybdis() { }
+
+ /// Destructor
+ ~Charybdis() { }
+
+ // /// Make sure that generic setParam is visible.
+ // using Generator::setParam;
+
+ /// Pass a parameter to the generator
+ bool setParam(const string& name, const string& value);
+
+ // Reqd for compilation
+ void finalize() { }
+ void setGenSpecificInitialState(int, double, int, double) { }
+ };
+
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/Charybdis/CharybdisWrapper.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/Charybdis/CharybdisWrapper.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/Charybdis/CharybdisWrapper.hh (revision 755)
@@ -0,0 +1,53 @@
+#ifndef AGILE_CHARYBDIS_WRAPPER_HH
+#define AGILE_CHARYBDIS_WRAPPER_HH
+
+#include <ctype.h>
+#include "AGILe/FortranWrappers.hh"
+#include "HepMC/HEPEVT_Wrapper.h"
+
+
+/// Charybdis common block declarations.
+extern "C" {
+
+ // Les Houches run common block.
+ const int MAXPUP=100;
+ #define FC_HEPRUP FC_FUNC(heprup, HEPRUP)
+ extern struct {
+ int IDBMUP[2];
+ double EBMUP[2];
+ int PDFGUP[2],PDFSUP[2],IDWTUP,NPRUP;
+ double XSECUP[MAXPUP],XERRUP[MAXPUP],XMAXUP[MAXPUP];
+ int LPRUP[MAXPUP];
+ } FC_HEPRUP;
+
+ // Common block for the probabilities of SM particles.
+ #define FC_BHPROB FC_FUNC(bhprob, BHPROB)
+ extern struct {
+ double PQUARK,PLEPT,PNEUT,PGLUON,PGAMMA,PWBOSN,
+ PZBOSN,PHIGGS,PFERM[3],PBOSON[5];
+ } FC_BHPROB;
+
+ // Common block for the main parameters.
+ #define FC_BHPARM FC_FUNC(bhparm, BHPARM)
+ extern struct {
+ double MPLNCK,MINMSS,MAXMSS,INTMPL;
+ int MSSDEF,NBODY,IBHPRN,MSSDEC;
+ int TIMVAR,GTSCA,GRYBDY,KINCUT; //Beware, in F77 this is LOGICAL.
+ } FC_BHPARM;
+
+ // Common block for decay of the black hole.
+ #define FC_BLACKH FC_FUNC(blackh, BLACKH)
+ extern struct {
+ double RHFACT,BHMASS;
+ int TOTDIM;
+ } FC_BLACKH;
+
+ // BW mod 16/08/06: new common for version 1.003.
+ #define FC_BH1003 FC_FUNC(bh1003, BH1003)
+ extern struct {
+ double THWMAX,RMMINM;
+ int YRCSEC,RMBOIL; //Beware, in F77 this is LOGICAL.
+ } FC_BH1003;
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/Charybdis/CharybdisFHerwigJimmy.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/Charybdis/CharybdisFHerwigJimmy.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/Charybdis/CharybdisFHerwigJimmy.hh (revision 755)
@@ -0,0 +1,38 @@
+#ifndef AGILE_CHARYBDISFHERWIGJIMMY_HH
+#define AGILE_CHARYBDISFHERWIGJIMMY_HH
+
+#include "AGILe/Generator.hh"
+#include "AGILe/Charybdis/Charybdis.hh"
+#include "AGILe/FHerwig/FHerwigJimmy.hh"
+
+namespace AGILe {
+
+
+ /// Abstract base class for Charybdis interface
+ /// @author Andy Buckley
+ class CharybdisFHerwigJimmy : public FHerwigJimmy {
+ public:
+ /// Standard constructor
+ CharybdisFHerwigJimmy();
+
+ /// Destructor
+ ~CharybdisFHerwigJimmy() { }
+
+ /// Make sure that generic setParam is visible.
+ using FHerwig::setParam;
+
+ /// Pass a parameter to the generator
+ bool setParam(const string& name, const string& value);
+
+
+ private:
+
+ // Store a Charybdis interface instance for param passing
+ Charybdis _charybdis;
+
+ };
+
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/Charybdis/CharybdisFPythia.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/Charybdis/CharybdisFPythia.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/Charybdis/CharybdisFPythia.hh (revision 755)
@@ -0,0 +1,39 @@
+#ifndef AGILE_CHARYBDISFPYTHIA_HH
+#define AGILE_CHARYBDISFPYTHIA_HH
+
+#include "AGILe/Generator.hh"
+#include "AGILe/Charybdis/Charybdis.hh"
+#include "AGILe/FPythia/FPythia.hh"
+
+namespace AGILe {
+
+
+ /// Abstract base class for Charybdis interface
+ /// @author Doug Gingrich
+ /// @author Andy Buckley
+ /// @date 2007-10-16
+ class CharybdisFPythia : public FPythia {
+ public:
+ /// Standard constructor.
+ CharybdisFPythia();
+
+ /// Destructor.
+ ~CharybdisFPythia() { }
+
+ /// Make sure that generic setParam is visible.
+ using Generator::setParam;
+
+ /// Pass a parameter to the generator.
+ bool setParam(const string& name, const string& value);
+
+ private:
+
+ // Store a Charybdis interface instance for param passing
+ Charybdis _charybdis;
+
+ };
+
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/Makefile.am
===================================================================
--- tags/agile-1.2.0/include/AGILe/Makefile.am (revision 0)
+++ tags/agile-1.2.0/include/AGILe/Makefile.am (revision 755)
@@ -0,0 +1,55 @@
+pkgincludedir = ${includedir}/AGILe
+
+pkginclude_HEADERS = \
+ AGILe.hh \
+ AGILeSTL.hh \
+ AGILeBoost.hh \
+ Utils.hh \
+ Generator.hh \
+ Particle.hh \
+ GeneratorState.hh \
+ Loader.hh \
+ Run.hh
+
+dist_noinst_HEADERS = \
+ HepMCTools.hh
+
+nobase_pkginclude_HEADERS = \
+ Tools/Logging.hh Tools/Logging.fhh \
+ Tools/AGILePaths.hh
+
+nobase_pkginclude_HEADERS += \
+ FHerwig/FHerwig.hh \
+ FHerwig/FHerwigJimmy.hh \
+ FHerwig/JimmyWrapper.hh \
+ FHerwig/FHerwigWrapper.hh \
+ FHerwig/FHerwigWrapper65.hh
+
+nobase_pkginclude_HEADERS += \
+ FPythia/FPythia.hh \
+ FPythia/FPythiaWrapper.hh \
+ FPythia/FPythiaWrapper62.hh
+
+nobase_pkginclude_HEADERS += \
+ AlpGen/AlpGen.hh \
+ AlpGen/AlpGenFHerwig.hh \
+ AlpGen/AlpGenFHerwigJimmy.hh \
+ AlpGen/AlpGenFPythia.hh \
+ AlpGen/AlpGenWrapper.hh
+
+nobase_pkginclude_HEADERS += \
+ Charybdis/CharybdisFHerwig.hh \
+ Charybdis/CharybdisFHerwigJimmy.hh \
+ Charybdis/CharybdisFPythia.hh \
+ Charybdis/CharybdisWrapper.hh \
+ Charybdis/Charybdis.hh
+
+nobase_pkginclude_HEADERS += \
+ Rapgap/RapgapWrapper.hh \
+ Rapgap/RapgapWrapper32.hh \
+ Rapgap/Rapgap.hh
+
+nobase_pkginclude_HEADERS += \
+ Cascade/CascadeWrapper.hh \
+ Cascade/CascadeWrapper2.hh \
+ Cascade/Cascade.hh
Index: tags/agile-1.2.0/include/AGILe/Rapgap/Rapgap.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/Rapgap/Rapgap.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/Rapgap/Rapgap.hh (revision 755)
@@ -0,0 +1,79 @@
+#ifndef AGILE_RAPGAP_HH
+#define AGILE_RAPGAP_HH
+
+#include "AGILe/Generator.hh"
+#include "HepMC/IO_HEPEVT.h"
+
+namespace AGILe {
+
+
+ /// Abstract base class for Rapgap interface
+ /// @author Andy Buckley
+ /// @author Holger Schulz
+ class Rapgap : public Generator {
+ public:
+ /// Standard constructor
+ Rapgap();
+
+ /// Destructor
+ virtual ~Rapgap() { }
+
+ /// Set up initial state from supplied params
+ void setGenSpecificInitialState(PdgCode p1 = PROTON, double e1 = 6000.0,
+ PdgCode p2 = PROTON, double e2 = 7000.0);
+
+ /// Make sure that generic setParam is visible.
+ using Generator::setParam;
+
+ /// Pass an string parameter to the generator.
+ virtual bool setParam(const string& name, const string& value);
+
+ /// Generator name
+ virtual const string getName() const{
+ return "Rapgap";
+ }
+
+ /// Run the generator for one event
+ void makeEvent(HepMC::GenEvent& evt);
+
+
+ /// Set the random number generator seed.
+ //virtual void setSeed(const int value) {
+ //setParam("ISEED", value);
+ //}
+
+
+ //string getPDFSet(PdgCode pid);
+ //int getPDFMember(PdgCode pid);
+ //string getPDFScheme(PdgCode pid)const;
+
+ /// Return the generated cross section in pb.
+ virtual const double getCrossSection();
+
+ //virtual const string getVersion();
+
+ /// Tidy up after ourselves
+ void finalize();
+
+ protected:
+ /// Set up default params etc.
+ void initialize();
+
+ /// Fill a HepMC event
+ void fillEvent(HepMC::GenEvent& evt);
+
+ /// Internal storage of initial state params
+ string _particleName1, _particleName2;
+ double _e1, _e2;
+
+ /// Event counter
+ int _nevt;
+
+ /// HEPEVT->HepMC converter
+ HepMC::IO_HEPEVT _hepevt;
+ };
+
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/Rapgap/RapgapWrapper.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/Rapgap/RapgapWrapper.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/Rapgap/RapgapWrapper.hh (revision 755)
@@ -0,0 +1,57 @@
+#ifndef AGILE_RAPGAP_WRAPPER_HH
+#define AGILE_RAPGAP_WRAPPER_HH
+
+#include <ctype.h>
+#include "AGILe/FortranWrappers.hh"
+
+
+extern "C" {
+ #define FC_GRAINI FC_FUNC(graini, GRAINI)
+ void FC_GRAINI();
+ #define FC_Steer FC_FUNC(steer, Steer)
+ void FC_Steer();
+ #define FC_RAPGAP FC_FUNC(rapgap, RAPGAP)
+ void FC_RAPGAP();
+ #define FC_rapcha FC_FUNC(rapcha, rapcha)
+ void FC_rapcha();
+ #define FC_HERCHA FC_FUNC(hercha, HERCHA)
+ void FC_HERCHA();
+ #define FC_PYTCHA FC_FUNC(pytcha, PYTCHA)
+ void FC_PYTCHA();
+ #define FC_ARICHA FC_FUNC(aricha, ARICHA)
+ void FC_ARICHA();
+ #define FC_ARINIT FC_FUNC(arinit, ARINIT)
+ void FC_ARINIT(const char *);
+ #define FC_RAEND FC_FUNC(raend, RAEND)
+ void FC_RAEND(int *);
+ #define FC_EVENT FC_FUNC(event, EVENT)
+ void FC_EVENT();
+ #define FC_PTIME FC_FUNC(ptime, PTIME)
+ void FC_PTIME(const char *, int* , int* );
+ // Pythia routines
+ #define FC_PYHEPC FC_FUNC(pyhepc, PYHEPC)
+ void FC_PYHEPC(int*);
+ //#define FC_RM48IN FC_FUNC(rm48in, RM48IN)
+ //void FC_RM48IN(int ISEED, int N1, int N2);
+
+
+}
+
+void call_graini();
+void call_ptime(const char * name, int j, int k);
+void call_steer();
+void call_rapgap();
+void call_rapcha();
+void call_hercha();
+void call_pytcha();
+void call_aricha();
+void call_arinit(const char * name);
+
+// A pythia routine
+void call_pyhepc(int mode);
+
+void call_raend(int i);
+void call_event();
+// This is for setting the random seed
+//void call_rm48in(int ISEED, int N1, int N2);
+#endif
Index: tags/agile-1.2.0/include/AGILe/Rapgap/RapgapWrapper32.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/Rapgap/RapgapWrapper32.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/Rapgap/RapgapWrapper32.hh (revision 755)
@@ -0,0 +1,239 @@
+#ifndef AGILE_RAPGAP_WRAPPER32_HH
+#define AGILE_RAPGAP_WRAPPER32_HH
+
+//////////////////////////////////////////////////////////////////////////
+// Rapgap common block declarations
+// hschulz@physik.hu-berlin.de, February 2010
+// Version 3.202 beta February 2010
+// Wrapper for FORTRAN version of Rapgap
+//////////////////////////////////////////////////////////////////////////
+
+#include <ctype.h>
+#include <cstring>
+#include "AGILe/Rapgap/RapgapWrapper.hh"
+#include "AGILe/FPythia/FPythiaWrapper62.hh"
+
+
+extern "C" {
+ // Functions
+ //
+ // This prints out the cross section
+ //# define FC_RAEND FC_FUNC(raend, RAEND)
+ //void FC_RAEND(void);
+ //# define FC_GRAINI FC_FUNC(graini, GRAINI)
+ //void FC_GRAINI(void);
+
+
+
+ /// Rapgap common block declarations.
+ //Beams (to access info)
+ #define FC_BEAM FC_FUNC(beam, BEAM)
+ extern struct {
+ double PBEAM[2];
+ double KBEAM[2];
+ double PBE1,PBE2;
+ } FC_BEAM;
+
+ // Buchmueller ???
+ #define FC_BUCHMUE FC_FUNC(buchmue, BUCHMUE)
+ extern struct {
+ double C1,Cg;
+ } FC_BUCHMUE;
+
+ // My first attempt, resolved photons, see manual section 4.7
+ #define FC_COLCON FC_FUNC(colcon, COLCON)
+ extern struct {
+ int ICOLORA,IRESPRO,IRPA,IRPB,IRPC,IRPD,IRPE,IRPF,IRPG;
+ } FC_COLCON;
+
+ // Parameters for diffraction
+ #define FC_DIFFR FC_FUNC(diffr, DIFFR)
+ extern struct {
+ double T2MAX,XF,ALPHP,RN2,EPSP,QMI,YMI,QMA,YMA;
+ int NG,NPOM;
+ } FC_DIFFR;
+
+ // Parameters for hard subprocess selection (DIS)
+ #define FC_DISDIF FC_FUNC(disdif, DISDIF)
+ extern struct {
+ int IDIR,IDISIDF;
+ } FC_DISDIF;
+
+ // Parameters for nuber of generation tries...
+ #define FC_EFFIC FC_FUNC(effic, EFFIC)
+ extern struct {
+ double AVGI,SD;
+ int NIN,NOUT;
+ } FC_EFFIC;
+
+ // Parameters for min/max electron scattering angle (degree)
+ #define FC_ELECT FC_FUNC(elect, ELECT)
+ extern struct {
+ double THEMA,THEMI;
+ } FC_ELECT;
+
+ // Parameters for electroweak stuff: sin2thetaWeinberg, M_W^2
+ #define FC_EWEAK FC_FUNC(eweak, EWEAK)
+ extern struct {
+ double SIN2W,MW2;
+ } FC_EWEAK;
+
+ // Parameters for structure function F2 ???
+ #define FC_F2INT FC_FUNC(f2int, F2INT)
+ extern struct {
+ // double ? F2DIS,F2DIS,F2PI;
+ } FC_F2INT;
+
+ // Parameters for bookkeeping inside event record format???
+ #define FC_HARD FC_FUNC(hard, HARD)
+ extern struct {
+ int NFT; // total number of final particles in 2to2 processes
+ int NIA1,NIR1,NIA2,NIR2,NF1,NF2;
+ } FC_HARD;
+
+ // Parameters for process steering
+ #define FC_INPU FC_FUNC(inpu, INPU)
+ extern struct {
+ // int NFRAG,ILEPTO,IHF, ?
+ // not used: ISEMIH
+ double PLEPIN,PIN; //momenta of incoming lepton, proton
+ int LEPI,HADI; // PDGids of incoming particles
+ int IFPS,IALMKT,INTER; // parton shower, inclusion of priordial kt for diff processes, interaction type switch
+ } FC_INPU;
+
+
+ // Parameters for exponential low Q2 suppression (possible tuning parameter)
+ #define FC_LOWQ2 FC_FUNC(lowq2, LOWQ2)
+ extern struct {
+ double Q2SUPP;
+ } FC_LOWQ2;
+
+ // Parameters for
+ #define FC_LUCO FC_FUNC(luco, LUCO)
+ extern struct {
+ int NFLAV,NFLQCDC; //number of active flavours, active flavours for QCD compton effect
+ //int ??? KE,KP,KEP,KPH,KGL,KPA // something about spectators etc.
+ } FC_LUCO;
+
+ // Parameters for accessing information of ???
+ #define FC_MEINFO FC_FUNC(meinfo, MEINFO)
+ extern struct {
+ double ZQGKI,XPGKI,PHIGKI;
+ } FC_MEINFO;
+
+ // Parameters for
+ #define FC_OALPINI FC_FUNC(oalpini, OALPINI)
+ extern struct {
+ int IFULL,IQCDGRID; // Switches for lowest order or quark parton model process, O(a_S) generation on a grid
+ } FC_OALPINI;
+
+ // Parameters for
+ #define FC_PARAE FC_FUNC(parae, PARAE)
+ extern struct {
+ double Q2; // actual Q2 of gammas in lepto-production
+ double Q2Q; // Scale mu^2 of hard scattering in a_S and structure functions
+ // PCM???
+ } FC_PARAE;
+
+ // Parameters for
+ #define FC_PARAM FC_FUNC(param, PARAM)
+ extern struct {
+ double ALPHS,ALPH; // actual a_S, a_em
+ double PI; // well ... pi!
+ //double ? IWEI
+ } FC_PARAM;
+
+ // Parameters for
+ #define FC_PARAT FC_FUNC(parat, PARAT)
+ extern struct {
+ double AM[18]; // vector of final state particle masse
+ double SHAT; // s^hat in hard sub processes
+ double YMAX,YMIN; // upper and lower boundaries for y
+ double QMAX,QMIN; // upper and lower boundaries for Q2 of photons
+ double XMAX,XMIN; // upper and lower boundaries for x
+ } FC_PARAT;
+
+ // Parameters for random seed
+ #define FC_ISEED FC_FUNC(iseed, ISEED)
+ extern struct {
+ int ISEED;
+ } FC_ISEED;
+
+ // Parameters for PTCUT
+ #define FC_PTCUT FC_FUNC(ptcut, PTCUT)
+ extern struct {
+ double PT2CUT[100];
+ } FC_PTCUT;
+
+ // Parameters for run setup
+ #define FC_RAPA FC_FUNC(rapa, RAPA)
+ extern struct {
+ int IPRO;
+ } FC_RAPA;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+ //// Parameters for
+ //#define FC_ FC_FUNC()
+ //extern struct {
+ //} FC_;
+
+
+
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe/HepMCTools.hh
===================================================================
--- tags/agile-1.2.0/include/AGILe/HepMCTools.hh (revision 0)
+++ tags/agile-1.2.0/include/AGILe/HepMCTools.hh (revision 755)
@@ -0,0 +1,36 @@
+// -*- C++ -*-
+#ifndef AGILE_HEPMCTOOLS_HH
+#define AGILE_HEPMCTOOLS_HH
+
+#include "HepMC/GenEvent.h"
+
+namespace AGILe {
+
+
+ inline void fixHepMCUnitsFromGeVmm(HepMC::GenEvent& evt) {
+ #ifdef HEPMC_HAS_UNITS
+ if (evt.momentum_unit() == HepMC::Units::MEV) {
+ for (HepMC::GenEvent::particle_iterator p = evt.particles_begin(); p != evt.particles_end(); ++p) {
+ const HepMC::FourVector fv((*p)->momentum().px() * 1000,
+ (*p)->momentum().py() * 1000,
+ (*p)->momentum().pz() * 1000,
+ (*p)->momentum().e() * 1000);
+ (*p)->set_momentum( fv);
+ }
+ }
+ if (evt.length_unit() == HepMC::Units::CM) {
+ for (HepMC::GenEvent::vertex_iterator vtx = evt.vertices_begin(); vtx != evt.vertices_end(); ++vtx) {
+ const HepMC::FourVector fv((*vtx)->position().x() / 10.,
+ (*vtx)->position().y() / 10.,
+ (*vtx)->position().z() / 10.,
+ (*vtx)->position().t() / 10.);
+ (*vtx)->set_position(fv);
+ }
+ }
+ #endif
+ }
+
+
+}
+
+#endif
Index: tags/agile-1.2.0/include/AGILe
===================================================================
--- tags/agile-1.2.0/include/AGILe (revision 754)
+++ tags/agile-1.2.0/include/AGILe (revision 755)
Property changes on: tags/agile-1.2.0/include/AGILe
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,7 ##
+Makefile.in
+Makefile
+RivetGunConfig.hh.in
+RivetGunConfig.hh
+stamp-h*
+FortranWrappers.hh
+AGILeConfig.*
Index: tags/agile-1.2.0/include/TinyXML/tinyxml.h
===================================================================
--- tags/agile-1.2.0/include/TinyXML/tinyxml.h (revision 0)
+++ tags/agile-1.2.0/include/TinyXML/tinyxml.h (revision 755)
@@ -0,0 +1,1717 @@
+/*
+www.sourceforge.net/projects/tinyxml
+Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com)
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any
+damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any
+purpose, including commercial applications, and to alter it and
+redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must
+not claim that you wrote the original software. If you use this
+software in a product, an acknowledgment in the product documentation
+would be appreciated but is not required.
+
+2. Altered source versions must be plainly marked as such, and
+must not be misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source
+distribution.
+*/
+
+
+#ifndef TINYXML_INCLUDED
+#define TINYXML_INCLUDED
+
+#ifdef _MSC_VER
+#pragma warning( push )
+#pragma warning( disable : 4530 )
+#pragma warning( disable : 4786 )
+#endif
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+// Help out windows:
+#if defined( _DEBUG ) && !defined( DEBUG )
+#define DEBUG
+#endif
+
+#include <string>
+#include <iostream>
+#include <sstream>
+#define TIXML_STRING std::string
+
+
+// Deprecated library function hell. Compilers want to use the
+// new safe versions. This probably doesn't fully address the problem,
+// but it gets closer. There are too many compilers for me to fully
+// test. If you get compilation troubles, undefine TIXML_SAFE
+#define TIXML_SAFE
+
+#ifdef TIXML_SAFE
+ #if defined(_MSC_VER) && (_MSC_VER >= 1400 )
+ // Microsoft visual studio, version 2005 and higher.
+ #define TIXML_SNPRINTF _snprintf_s
+ #define TIXML_SNSCANF _snscanf_s
+ #elif defined(_MSC_VER) && (_MSC_VER >= 1200 )
+ // Microsoft visual studio, version 6 and higher.
+ //#pragma message( "Using _sn* functions." )
+ #define TIXML_SNPRINTF _snprintf
+ #define TIXML_SNSCANF _snscanf
+ #elif defined(__GNUC__) && (__GNUC__ >= 3 )
+ // GCC version 3 and higher.s
+ //#warning( "Using sn* functions." )
+ #define TIXML_SNPRINTF snprintf
+ #define TIXML_SNSCANF snscanf
+ #endif
+#endif
+
+class TiXmlDocument;
+class TiXmlElement;
+class TiXmlComment;
+class TiXmlUnknown;
+class TiXmlAttribute;
+class TiXmlText;
+class TiXmlDeclaration;
+class TiXmlParsingData;
+
+const int TIXML_MAJOR_VERSION = 2;
+const int TIXML_MINOR_VERSION = 5;
+const int TIXML_PATCH_VERSION = 2;
+
+/* Internal structure for tracking location of items
+ in the XML file.
+*/
+struct TiXmlCursor
+{
+ TiXmlCursor() { Clear(); }
+ void Clear() { row = col = -1; }
+
+ int row; // 0 based.
+ int col; // 0 based.
+};
+
+
+/**
+ If you call the Accept() method, it requires being passed a TiXmlVisitor
+ class to handle callbacks. For nodes that contain other nodes (Document, Element)
+ you will get called with a VisitEnter/VisitExit pair. Nodes that are always leaves
+ are simple called with Visit().
+
+ If you return 'true' from a Visit method, recursive parsing will continue. If you return
+ false, <b>no children of this node or its sibilings</b> will be Visited.
+
+ All flavors of Visit methods have a default implementation that returns 'true' (continue
+ visiting). You need to only override methods that are interesting to you.
+
+ Generally Accept() is called on the TiXmlDocument, although all nodes suppert Visiting.
+
+ You should never change the document from a callback.
+
+ @sa TiXmlNode::Accept()
+*/
+class TiXmlVisitor
+{
+public:
+ virtual ~TiXmlVisitor() {}
+
+ /// Visit a document.
+ virtual bool VisitEnter( const TiXmlDocument& doc ) { return true; }
+ /// Visit a document.
+ virtual bool VisitExit( const TiXmlDocument& doc ) { return true; }
+
+ /// Visit an element.
+ virtual bool VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute ) { return true; }
+ /// Visit an element.
+ virtual bool VisitExit( const TiXmlElement& element ) { return true; }
+
+ /// Visit a declaration
+ virtual bool Visit( const TiXmlDeclaration& declaration ) { return true; }
+ /// Visit a text node
+ virtual bool Visit( const TiXmlText& text ) { return true; }
+ /// Visit a comment node
+ virtual bool Visit( const TiXmlComment& comment ) { return true; }
+ /// Visit an unknow node
+ virtual bool Visit( const TiXmlUnknown& unknown ) { return true; }
+};
+
+// Only used by Attribute::Query functions
+enum
+{
+ TIXML_SUCCESS,
+ TIXML_NO_ATTRIBUTE,
+ TIXML_WRONG_TYPE
+};
+
+
+// Used by the parsing routines.
+enum TiXmlEncoding
+{
+ TIXML_ENCODING_UNKNOWN,
+ TIXML_ENCODING_UTF8,
+ TIXML_ENCODING_LEGACY
+};
+
+const TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN;
+
+/** TiXmlBase is a base class for every class in TinyXml.
+ It does little except to establish that TinyXml classes
+ can be printed and provide some utility functions.
+
+ In XML, the document and elements can contain
+ other elements and other types of nodes.
+
+ @verbatim
+ A Document can contain: Element (container or leaf)
+ Comment (leaf)
+ Unknown (leaf)
+ Declaration( leaf )
+
+ An Element can contain: Element (container or leaf)
+ Text (leaf)
+ Attributes (not on tree)
+ Comment (leaf)
+ Unknown (leaf)
+
+ A Decleration contains: Attributes (not on tree)
+ @endverbatim
+*/
+class TiXmlBase
+{
+ friend class TiXmlNode;
+ friend class TiXmlElement;
+ friend class TiXmlDocument;
+
+public:
+ TiXmlBase() : userData(0) {}
+ virtual ~TiXmlBase() {}
+
+ /** All TinyXml classes can print themselves to a filestream
+ or the string class (TiXmlString in non-STL mode, std::string
+ in STL mode.) Either or both cfile and str can be null.
+
+ This is a formatted print, and will insert
+ tabs and newlines.
+
+ (For an unformatted stream, use the << operator.)
+ */
+ virtual void Print( FILE* cfile, int depth ) const = 0;
+
+ /** The world does not agree on whether white space should be kept or
+ not. In order to make everyone happy, these global, static functions
+ are provided to set whether or not TinyXml will condense all white space
+ into a single space or not. The default is to condense. Note changing this
+ value is not thread safe.
+ */
+ static void SetCondenseWhiteSpace( bool condense ) { condenseWhiteSpace = condense; }
+
+ /// Return the current white space setting.
+ static bool IsWhiteSpaceCondensed() { return condenseWhiteSpace; }
+
+ /** Return the position, in the original source file, of this node or attribute.
+ The row and column are 1-based. (That is the first row and first column is
+ 1,1). If the returns values are 0 or less, then the parser does not have
+ a row and column value.
+
+ Generally, the row and column value will be set when the TiXmlDocument::Load(),
+ TiXmlDocument::LoadFile(), or any TiXmlNode::Parse() is called. It will NOT be set
+ when the DOM was created from operator>>.
+
+ The values reflect the initial load. Once the DOM is modified programmatically
+ (by adding or changing nodes and attributes) the new values will NOT update to
+ reflect changes in the document.
+
+ There is a minor performance cost to computing the row and column. Computation
+ can be disabled if TiXmlDocument::SetTabSize() is called with 0 as the value.
+
+ @sa TiXmlDocument::SetTabSize()
+ */
+ int Row() const { return location.row + 1; }
+ int Column() const { return location.col + 1; } ///< See Row()
+
+ void SetUserData( void* user ) { userData = user; } ///< Set a pointer to arbitrary user data.
+ void* GetUserData() { return userData; } ///< Get a pointer to arbitrary user data.
+ const void* GetUserData() const { return userData; } ///< Get a pointer to arbitrary user data.
+
+ // Table that returs, for a given lead byte, the total number of bytes
+ // in the UTF-8 sequence.
+ static const int utf8ByteTable[256];
+
+ virtual const char* Parse( const char* p,
+ TiXmlParsingData* data,
+ TiXmlEncoding encoding /*= TIXML_ENCODING_UNKNOWN */ ) = 0;
+
+ enum
+ {
+ TIXML_NO_ERROR = 0,
+ TIXML_ERROR,
+ TIXML_ERROR_OPENING_FILE,
+ TIXML_ERROR_OUT_OF_MEMORY,
+ TIXML_ERROR_PARSING_ELEMENT,
+ TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME,
+ TIXML_ERROR_READING_ELEMENT_VALUE,
+ TIXML_ERROR_READING_ATTRIBUTES,
+ TIXML_ERROR_PARSING_EMPTY,
+ TIXML_ERROR_READING_END_TAG,
+ TIXML_ERROR_PARSING_UNKNOWN,
+ TIXML_ERROR_PARSING_COMMENT,
+ TIXML_ERROR_PARSING_DECLARATION,
+ TIXML_ERROR_DOCUMENT_EMPTY,
+ TIXML_ERROR_EMBEDDED_NULL,
+ TIXML_ERROR_PARSING_CDATA,
+ TIXML_ERROR_DOCUMENT_TOP_ONLY,
+
+ TIXML_ERROR_STRING_COUNT
+ };
+
+protected:
+
+ static const char* SkipWhiteSpace( const char*, TiXmlEncoding encoding );
+ inline static bool IsWhiteSpace( char c )
+ {
+ return ( isspace( (unsigned char) c ) || c == '\n' || c == '\r' );
+ }
+ inline static bool IsWhiteSpace( int c )
+ {
+ if ( c < 256 )
+ return IsWhiteSpace( (char) c );
+ return false; // Again, only truly correct for English/Latin...but usually works.
+ }
+
+ static bool StreamWhiteSpace( std::istream * in, TIXML_STRING * tag );
+ static bool StreamTo( std::istream * in, int character, TIXML_STRING * tag );
+
+ /* Reads an XML name into the string provided. Returns
+ a pointer just past the last character of the name,
+ or 0 if the function has an error.
+ */
+ static const char* ReadName( const char* p, TIXML_STRING* name, TiXmlEncoding encoding );
+
+ /* Reads text. Returns a pointer past the given end tag.
+ Wickedly complex options, but it keeps the (sensitive) code in one place.
+ */
+ static const char* ReadText( const char* in, // where to start
+ TIXML_STRING* text, // the string read
+ bool ignoreWhiteSpace, // whether to keep the white space
+ const char* endTag, // what ends this text
+ bool ignoreCase, // whether to ignore case in the end tag
+ TiXmlEncoding encoding ); // the current encoding
+
+ // If an entity has been found, transform it into a character.
+ static const char* GetEntity( const char* in, char* value, int* length, TiXmlEncoding encoding );
+
+ // Get a character, while interpreting entities.
+ // The length can be from 0 to 4 bytes.
+ inline static const char* GetChar( const char* p, char* _value, int* length, TiXmlEncoding encoding )
+ {
+ assert( p );
+ if ( encoding == TIXML_ENCODING_UTF8 )
+ {
+ *length = utf8ByteTable[ *((const unsigned char*)p) ];
+ assert( *length >= 0 && *length < 5 );
+ }
+ else
+ {
+ *length = 1;
+ }
+
+ if ( *length == 1 )
+ {
+ if ( *p == '&' )
+ return GetEntity( p, _value, length, encoding );
+ *_value = *p;
+ return p+1;
+ }
+ else if ( *length )
+ {
+ //strncpy( _value, p, *length ); // lots of compilers don't like this function (unsafe),
+ // and the null terminator isn't needed
+ for( int i=0; p[i] && i<*length; ++i ) {
+ _value[i] = p[i];
+ }
+ return p + (*length);
+ }
+ else
+ {
+ // Not valid text.
+ return 0;
+ }
+ }
+
+ // Puts a string to a stream, expanding entities as it goes.
+ // Note this should not contian the '<', '>', etc, or they will be transformed into entities!
+ static void PutString( const TIXML_STRING& str, TIXML_STRING* out );
+
+ // Return true if the next characters in the stream are any of the endTag sequences.
+ // Ignore case only works for english, and should only be relied on when comparing
+ // to English words: StringEqual( p, "version", true ) is fine.
+ static bool StringEqual( const char* p,
+ const char* endTag,
+ bool ignoreCase,
+ TiXmlEncoding encoding );
+
+ static const char* errorString[ TIXML_ERROR_STRING_COUNT ];
+
+ TiXmlCursor location;
+
+ /// Field containing a generic user pointer
+ void* userData;
+
+ // None of these methods are reliable for any language except English.
+ // Good for approximation, not great for accuracy.
+ static int IsAlpha( unsigned char anyByte, TiXmlEncoding encoding );
+ static int IsAlphaNum( unsigned char anyByte, TiXmlEncoding encoding );
+ inline static int ToLower( int v, TiXmlEncoding encoding )
+ {
+ if ( encoding == TIXML_ENCODING_UTF8 )
+ {
+ if ( v < 128 ) return tolower( v );
+ return v;
+ }
+ else
+ {
+ return tolower( v );
+ }
+ }
+ static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length );
+
+private:
+ TiXmlBase( const TiXmlBase& ); // not implemented.
+ void operator=( const TiXmlBase& base ); // not allowed.
+
+ struct Entity
+ {
+ const char* str;
+ unsigned int strLength;
+ char chr;
+ };
+ enum
+ {
+ NUM_ENTITY = 5,
+ MAX_ENTITY_LENGTH = 6
+
+ };
+ static Entity entity[ NUM_ENTITY ];
+ static bool condenseWhiteSpace;
+};
+
+
+/** The parent class for everything in the Document Object Model.
+ (Except for attributes).
+ Nodes have siblings, a parent, and children. A node can be
+ in a document, or stand on its own. The type of a TiXmlNode
+ can be queried, and it can be cast to its more defined type.
+*/
+class TiXmlNode : public TiXmlBase
+{
+ friend class TiXmlDocument;
+ friend class TiXmlElement;
+
+public:
+
+ /** An input stream operator, for every class. Tolerant of newlines and
+ formatting, but doesn't expect them.
+ */
+ friend std::istream& operator >> (std::istream& in, TiXmlNode& base);
+
+ /** An output stream operator, for every class. Note that this outputs
+ without any newlines or formatting, as opposed to Print(), which
+ includes tabs and new lines.
+
+ The operator<< and operator>> are not completely symmetric. Writing
+ a node to a stream is very well defined. You'll get a nice stream
+ of output, without any extra whitespace or newlines.
+
+ But reading is not as well defined. (As it always is.) If you create
+ a TiXmlElement (for example) and read that from an input stream,
+ the text needs to define an element or junk will result. This is
+ true of all input streams, but it's worth keeping in mind.
+
+ A TiXmlDocument will read nodes until it reads a root element, and
+ all the children of that root element.
+ */
+ friend std::ostream& operator<< (std::ostream& out, const TiXmlNode& base);
+
+ /// Appends the XML node or attribute to a std::string.
+ friend std::string& operator<< (std::string& out, const TiXmlNode& base );
+
+
+ /** The types of XML nodes supported by TinyXml. (All the
+ unsupported types are picked up by UNKNOWN.)
+ */
+ enum NodeType
+ {
+ DOCUMENT,
+ ELEMENT,
+ COMMENT,
+ UNKNOWN,
+ TEXT,
+ DECLARATION,
+ TYPECOUNT
+ };
+
+ virtual ~TiXmlNode();
+
+ /** The meaning of 'value' changes for the specific type of
+ TiXmlNode.
+ @verbatim
+ Document: filename of the xml file
+ Element: name of the element
+ Comment: the comment text
+ Unknown: the tag contents
+ Text: the text string
+ @endverbatim
+
+ The subclasses will wrap this function.
+ */
+ const char *Value() const { return value.c_str (); }
+
+ /** Return Value() as a std::string. If you only use STL,
+ this is more efficient than calling Value().
+ Only available in STL mode.
+ */
+ const std::string& ValueStr() const { return value; }
+
+ /** Changes the value of the node. Defined as:
+ @verbatim
+ Document: filename of the xml file
+ Element: name of the element
+ Comment: the comment text
+ Unknown: the tag contents
+ Text: the text string
+ @endverbatim
+ */
+ void SetValue(const char * _value) { value = _value;}
+
+ /// STL std::string form.
+ void SetValue( const std::string& _value ) { value = _value; }
+
+ /// Delete all the children of this node. Does not affect 'this'.
+ void Clear();
+
+ /// One step up the DOM.
+ TiXmlNode* Parent() { return parent; }
+ const TiXmlNode* Parent() const { return parent; }
+
+ const TiXmlNode* FirstChild() const { return firstChild; } ///< The first child of this node. Will be null if there are no children.
+ TiXmlNode* FirstChild() { return firstChild; }
+ const TiXmlNode* FirstChild( const char * value ) const; ///< The first child of this node with the matching 'value'. Will be null if none found.
+ /// The first child of this node with the matching 'value'. Will be null if none found.
+ TiXmlNode* FirstChild( const char * _value ) {
+ // Call through to the const version - safe since nothing is changed. Exiting syntax: cast this to a const (always safe)
+ // call the method, cast the return back to non-const.
+ return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->FirstChild( _value ));
+ }
+ const TiXmlNode* LastChild() const { return lastChild; } /// The last child of this node. Will be null if there are no children.
+ TiXmlNode* LastChild() { return lastChild; }
+
+ const TiXmlNode* LastChild( const char * value ) const; /// The last child of this node matching 'value'. Will be null if there are no children.
+ TiXmlNode* LastChild( const char * _value ) {
+ return const_cast< TiXmlNode* > ((const_cast< const TiXmlNode* >(this))->LastChild( _value ));
+ }
+
+ const TiXmlNode* FirstChild( const std::string& _value ) const { return FirstChild (_value.c_str ()); } ///< STL std::string form.
+ TiXmlNode* FirstChild( const std::string& _value ) { return FirstChild (_value.c_str ()); } ///< STL std::string form.
+ const TiXmlNode* LastChild( const std::string& _value ) const { return LastChild (_value.c_str ()); } ///< STL std::string form.
+ TiXmlNode* LastChild( const std::string& _value ) { return LastChild (_value.c_str ()); } ///< STL std::string form.
+
+ /** An alternate way to walk the children of a node.
+ One way to iterate over nodes is:
+ @verbatim
+ for( child = parent->FirstChild(); child; child = child->NextSibling() )
+ @endverbatim
+
+ IterateChildren does the same thing with the syntax:
+ @verbatim
+ child = 0;
+ while( child = parent->IterateChildren( child ) )
+ @endverbatim
+
+ IterateChildren takes the previous child as input and finds
+ the next one. If the previous child is null, it returns the
+ first. IterateChildren will return null when done.
+ */
+ const TiXmlNode* IterateChildren( const TiXmlNode* previous ) const;
+ TiXmlNode* IterateChildren( const TiXmlNode* previous ) {
+ return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( previous ) );
+ }
+
+ /// This flavor of IterateChildren searches for children with a particular 'value'
+ const TiXmlNode* IterateChildren( const char * value, const TiXmlNode* previous ) const;
+ TiXmlNode* IterateChildren( const char * _value, const TiXmlNode* previous ) {
+ return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->IterateChildren( _value, previous ) );
+ }
+
+ const TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) const { return IterateChildren (_value.c_str (), previous); } ///< STL std::string form.
+ TiXmlNode* IterateChildren( const std::string& _value, const TiXmlNode* previous ) { return IterateChildren (_value.c_str (), previous); } ///< STL std::string form.
+
+ /** Add a new node related to this. Adds a child past the LastChild.
+ Returns a pointer to the new object or NULL if an error occured.
+ */
+ TiXmlNode* InsertEndChild( const TiXmlNode& addThis );
+
+
+ /** Add a new node related to this. Adds a child past the LastChild.
+
+ NOTE: the node to be added is passed by pointer, and will be
+ henceforth owned (and deleted) by tinyXml. This method is efficient
+ and avoids an extra copy, but should be used with care as it
+ uses a different memory model than the other insert functions.
+
+ @sa InsertEndChild
+ */
+ TiXmlNode* LinkEndChild( TiXmlNode* addThis );
+
+ /** Add a new node related to this. Adds a child before the specified child.
+ Returns a pointer to the new object or NULL if an error occured.
+ */
+ TiXmlNode* InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis );
+
+ /** Add a new node related to this. Adds a child after the specified child.
+ Returns a pointer to the new object or NULL if an error occured.
+ */
+ TiXmlNode* InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis );
+
+ /** Replace a child of this node.
+ Returns a pointer to the new object or NULL if an error occured.
+ */
+ TiXmlNode* ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis );
+
+ /// Delete a child of this node.
+ bool RemoveChild( TiXmlNode* removeThis );
+
+ /// Navigate to a sibling node.
+ const TiXmlNode* PreviousSibling() const { return prev; }
+ TiXmlNode* PreviousSibling() { return prev; }
+
+ /// Navigate to a sibling node.
+ const TiXmlNode* PreviousSibling( const char * ) const;
+ TiXmlNode* PreviousSibling( const char *_prev ) {
+ return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->PreviousSibling( _prev ) );
+ }
+
+ const TiXmlNode* PreviousSibling( const std::string& _value ) const { return PreviousSibling (_value.c_str ()); } ///< STL std::string form.
+ TiXmlNode* PreviousSibling( const std::string& _value ) { return PreviousSibling (_value.c_str ()); } ///< STL std::string form.
+ const TiXmlNode* NextSibling( const std::string& _value) const { return NextSibling (_value.c_str ()); } ///< STL std::string form.
+ TiXmlNode* NextSibling( const std::string& _value) { return NextSibling (_value.c_str ()); } ///< STL std::string form.
+
+ /// Navigate to a sibling node.
+ const TiXmlNode* NextSibling() const { return next; }
+ TiXmlNode* NextSibling() { return next; }
+
+ /// Navigate to a sibling node with the given 'value'.
+ const TiXmlNode* NextSibling( const char * ) const;
+ TiXmlNode* NextSibling( const char* _next ) {
+ return const_cast< TiXmlNode* >( (const_cast< const TiXmlNode* >(this))->NextSibling( _next ) );
+ }
+
+ /** Convenience function to get through elements.
+ Calls NextSibling and ToElement. Will skip all non-Element
+ nodes. Returns 0 if there is not another element.
+ */
+ const TiXmlElement* NextSiblingElement() const;
+ TiXmlElement* NextSiblingElement() {
+ return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement() );
+ }
+
+ /** Convenience function to get through elements.
+ Calls NextSibling and ToElement. Will skip all non-Element
+ nodes. Returns 0 if there is not another element.
+ */
+ const TiXmlElement* NextSiblingElement( const char * ) const;
+ TiXmlElement* NextSiblingElement( const char *_next ) {
+ return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->NextSiblingElement( _next ) );
+ }
+
+ const TiXmlElement* NextSiblingElement( const std::string& _value) const { return NextSiblingElement (_value.c_str ()); } ///< STL std::string form.
+ TiXmlElement* NextSiblingElement( const std::string& _value) { return NextSiblingElement (_value.c_str ()); } ///< STL std::string form.
+
+ /// Convenience function to get through elements.
+ const TiXmlElement* FirstChildElement() const;
+ TiXmlElement* FirstChildElement() {
+ return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement() );
+ }
+
+ /// Convenience function to get through elements.
+ const TiXmlElement* FirstChildElement( const char * _value ) const;
+ TiXmlElement* FirstChildElement( const char * _value ) {
+ return const_cast< TiXmlElement* >( (const_cast< const TiXmlNode* >(this))->FirstChildElement( _value ) );
+ }
+
+ const TiXmlElement* FirstChildElement( const std::string& _value ) const { return FirstChildElement (_value.c_str ()); } ///< STL std::string form.
+ TiXmlElement* FirstChildElement( const std::string& _value ) { return FirstChildElement (_value.c_str ()); } ///< STL std::string form.
+
+ /** Query the type (as an enumerated value, above) of this node.
+ The possible types are: DOCUMENT, ELEMENT, COMMENT,
+ UNKNOWN, TEXT, and DECLARATION.
+ */
+ int Type() const { return type; }
+
+ /** Return a pointer to the Document this node lives in.
+ Returns null if not in a document.
+ */
+ const TiXmlDocument* GetDocument() const;
+ TiXmlDocument* GetDocument() {
+ return const_cast< TiXmlDocument* >( (const_cast< const TiXmlNode* >(this))->GetDocument() );
+ }
+
+ /// Returns true if this node has no children.
+ bool NoChildren() const { return !firstChild; }
+
+ virtual const TiXmlDocument* ToDocument() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual const TiXmlElement* ToElement() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual const TiXmlComment* ToComment() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual const TiXmlUnknown* ToUnknown() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual const TiXmlText* ToText() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual const TiXmlDeclaration* ToDeclaration() const { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+
+ virtual TiXmlDocument* ToDocument() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual TiXmlElement* ToElement() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual TiXmlComment* ToComment() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual TiXmlUnknown* ToUnknown() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual TiXmlText* ToText() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+ virtual TiXmlDeclaration* ToDeclaration() { return 0; } ///< Cast to a more defined type. Will return null if not of the requested type.
+
+ /** Create an exact duplicate of this node and return it. The memory must be deleted
+ by the caller.
+ */
+ virtual TiXmlNode* Clone() const = 0;
+
+ /** Accept a hierchical visit the nodes in the TinyXML DOM. Every node in the
+ XML tree will be conditionally visited and the host will be called back
+ via the TiXmlVisitor interface.
+
+ This is essentially a SAX interface for TinyXML. (Note however it doesn't re-parse
+ the XML for the callbacks, so the performance of TinyXML is unchanged by using this
+ interface versus any other.)
+
+ The interface has been based on ideas from:
+
+ - http://www.saxproject.org/
+ - http://c2.com/cgi/wiki?HierarchicalVisitorPattern
+
+ Which are both good references for "visiting".
+
+ An example of using Accept():
+ @verbatim
+ TiXmlPrinter printer;
+ tinyxmlDoc.Accept( &printer );
+ const char* xmlcstr = printer.CStr();
+ @endverbatim
+ */
+ virtual bool Accept( TiXmlVisitor* visitor ) const = 0;
+
+protected:
+ TiXmlNode( NodeType _type );
+
+ // Copy to the allocated object. Shared functionality between Clone, Copy constructor,
+ // and the assignment operator.
+ void CopyTo( TiXmlNode* target ) const;
+
+ // The real work of the input operator.
+ virtual void StreamIn( std::istream* in, TIXML_STRING* tag ) = 0;
+
+ // Figure out what is at *p, and parse it. Returns null if it is not an xml node.
+ TiXmlNode* Identify( const char* start, TiXmlEncoding encoding );
+
+ TiXmlNode* parent;
+ NodeType type;
+
+ TiXmlNode* firstChild;
+ TiXmlNode* lastChild;
+
+ TIXML_STRING value;
+
+ TiXmlNode* prev;
+ TiXmlNode* next;
+
+private:
+ TiXmlNode( const TiXmlNode& ); // not implemented.
+ void operator=( const TiXmlNode& base ); // not allowed.
+};
+
+
+/** An attribute is a name-value pair. Elements have an arbitrary
+ number of attributes, each with a unique name.
+
+ @note The attributes are not TiXmlNodes, since they are not
+ part of the tinyXML document object model. There are other
+ suggested ways to look at this problem.
+*/
+class TiXmlAttribute : public TiXmlBase
+{
+ friend class TiXmlAttributeSet;
+
+public:
+ /// Construct an empty attribute.
+ TiXmlAttribute() : TiXmlBase()
+ {
+ document = 0;
+ prev = next = 0;
+ }
+
+ /// std::string constructor.
+ TiXmlAttribute( const std::string& _name, const std::string& _value )
+ {
+ name = _name;
+ value = _value;
+ document = 0;
+ prev = next = 0;
+ }
+
+ /// Construct an attribute with a name and value.
+ TiXmlAttribute( const char * _name, const char * _value )
+ {
+ name = _name;
+ value = _value;
+ document = 0;
+ prev = next = 0;
+ }
+
+ const char* Name() const { return name.c_str(); } ///< Return the name of this attribute.
+ const char* Value() const { return value.c_str(); } ///< Return the value of this attribute.
+
+ const std::string& ValueStr() const { return value; } ///< Return the value of this attribute.
+
+ int IntValue() const; ///< Return the value of this attribute, converted to an integer.
+ double DoubleValue() const; ///< Return the value of this attribute, converted to a double.
+
+ // Get the tinyxml string representation
+ const TIXML_STRING& NameTStr() const { return name; }
+
+ /** QueryIntValue examines the value string. It is an alternative to the
+ IntValue() method with richer error checking.
+ If the value is an integer, it is stored in 'value' and
+ the call returns TIXML_SUCCESS. If it is not
+ an integer, it returns TIXML_WRONG_TYPE.
+
+ A specialized but useful call. Note that for success it returns 0,
+ which is the opposite of almost all other TinyXml calls.
+ */
+ int QueryIntValue( int* _value ) const;
+ /// QueryDoubleValue examines the value string. See QueryIntValue().
+ int QueryDoubleValue( double* _value ) const;
+
+ void SetName( const char* _name ) { name = _name; } ///< Set the name of this attribute.
+ void SetValue( const char* _value ) { value = _value; } ///< Set the value.
+
+ void SetIntValue( int _value ); ///< Set the value from an integer.
+ void SetDoubleValue( double _value ); ///< Set the value from a double.
+
+ /// STL std::string form.
+ void SetName( const std::string& _name ) { name = _name; }
+ /// STL std::string form.
+ void SetValue( const std::string& _value ) { value = _value; }
+
+ /// Get the next sibling attribute in the DOM. Returns null at end.
+ const TiXmlAttribute* Next() const;
+ TiXmlAttribute* Next() {
+ return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Next() );
+ }
+
+ /// Get the previous sibling attribute in the DOM. Returns null at beginning.
+ const TiXmlAttribute* Previous() const;
+ TiXmlAttribute* Previous() {
+ return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttribute* >(this))->Previous() );
+ }
+
+ bool operator==( const TiXmlAttribute& rhs ) const { return rhs.name == name; }
+ bool operator<( const TiXmlAttribute& rhs ) const { return name < rhs.name; }
+ bool operator>( const TiXmlAttribute& rhs ) const { return name > rhs.name; }
+
+ /* Attribute parsing starts: first letter of the name
+ returns: the next char after the value end quote
+ */
+ virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
+
+ // Prints this Attribute to a FILE stream.
+ virtual void Print( FILE* cfile, int depth ) const {
+ Print( cfile, depth, 0 );
+ }
+ void Print( FILE* cfile, int depth, TIXML_STRING* str ) const;
+
+ // [internal use]
+ // Set the document pointer so the attribute can report errors.
+ void SetDocument( TiXmlDocument* doc ) { document = doc; }
+
+private:
+ TiXmlAttribute( const TiXmlAttribute& ); // not implemented.
+ void operator=( const TiXmlAttribute& base ); // not allowed.
+
+ TiXmlDocument* document; // A pointer back to a document, for error reporting.
+ TIXML_STRING name;
+ TIXML_STRING value;
+ TiXmlAttribute* prev;
+ TiXmlAttribute* next;
+};
+
+
+/* A class used to manage a group of attributes.
+ It is only used internally, both by the ELEMENT and the DECLARATION.
+
+ The set can be changed transparent to the Element and Declaration
+ classes that use it, but NOT transparent to the Attribute
+ which has to implement a next() and previous() method. Which makes
+ it a bit problematic and prevents the use of STL.
+
+ This version is implemented with circular lists because:
+ - I like circular lists
+ - it demonstrates some independence from the (typical) doubly linked list.
+*/
+class TiXmlAttributeSet
+{
+public:
+ TiXmlAttributeSet();
+ ~TiXmlAttributeSet();
+
+ void Add( TiXmlAttribute* attribute );
+ void Remove( TiXmlAttribute* attribute );
+
+ const TiXmlAttribute* First() const { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
+ TiXmlAttribute* First() { return ( sentinel.next == &sentinel ) ? 0 : sentinel.next; }
+ const TiXmlAttribute* Last() const { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
+ TiXmlAttribute* Last() { return ( sentinel.prev == &sentinel ) ? 0 : sentinel.prev; }
+
+ const TiXmlAttribute* Find( const char* _name ) const;
+ TiXmlAttribute* Find( const char* _name ) {
+ return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) );
+ }
+ const TiXmlAttribute* Find( const std::string& _name ) const;
+ TiXmlAttribute* Find( const std::string& _name ) {
+ return const_cast< TiXmlAttribute* >( (const_cast< const TiXmlAttributeSet* >(this))->Find( _name ) );
+ }
+
+
+private:
+ //*ME: Because of hidden/disabled copy-construktor in TiXmlAttribute (sentinel-element),
+ //*ME: this class must be also use a hidden/disabled copy-constructor !!!
+ TiXmlAttributeSet( const TiXmlAttributeSet& ); // not allowed
+ void operator=( const TiXmlAttributeSet& ); // not allowed (as TiXmlAttribute)
+
+ TiXmlAttribute sentinel;
+};
+
+
+/** The element is a container class. It has a value, the element name,
+ and can contain other elements, text, comments, and unknowns.
+ Elements also contain an arbitrary number of attributes.
+*/
+class TiXmlElement : public TiXmlNode
+{
+public:
+ /// Construct an element.
+ TiXmlElement (const char * in_value);
+
+ /// std::string constructor.
+ TiXmlElement( const std::string& _value );
+
+ TiXmlElement( const TiXmlElement& );
+
+ void operator=( const TiXmlElement& base );
+
+ virtual ~TiXmlElement();
+
+ /** Given an attribute name, Attribute() returns the value
+ for the attribute of that name, or null if none exists.
+ */
+ const char* Attribute( const char* name ) const;
+
+ /** Given an attribute name, Attribute() returns the value
+ for the attribute of that name, or null if none exists.
+ If the attribute exists and can be converted to an integer,
+ the integer value will be put in the return 'i', if 'i'
+ is non-null.
+ */
+ const char* Attribute( const char* name, int* i ) const;
+
+ /** Given an attribute name, Attribute() returns the value
+ for the attribute of that name, or null if none exists.
+ If the attribute exists and can be converted to an double,
+ the double value will be put in the return 'd', if 'd'
+ is non-null.
+ */
+ const char* Attribute( const char* name, double* d ) const;
+
+ /** QueryIntAttribute examines the attribute - it is an alternative to the
+ Attribute() method with richer error checking.
+ If the attribute is an integer, it is stored in 'value' and
+ the call returns TIXML_SUCCESS. If it is not
+ an integer, it returns TIXML_WRONG_TYPE. If the attribute
+ does not exist, then TIXML_NO_ATTRIBUTE is returned.
+ */
+ int QueryIntAttribute( const char* name, int* _value ) const;
+ /// QueryDoubleAttribute examines the attribute - see QueryIntAttribute().
+ int QueryDoubleAttribute( const char* name, double* _value ) const;
+ /// QueryFloatAttribute examines the attribute - see QueryIntAttribute().
+ int QueryFloatAttribute( const char* name, float* _value ) const {
+ double d;
+ int result = QueryDoubleAttribute( name, &d );
+ if ( result == TIXML_SUCCESS ) {
+ *_value = (float)d;
+ }
+ return result;
+ }
+
+ /** Template form of the attribute query which will try to read the
+ attribute into the specified type. Very easy, very powerful, but
+ be careful to make sure to call this with the correct type.
+
+ @return TIXML_SUCCESS, TIXML_WRONG_TYPE, or TIXML_NO_ATTRIBUTE
+ */
+ template< typename T > int QueryValueAttribute( const std::string& name, T* outValue ) const
+ {
+ const TiXmlAttribute* node = attributeSet.Find( name );
+ if ( !node )
+ return TIXML_NO_ATTRIBUTE;
+
+ std::stringstream sstream( node->ValueStr() );
+ sstream >> *outValue;
+ if ( !sstream.fail() )
+ return TIXML_SUCCESS;
+ return TIXML_WRONG_TYPE;
+ }
+
+ /** Sets an attribute of name to a given value. The attribute
+ will be created if it does not exist, or changed if it does.
+ */
+ void SetAttribute( const char* name, const char * _value );
+
+ const std::string* Attribute( const std::string& name ) const;
+ const std::string* Attribute( const std::string& name, int* i ) const;
+ const std::string* Attribute( const std::string& name, double* d ) const;
+ int QueryIntAttribute( const std::string& name, int* _value ) const;
+ int QueryDoubleAttribute( const std::string& name, double* _value ) const;
+
+ /// STL std::string form.
+ void SetAttribute( const std::string& name, const std::string& _value );
+ ///< STL std::string form.
+ void SetAttribute( const std::string& name, int _value );
+
+ /** Sets an attribute of name to a given value. The attribute
+ will be created if it does not exist, or changed if it does.
+ */
+ void SetAttribute( const char * name, int value );
+
+ /** Sets an attribute of name to a given value. The attribute
+ will be created if it does not exist, or changed if it does.
+ */
+ void SetDoubleAttribute( const char * name, double value );
+
+ /** Deletes an attribute with the given name.
+ */
+ void RemoveAttribute( const char * name );
+ void RemoveAttribute( const std::string& name ) { RemoveAttribute (name.c_str ()); } ///< STL std::string form.
+
+ const TiXmlAttribute* FirstAttribute() const { return attributeSet.First(); } ///< Access the first attribute in this element.
+ TiXmlAttribute* FirstAttribute() { return attributeSet.First(); }
+ const TiXmlAttribute* LastAttribute() const { return attributeSet.Last(); } ///< Access the last attribute in this element.
+ TiXmlAttribute* LastAttribute() { return attributeSet.Last(); }
+
+ /** Convenience function for easy access to the text inside an element. Although easy
+ and concise, GetText() is limited compared to getting the TiXmlText child
+ and accessing it directly.
+
+ If the first child of 'this' is a TiXmlText, the GetText()
+ returns the character string of the Text node, else null is returned.
+
+ This is a convenient method for getting the text of simple contained text:
+ @verbatim
+ <foo>This is text</foo>
+ const char* str = fooElement->GetText();
+ @endverbatim
+
+ 'str' will be a pointer to "This is text".
+
+ Note that this function can be misleading. If the element foo was created from
+ this XML:
+ @verbatim
+ <foo><b>This is text</b></foo>
+ @endverbatim
+
+ then the value of str would be null. The first child node isn't a text node, it is
+ another element. From this XML:
+ @verbatim
+ <foo>This is <b>text</b></foo>
+ @endverbatim
+ GetText() will return "This is ".
+
+ WARNING: GetText() accesses a child node - don't become confused with the
+ similarly named TiXmlHandle::Text() and TiXmlNode::ToText() which are
+ safe type casts on the referenced node.
+ */
+ const char* GetText() const;
+
+ /// Creates a new Element and returns it - the returned element is a copy.
+ virtual TiXmlNode* Clone() const;
+ // Print the Element to a FILE stream.
+ virtual void Print( FILE* cfile, int depth ) const;
+
+ /* Attribtue parsing starts: next char past '<'
+ returns: next char past '>'
+ */
+ virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
+
+ virtual const TiXmlElement* ToElement() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+ virtual TiXmlElement* ToElement() { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+
+ /** Walk the XML tree visiting this node and all of its children.
+ */
+ virtual bool Accept( TiXmlVisitor* visitor ) const;
+
+protected:
+
+ void CopyTo( TiXmlElement* target ) const;
+ void ClearThis(); // like clear, but initializes 'this' object as well
+
+ // Used to be public [internal use]
+ virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
+
+ /* [internal use]
+ Reads the "value" of the element -- another element, or text.
+ This should terminate with the current end tag.
+ */
+ const char* ReadValue( const char* in, TiXmlParsingData* prevData, TiXmlEncoding encoding );
+
+private:
+
+ TiXmlAttributeSet attributeSet;
+};
+
+
+/** An XML comment.
+*/
+class TiXmlComment : public TiXmlNode
+{
+public:
+ /// Constructs an empty comment.
+ TiXmlComment() : TiXmlNode( TiXmlNode::COMMENT ) {}
+ /// Construct a comment from text.
+ TiXmlComment( const char* _value ) : TiXmlNode( TiXmlNode::COMMENT ) {
+ SetValue( _value );
+ }
+ TiXmlComment( const TiXmlComment& );
+ void operator=( const TiXmlComment& base );
+
+ virtual ~TiXmlComment() {}
+
+ /// Returns a copy of this Comment.
+ virtual TiXmlNode* Clone() const;
+ // Write this Comment to a FILE stream.
+ virtual void Print( FILE* cfile, int depth ) const;
+
+ /* Attribtue parsing starts: at the ! of the !--
+ returns: next char past '>'
+ */
+ virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
+
+ virtual const TiXmlComment* ToComment() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+ virtual TiXmlComment* ToComment() { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+
+ /** Walk the XML tree visiting this node and all of its children.
+ */
+ virtual bool Accept( TiXmlVisitor* visitor ) const;
+
+protected:
+ void CopyTo( TiXmlComment* target ) const;
+
+ // used to be public
+ virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
+
+// virtual void StreamOut( TIXML_OSTREAM * out ) const;
+
+private:
+
+};
+
+
+/** XML text. A text node can have 2 ways to output the next. "normal" output
+ and CDATA. It will default to the mode it was parsed from the XML file and
+ you generally want to leave it alone, but you can change the output mode with
+ SetCDATA() and query it with CDATA().
+*/
+class TiXmlText : public TiXmlNode
+{
+ friend class TiXmlElement;
+public:
+ /** Constructor for text element. By default, it is treated as
+ normal, encoded text. If you want it be output as a CDATA text
+ element, set the parameter _cdata to 'true'
+ */
+ TiXmlText (const char * initValue ) : TiXmlNode (TiXmlNode::TEXT)
+ {
+ SetValue( initValue );
+ cdata = false;
+ }
+ virtual ~TiXmlText() {}
+
+ /// Constructor.
+ TiXmlText( const std::string& initValue ) : TiXmlNode (TiXmlNode::TEXT)
+ {
+ SetValue( initValue );
+ cdata = false;
+ }
+
+ TiXmlText( const TiXmlText& copy ) : TiXmlNode( TiXmlNode::TEXT ) { copy.CopyTo( this ); }
+ void operator=( const TiXmlText& base ) { base.CopyTo( this ); }
+
+ // Write this text object to a FILE stream.
+ virtual void Print( FILE* cfile, int depth ) const;
+
+ /// Queries whether this represents text using a CDATA section.
+ bool CDATA() const { return cdata; }
+ /// Turns on or off a CDATA representation of text.
+ void SetCDATA( bool _cdata ) { cdata = _cdata; }
+
+ virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
+
+ virtual const TiXmlText* ToText() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+ virtual TiXmlText* ToText() { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+
+ /** Walk the XML tree visiting this node and all of its children.
+ */
+ virtual bool Accept( TiXmlVisitor* content ) const;
+
+protected :
+ /// [internal use] Creates a new Element and returns it.
+ virtual TiXmlNode* Clone() const;
+ void CopyTo( TiXmlText* target ) const;
+
+ bool Blank() const; // returns true if all white space and new lines
+ // [internal use]
+ virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
+
+private:
+ bool cdata; // true if this should be input and output as a CDATA style text element
+};
+
+
+/** In correct XML the declaration is the first entry in the file.
+ @verbatim
+ <?xml version="1.0" standalone="yes"?>
+ @endverbatim
+
+ TinyXml will happily read or write files without a declaration,
+ however. There are 3 possible attributes to the declaration:
+ version, encoding, and standalone.
+
+ Note: In this version of the code, the attributes are
+ handled as special cases, not generic attributes, simply
+ because there can only be at most 3 and they are always the same.
+*/
+class TiXmlDeclaration : public TiXmlNode
+{
+public:
+ /// Construct an empty declaration.
+ TiXmlDeclaration() : TiXmlNode( TiXmlNode::DECLARATION ) {}
+
+ /// Constructor.
+ TiXmlDeclaration( const std::string& _version,
+ const std::string& _encoding,
+ const std::string& _standalone );
+
+ /// Construct.
+ TiXmlDeclaration( const char* _version,
+ const char* _encoding,
+ const char* _standalone );
+
+ TiXmlDeclaration( const TiXmlDeclaration& copy );
+ void operator=( const TiXmlDeclaration& copy );
+
+ virtual ~TiXmlDeclaration() {}
+
+ /// Version. Will return an empty string if none was found.
+ const char *Version() const { return version.c_str (); }
+ /// Encoding. Will return an empty string if none was found.
+ const char *Encoding() const { return encoding.c_str (); }
+ /// Is this a standalone document?
+ const char *Standalone() const { return standalone.c_str (); }
+
+ /// Creates a copy of this Declaration and returns it.
+ virtual TiXmlNode* Clone() const;
+ // Print this declaration to a FILE stream.
+ virtual void Print( FILE* cfile, int depth, TIXML_STRING* str ) const;
+ virtual void Print( FILE* cfile, int depth ) const {
+ Print( cfile, depth, 0 );
+ }
+
+ virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
+
+ virtual const TiXmlDeclaration* ToDeclaration() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+ virtual TiXmlDeclaration* ToDeclaration() { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+
+ /** Walk the XML tree visiting this node and all of its children.
+ */
+ virtual bool Accept( TiXmlVisitor* visitor ) const;
+
+protected:
+ void CopyTo( TiXmlDeclaration* target ) const;
+ // used to be public
+ virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
+
+private:
+
+ TIXML_STRING version;
+ TIXML_STRING encoding;
+ TIXML_STRING standalone;
+};
+
+
+/** Any tag that tinyXml doesn't recognize is saved as an
+ unknown. It is a tag of text, but should not be modified.
+ It will be written back to the XML, unchanged, when the file
+ is saved.
+
+ DTD tags get thrown into TiXmlUnknowns.
+*/
+class TiXmlUnknown : public TiXmlNode
+{
+public:
+ TiXmlUnknown() : TiXmlNode( TiXmlNode::UNKNOWN ) {}
+ virtual ~TiXmlUnknown() {}
+
+ TiXmlUnknown( const TiXmlUnknown& copy ) : TiXmlNode( TiXmlNode::UNKNOWN ) { copy.CopyTo( this ); }
+ void operator=( const TiXmlUnknown& copy ) { copy.CopyTo( this ); }
+
+ /// Creates a copy of this Unknown and returns it.
+ virtual TiXmlNode* Clone() const;
+ // Print this Unknown to a FILE stream.
+ virtual void Print( FILE* cfile, int depth ) const;
+
+ virtual const char* Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding );
+
+ virtual const TiXmlUnknown* ToUnknown() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+ virtual TiXmlUnknown* ToUnknown() { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+
+ /** Walk the XML tree visiting this node and all of its children.
+ */
+ virtual bool Accept( TiXmlVisitor* content ) const;
+
+protected:
+ void CopyTo( TiXmlUnknown* target ) const;
+
+ virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
+
+private:
+
+};
+
+
+/** Always the top level node. A document binds together all the
+ XML pieces. It can be saved, loaded, and printed to the screen.
+ The 'value' of a document node is the xml file name.
+*/
+class TiXmlDocument : public TiXmlNode
+{
+public:
+ /// Create an empty document, that has no name.
+ TiXmlDocument();
+ /// Create a document with a name. The name of the document is also the filename of the xml.
+ TiXmlDocument( const char * documentName );
+
+ /// Constructor.
+ TiXmlDocument( const std::string& documentName );
+
+ TiXmlDocument( const TiXmlDocument& copy );
+ void operator=( const TiXmlDocument& copy );
+
+ virtual ~TiXmlDocument() {}
+
+ /** Load a file using the current document value.
+ Returns true if successful. Will delete any existing
+ document data before loading.
+ */
+ bool LoadFile( TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
+ /// Save a file using the current document value. Returns true if successful.
+ bool SaveFile() const;
+ /// Load a file using the given filename. Returns true if successful.
+ bool LoadFile( const char * filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
+ /// Save a file using the given filename. Returns true if successful.
+ bool SaveFile( const char * filename ) const;
+ /** Load a file using the given FILE*. Returns true if successful. Note that this method
+ doesn't stream - the entire object pointed at by the FILE*
+ will be interpreted as an XML file. TinyXML doesn't stream in XML from the current
+ file location. Streaming may be added in the future.
+ */
+ bool LoadFile( FILE*, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
+ /// Save a file using the given FILE*. Returns true if successful.
+ bool SaveFile( FILE* ) const;
+
+ bool LoadFile( const std::string& filename, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING ) ///< STL std::string version.
+ {
+// StringToBuffer f( filename );
+// return ( f.buffer && LoadFile( f.buffer, encoding ));
+ return LoadFile( filename.c_str(), encoding );
+ }
+ bool SaveFile( const std::string& filename ) const ///< STL std::string version.
+ {
+// StringToBuffer f( filename );
+// return ( f.buffer && SaveFile( f.buffer ));
+ return SaveFile( filename.c_str() );
+ }
+
+ /** Parse the given null terminated block of xml data. Passing in an encoding to this
+ method (either TIXML_ENCODING_LEGACY or TIXML_ENCODING_UTF8 will force TinyXml
+ to use that encoding, regardless of what TinyXml might otherwise try to detect.
+ */
+ virtual const char* Parse( const char* p, TiXmlParsingData* data = 0, TiXmlEncoding encoding = TIXML_DEFAULT_ENCODING );
+
+ /** Get the root element -- the only top level element -- of the document.
+ In well formed XML, there should only be one. TinyXml is tolerant of
+ multiple elements at the document level.
+ */
+ const TiXmlElement* RootElement() const { return FirstChildElement(); }
+ TiXmlElement* RootElement() { return FirstChildElement(); }
+
+ /** If an error occurs, Error will be set to true. Also,
+ - The ErrorId() will contain the integer identifier of the error (not generally useful)
+ - The ErrorDesc() method will return the name of the error. (very useful)
+ - The ErrorRow() and ErrorCol() will return the location of the error (if known)
+ */
+ bool Error() const { return error; }
+
+ /// Contains a textual (english) description of the error if one occurs.
+ const char * ErrorDesc() const { return errorDesc.c_str (); }
+
+ /** Generally, you probably want the error string ( ErrorDesc() ). But if you
+ prefer the ErrorId, this function will fetch it.
+ */
+ int ErrorId() const { return errorId; }
+
+ /** Returns the location (if known) of the error. The first column is column 1,
+ and the first row is row 1. A value of 0 means the row and column wasn't applicable
+ (memory errors, for example, have no row/column) or the parser lost the error. (An
+ error in the error reporting, in that case.)
+
+ @sa SetTabSize, Row, Column
+ */
+ int ErrorRow() const { return errorLocation.row+1; }
+ int ErrorCol() const { return errorLocation.col+1; } ///< The column where the error occured. See ErrorRow()
+
+ /** SetTabSize() allows the error reporting functions (ErrorRow() and ErrorCol())
+ to report the correct values for row and column. It does not change the output
+ or input in any way.
+
+ By calling this method, with a tab size
+ greater than 0, the row and column of each node and attribute is stored
+ when the file is loaded. Very useful for tracking the DOM back in to
+ the source file.
+
+ The tab size is required for calculating the location of nodes. If not
+ set, the default of 4 is used. The tabsize is set per document. Setting
+ the tabsize to 0 disables row/column tracking.
+
+ Note that row and column tracking is not supported when using operator>>.
+
+ The tab size needs to be enabled before the parse or load. Correct usage:
+ @verbatim
+ TiXmlDocument doc;
+ doc.SetTabSize( 8 );
+ doc.Load( "myfile.xml" );
+ @endverbatim
+
+ @sa Row, Column
+ */
+ void SetTabSize( int _tabsize ) { tabsize = _tabsize; }
+
+ int TabSize() const { return tabsize; }
+
+ /** If you have handled the error, it can be reset with this call. The error
+ state is automatically cleared if you Parse a new XML block.
+ */
+ void ClearError() { error = false;
+ errorId = 0;
+ errorDesc = "";
+ errorLocation.row = errorLocation.col = 0;
+ //errorLocation.last = 0;
+ }
+
+ /** Write the document to standard out using formatted printing ("pretty print"). */
+ void Print() const { Print( stdout, 0 ); }
+
+ /* Write the document to a string using formatted printing ("pretty print"). This
+ will allocate a character array (new char[]) and return it as a pointer. The
+ calling code pust call delete[] on the return char* to avoid a memory leak.
+ */
+ //char* PrintToMemory() const;
+
+ /// Print this Document to a FILE stream.
+ virtual void Print( FILE* cfile, int depth = 0 ) const;
+ // [internal use]
+ void SetError( int err, const char* errorLocation, TiXmlParsingData* prevData, TiXmlEncoding encoding );
+
+ virtual const TiXmlDocument* ToDocument() const { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+ virtual TiXmlDocument* ToDocument() { return this; } ///< Cast to a more defined type. Will return null not of the requested type.
+
+ /** Walk the XML tree visiting this node and all of its children.
+ */
+ virtual bool Accept( TiXmlVisitor* content ) const;
+
+protected :
+ // [internal use]
+ virtual TiXmlNode* Clone() const;
+ virtual void StreamIn( std::istream * in, TIXML_STRING * tag );
+
+private:
+ void CopyTo( TiXmlDocument* target ) const;
+
+ bool error;
+ int errorId;
+ TIXML_STRING errorDesc;
+ int tabsize;
+ TiXmlCursor errorLocation;
+ bool useMicrosoftBOM; // the UTF-8 BOM were found when read. Note this, and try to write.
+};
+
+
+/**
+ A TiXmlHandle is a class that wraps a node pointer with null checks; this is
+ an incredibly useful thing. Note that TiXmlHandle is not part of the TinyXml
+ DOM structure. It is a separate utility class.
+
+ Take an example:
+ @verbatim
+ <Document>
+ <Element attributeA = "valueA">
+ <Child attributeB = "value1" />
+ <Child attributeB = "value2" />
+ </Element>
+ <Document>
+ @endverbatim
+
+ Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very
+ easy to write a *lot* of code that looks like:
+
+ @verbatim
+ TiXmlElement* root = document.FirstChildElement( "Document" );
+ if ( root )
+ {
+ TiXmlElement* element = root->FirstChildElement( "Element" );
+ if ( element )
+ {
+ TiXmlElement* child = element->FirstChildElement( "Child" );
+ if ( child )
+ {
+ TiXmlElement* child2 = child->NextSiblingElement( "Child" );
+ if ( child2 )
+ {
+ // Finally do something useful.
+ @endverbatim
+
+ And that doesn't even cover "else" cases. TiXmlHandle addresses the verbosity
+ of such code. A TiXmlHandle checks for null pointers so it is perfectly safe
+ and correct to use:
+
+ @verbatim
+ TiXmlHandle docHandle( &document );
+ TiXmlElement* child2 = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", 1 ).ToElement();
+ if ( child2 )
+ {
+ // do something useful
+ @endverbatim
+
+ Which is MUCH more concise and useful.
+
+ It is also safe to copy handles - internally they are nothing more than node pointers.
+ @verbatim
+ TiXmlHandle handleCopy = handle;
+ @endverbatim
+
+ What they should not be used for is iteration:
+
+ @verbatim
+ int i=0;
+ while ( true )
+ {
+ TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).Child( "Child", i ).ToElement();
+ if ( !child )
+ break;
+ // do something
+ ++i;
+ }
+ @endverbatim
+
+ It seems reasonable, but it is in fact two embedded while loops. The Child method is
+ a linear walk to find the element, so this code would iterate much more than it needs
+ to. Instead, prefer:
+
+ @verbatim
+ TiXmlElement* child = docHandle.FirstChild( "Document" ).FirstChild( "Element" ).FirstChild( "Child" ).ToElement();
+
+ for( child; child; child=child->NextSiblingElement() )
+ {
+ // do something
+ }
+ @endverbatim
+*/
+class TiXmlHandle
+{
+public:
+ /// Create a handle from any node (at any depth of the tree.) This can be a null pointer.
+ TiXmlHandle( TiXmlNode* _node ) { this->node = _node; }
+ /// Copy constructor
+ TiXmlHandle( const TiXmlHandle& ref ) { this->node = ref.node; }
+ TiXmlHandle operator=( const TiXmlHandle& ref ) { this->node = ref.node; return *this; }
+
+ /// Return a handle to the first child node.
+ TiXmlHandle FirstChild() const;
+ /// Return a handle to the first child node with the given name.
+ TiXmlHandle FirstChild( const char * value ) const;
+ /// Return a handle to the first child element.
+ TiXmlHandle FirstChildElement() const;
+ /// Return a handle to the first child element with the given name.
+ TiXmlHandle FirstChildElement( const char * value ) const;
+
+ /** Return a handle to the "index" child with the given name.
+ The first child is 0, the second 1, etc.
+ */
+ TiXmlHandle Child( const char* value, int index ) const;
+ /** Return a handle to the "index" child.
+ The first child is 0, the second 1, etc.
+ */
+ TiXmlHandle Child( int index ) const;
+ /** Return a handle to the "index" child element with the given name.
+ The first child element is 0, the second 1, etc. Note that only TiXmlElements
+ are indexed: other types are not counted.
+ */
+ TiXmlHandle ChildElement( const char* value, int index ) const;
+ /** Return a handle to the "index" child element.
+ The first child element is 0, the second 1, etc. Note that only TiXmlElements
+ are indexed: other types are not counted.
+ */
+ TiXmlHandle ChildElement( int index ) const;
+
+ TiXmlHandle FirstChild( const std::string& _value ) const { return FirstChild( _value.c_str() ); }
+ TiXmlHandle FirstChildElement( const std::string& _value ) const { return FirstChildElement( _value.c_str() ); }
+
+ TiXmlHandle Child( const std::string& _value, int index ) const { return Child( _value.c_str(), index ); }
+ TiXmlHandle ChildElement( const std::string& _value, int index ) const { return ChildElement( _value.c_str(), index ); }
+
+ /** Return the handle as a TiXmlNode. This may return null.
+ */
+ TiXmlNode* ToNode() const { return node; }
+ /** Return the handle as a TiXmlElement. This may return null.
+ */
+ TiXmlElement* ToElement() const { return ( ( node && node->ToElement() ) ? node->ToElement() : 0 ); }
+ /** Return the handle as a TiXmlText. This may return null.
+ */
+ TiXmlText* ToText() const { return ( ( node && node->ToText() ) ? node->ToText() : 0 ); }
+ /** Return the handle as a TiXmlUnknown. This may return null.
+ */
+ TiXmlUnknown* ToUnknown() const { return ( ( node && node->ToUnknown() ) ? node->ToUnknown() : 0 ); }
+
+ /** @deprecated use ToNode.
+ Return the handle as a TiXmlNode. This may return null.
+ */
+ TiXmlNode* Node() const { return ToNode(); }
+ /** @deprecated use ToElement.
+ Return the handle as a TiXmlElement. This may return null.
+ */
+ TiXmlElement* Element() const { return ToElement(); }
+ /** @deprecated use ToText()
+ Return the handle as a TiXmlText. This may return null.
+ */
+ TiXmlText* Text() const { return ToText(); }
+ /** @deprecated use ToUnknown()
+ Return the handle as a TiXmlUnknown. This may return null.
+ */
+ TiXmlUnknown* Unknown() const { return ToUnknown(); }
+
+private:
+ TiXmlNode* node;
+};
+
+
+/** Print to memory functionality. The TiXmlPrinter is useful when you need to:
+
+ -# Print to memory (especially in non-STL mode)
+ -# Control formatting (line endings, etc.)
+
+ When constructed, the TiXmlPrinter is in its default "pretty printing" mode.
+ Before calling Accept() you can call methods to control the printing
+ of the XML document. After TiXmlNode::Accept() is called, the printed document can
+ be accessed via the CStr(), Str(), and Size() methods.
+
+ TiXmlPrinter uses the Visitor API.
+ @verbatim
+ TiXmlPrinter printer;
+ printer.SetIndent( "\t" );
+
+ doc.Accept( &printer );
+ fprintf( stdout, "%s", printer.CStr() );
+ @endverbatim
+*/
+class TiXmlPrinter : public TiXmlVisitor
+{
+public:
+ TiXmlPrinter() : depth( 0 ), simpleTextPrint( false ),
+ buffer(), indent( " " ), lineBreak( "\n" ) {}
+
+ virtual bool VisitEnter( const TiXmlDocument& doc );
+ virtual bool VisitExit( const TiXmlDocument& doc );
+
+ virtual bool VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute );
+ virtual bool VisitExit( const TiXmlElement& element );
+
+ virtual bool Visit( const TiXmlDeclaration& declaration );
+ virtual bool Visit( const TiXmlText& text );
+ virtual bool Visit( const TiXmlComment& comment );
+ virtual bool Visit( const TiXmlUnknown& unknown );
+
+ /** Set the indent characters for printing. By default 4 spaces
+ but tab (\t) is also useful, or null/empty string for no indentation.
+ */
+ void SetIndent( const char* _indent ) { indent = _indent ? _indent : "" ; }
+ /// Query the indention string.
+ const char* Indent() { return indent.c_str(); }
+ /** Set the line breaking string. By default set to newline (\n).
+ Some operating systems prefer other characters, or can be
+ set to the null/empty string for no indenation.
+ */
+ void SetLineBreak( const char* _lineBreak ) { lineBreak = _lineBreak ? _lineBreak : ""; }
+ /// Query the current line breaking string.
+ const char* LineBreak() { return lineBreak.c_str(); }
+
+ /** Switch over to "stream printing" which is the most dense formatting without
+ linebreaks. Common when the XML is needed for network transmission.
+ */
+ void SetStreamPrinting() { indent = "";
+ lineBreak = "";
+ }
+ /// Return the result.
+ const char* CStr() { return buffer.c_str(); }
+ /// Return the length of the result string.
+ size_t Size() { return buffer.size(); }
+
+ /// Return the result.
+ const std::string& Str() { return buffer; }
+
+private:
+ void DoIndent() {
+ for( int i=0; i<depth; ++i )
+ buffer += indent;
+ }
+ void DoLineBreak() {
+ buffer += lineBreak;
+ }
+
+ int depth;
+ bool simpleTextPrint;
+ TIXML_STRING buffer;
+ TIXML_STRING indent;
+ TIXML_STRING lineBreak;
+};
+
+
+#ifdef _MSC_VER
+#pragma warning( pop )
+#endif
+
+#endif
+
Index: tags/agile-1.2.0/include/Makefile.am
===================================================================
--- tags/agile-1.2.0/include/Makefile.am (revision 0)
+++ tags/agile-1.2.0/include/Makefile.am (revision 755)
@@ -0,0 +1,2 @@
+SUBDIRS = AGILe
+nobase_dist_noinst_HEADERS = TinyXML/tinyxml.h
Index: tags/agile-1.2.0/include
===================================================================
--- tags/agile-1.2.0/include (revision 754)
+++ tags/agile-1.2.0/include (revision 755)
Property changes on: tags/agile-1.2.0/include
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,2 ##
+Makefile.in
+Makefile
Index: tags/agile-1.2.0/AUTHORS
===================================================================
--- tags/agile-1.2.0/AUTHORS (revision 0)
+++ tags/agile-1.2.0/AUTHORS (revision 755)
@@ -0,0 +1,12 @@
+RivetGun
+--------
+
+Main authors of the infrastructure:
+Andy Buckley <andy.buckley@durham.ac.uk>
+Leif Lonnblad <Leif.Lonnblad@thep.lu.se>
+
+Specific interfaces from:
+Jon Butterworth <J.Butterworth@ucl.ac.uk>
+Lars Sonnenschein <sonne@mail.cern.ch>
+Doug Gingrich <gingrich@phys.ualberta.ca>
+
Index: tags/agile-1.2.0/ChangeLog
===================================================================
--- tags/agile-1.2.0/ChangeLog (revision 0)
+++ tags/agile-1.2.0/ChangeLog (revision 755)
@@ -0,0 +1,613 @@
+2010-09-24 Andy Buckley <andy@insectnation.org>
+
+ * Releasing AGILe 1.2.0 -- major new features are PYTHIA/HERWIG
+ event enhancement/weighting and the Cascade/Rapgap interfaces.
+
+2010-07-19 Andy Buckley <andy@insectnation.org>
+
+ * Adding official API functions for path and LCG platform tag
+ getting.
+
+2010-07-16 Andy Buckley <andy@insectnation.org>
+
+ * Restructuring SWIG module to a more general package with a SWIG
+ core.
+
+ * Requiring Python >= 2.4.
+
+2010-06-10 Andy Buckley <andy@insectnation.org>
+
+ * Releasing AGILe 1.1.6.
+
+ * Now using Boost lexical_cast instead of stringstream for safety
+ and convenience.
+
+2010-06-01 Andy Buckley <andy@insectnation.org>
+
+ * Upgrading the Python and SWIG checks to the cleverer ones from
+ recent Rivet releases.
+
+ * Fixing Loader to pick up Herwig, Charybdis and Cascade from
+ changed Genser locations, and to ensure that Jimmy and Herwig are
+ both picked from the ".3" Genser sub-version, and hence have the
+ same HEPEVT common block size: this fixes a memory corruption
+ issue which was making HW+JM exit with an error after only a small
+ number of events. Note that as a result of fixing these Genser
+ versions, the AGILe command-line name for Herwig has changed from
+ "Herwig:6510" to "Herwig:6.510".
+
+2010-05-07 Andy Buckley <andy@insectnation.org>
+
+ * Adding params files for ALEPH and DELPHI PYTHIA tunes, thanks to
+ Sarka Todorova.
+
+ * Fix missing usage message on agile-runmc.
+
+ * Changing generator search path to only fall back to hard-coded
+ Genser AFS area if AGILE_GEN_PATH is not set. Spurred by wanting
+ to avoid AFS timeouts on systems with /afs mounted where there is
+ no valid token... the initialisation slowdown from this timeout
+ puzzled me for a *long* time, before I worked out that it was
+ connected to me having added AFS mounting to my laptop!
+
+2010-04-22 Andy Buckley <andy@insectnation.org>
+
+ * Using unit conversion for all generators reading from
+ HEPEVT (i.e. all generators!).
+
+ * Adding HepMCTools.hh internal header, containing units
+ conversion routine for converting HEPEVT-dumped events in GeV/mm
+ convention to the current event's units if required.
+
+ * Holger added Cascade interface.
+
+2010-03-15 Andy Buckley <andy@insectnation.org>
+
+ * Adding build of omitted libAGILeAlpGen.so library.
+
+ * Moved core components into src/Core to improve build flexibility.
+
+ * Holger added RapGap interface.
+
+2009-11-11 Andy Buckley <andy@insectnation.org>
+
+ * Making params evaluate in order given on the command line / in
+ param files. The first occurence position is used if a parameter
+ is specified more than once, but the last-specified _value_ will
+ be used.
+
+2009-11-10 Andy Buckley <andy@insectnation.org>
+
+ * Removing all traces of C++ generators, since I don't want to
+ give anyone the impression that this is a good way to run them.
+
+ * Adding --filter option to strip unphysical particles out of the
+ event record.
+
+ * Using shared_ptr to automatically manage the Run I/O pointers.
+
+2009-11-08 Andy Buckley <andy@insectnation.org>
+
+ * Splitting Charybdis processing as for AlpGen, and hence adding a
+ proper CharybdisJimmy interface (and registering it in the Loader).
+
+ * Adding proper AlpGenJimmy library support to Loader.
+
+2009-10-23 Andy Buckley <andy@insectnation.org>
+
+ * Writing event weights (and estimated errors) into HepMC (if
+ supported) for Fortran HERWIG.
+
+2009-10-21 Andy Buckley <andy@insectnation.org>
+
+ * Completing documentation of HERWIG params.
+
+ * Adding errors to Pythia 6 cross-section estimate filling.
+
+2009-10-16 Andy Buckley <andy@insectnation.org>
+
+ * Creating new Run object, to allow removal of Python HepMC
+ interface (which is no bad thing, but if forces a SWIG dependence
+ on the HepMC version, and SL doesn't have a sufficiently
+ functional copy of SWIG to be relied on.
+
+ * Using AlpGen interface by composition rather than inheritance:
+ AlpGenHerwigJimmy should now work.
+
+2009-06-10 Andy Buckley <andy@insectnation.org>
+
+ * Using "embedded" hepmc.i in AGILe.i, as for rivet.i, to make an
+ 1.1.4 alpha tarball which will work on lxplus and can be
+ bootstrapped with Rivet.
+
+2009-06-03 Andy Buckley <andy@insectnation.org>
+
+ * Putting SWIG-generated source files under version control, to
+ make life easier for people who check out the SVN head but don't
+ have an up to date (or any) copy of SWIG.
+
+2009-04-07 Andy Buckley <andy@insectnation.org>
+
+ * Adding $(DESTDIR) prefix to call to Python module "setup.py
+ install"
+
+2009-03-04 Andy Buckley <andy@insectnation.org>
+
+ * Adding AGILE_DEBUG environment variable.
+
+ * Fixing SWIG build to allow reliable interchange of HepMC objects.
+
+2009-02-25 Andy Buckley <andy@insectnation.org>
+
+ * Make Python extension etc. build by default.
+
+2009-01-22 Andy Buckley <andy@insectnation.org>
+
+ * agile-runmc: added handling of an RG:Generator param, and hence
+ the ability to dump out a whole gen config, including run
+ conditions and generator name, using --list-used-analyses.
+
+2009-01-15 Andy Buckley <andy@insectnation.org>
+
+ * Converting Python build system to bundle SWIG output in tarball.
+
+2009-01-05 Andy Buckley <andy@insectnation.org>
+
+ * Python: replaced Python extension build process with a more
+ portable version based on distutils and newer m4 macros. Breaks
+ distcheck until distutils SWIG support is improved to support
+ multi-dir builds.
+
+2008-11-28 Andy Buckley <andy@insectnation.org>
+
+ * Replaced binreloc with an upgraded and symbol-independent copy.
+
+2008-11-21 Andy Buckley <andy@insectnation.org>
+
+ * Pre-emptively recognise Pythia 6.420, since we know there will
+ be one (it will include the Skands + Professor tune + Peter's
+ other 'Perugia' tunes).
+
+ * Moved RivetGun params into AGILe.
+
+ * Various command line tweaks, bug fixes and cosmetic improvements.
+
+2008-11-18 Hendrik Hoeth <hendrik.hoeth@cern.ch>
+
+ * Recognise Pythia 6.419
+
+2008-11-04 Andy Buckley <andy@insectnation.org>
+
+ * Added bash completion file, minor UI bug fixes, and more
+ complete beam string handling.
+
+2008-10-30 Andy Buckley <andy@insectnation.org>
+
+ * Added param file search path handling ("." + AGILE_PARAM_PATH),
+ and also support for an "include" statement in param files.
+
+2008-10-28 Andy Buckley <andy@insectnation.org>
+
+ * Added Python access to AGILe log system, param dumping, RNG seed
+ control and flexible initial state energy, num events and beam
+ specification.
+
+2008-10-21 Andy Buckley <andy@insectnation.org>
+
+ * Making Herwig++ call its initial-state setting before any params
+ are passed, since the AGILeGenerator object must be set up first.
+
+ * All generators will now try to load a "HEAD" version if
+ available.
+
+2008-10-09 Andy Buckley <andy@insectnation.org>
+
+ * Fixed bug in FHerwigJimmy which meant that the event loop was
+ infinite.
+
+2008-10-07 Andy Buckley <andy@insectnation.org>
+
+ * Added SWIG Python interface --- just mapping Loader and
+ Generator (ignoring GeneratorState). Seems to work!
+
+ * Added missing TinyXML source files --- Python refused to load
+ the library since the symbols weren't defined.
+
+2008-08-24 Andy Buckley <andy@insectnation.org>
+
+ * Fixed Sherpa detection --- boostrapping now works on lxplus.
+
+ * Added unindexed MODPDF and AUTPDF param names to FHerwig, since
+ you usually want both particles to have the same PDF setup, and
+ this is a nice bit of syntactic sugar.
+
+ * Herwig++ setup now uses the flags suggested by the herwig-config
+ script, and --with-thepeg is no longer used.
+
+ * Set default FHerwig process to be QCD 2->2.
+
+ * Removed FHerwig MAXEV and MAXER param handling, since their role
+ is irrelevant within AGILe.
+
+ * Added error-handling loops to FHerwig and FHerwigJimmy, so that
+ Herwig errors are caught and the event is re-generated until it
+ behaves itself.
+
+2008-08-12 Andy Buckley <andy@insectnation.org>
+
+ * Added a AGILE_USE_AFS variable which can be set to "no" to stop
+ AGILe's generator loader from automatically inserting GENSER's AFS
+ path into the gen search path.
+
+ * Removed default matrix elements from Herwig++.
+
+2008-08-11 Andy Buckley <andy@insectnation.org>
+
+ * src/Loader.cc: Every call to getenv now uses a separate "const
+ char*" return variable. CMTCONFIG env variable no longer used,
+ since it was not there unless using an ATLAS/LHCb build shell and
+ was in the wrong tag format anyway.
+
+ * src/CCHerwig/CCHerwig.cc: Added handling of a special INFILE
+ parameter, which is used as the argument to a ThePEG "read"
+ command.
+
+ * src/Loader.cc: Factorized findGenLib function into several
+ smaller functions to aid memory problem investigation.
+
+2008-08-08 Andy Buckley <abuckley@cern.ch>
+
+ * C++ generator configure now fails gracefully.
+
+ * AlpGen and Charybdis now work with both Herwig and Pythia from
+ the Genser versions. Hurrah!
+
+2008-08-05 Andy Buckley <andy@insectnation.org>
+
+ * Removed setting of Sherpa EVENT_MODE and ANALYSIS switches, as
+ recommended by Frank Siegert.
+
+2008-08-04 Andy Buckley <andy@insectnation.org>
+
+ * Changed AlpGen and Charybdis to load using the Genser names. Get
+ segfaults at the moment, but the libs are at least detected on
+ lxplus.
+
+ * Loader tries to find LHAPDF library in both the Genser structure
+ and as a fallback to the normal $prefix type area.
+
+2008-07-29 Andy Buckley <andy@insectnation.org>
+
+ * Loader now prefers the '.2' versions of Genser gens if possible,
+ since for the Fortran gens these are compiled with the larger
+ 10000-entry HEPEVT common blocks (as opposed to the default 4000)
+
+ * Automated Herwig and Pythia's acquiring common block sizes -
+ fixes a problem with CERN Pythia installations.
+
+ * Fixed wrong flags on agile-config
+
+2008-07-27 Andy Buckley <andy@insectnation.org>
+
+ * Added better tests for Boost headers.
+
+ * Added testing for -ansi, -pedantic and -Wall compiler flags.
+
+ * Removed Status returns from the interface.
+
+2008-07-23 Andy Buckley <andy@insectnation.org>
+
+ * Added explicit Boost header checks, since old versions may not
+ have all the necessary headers.
+
+2008-07-16 Andy Buckley <andy@insectnation.org>
+
+ * Improved debug info in the loader (again!)
+
+ * Tries to fall back to more Genser directories, such as
+ $GENSER/MCGenerators (for forward compatibility with Genser
+ boostrap script with mkGenserArea), and also to try the old
+ lib<gen><version>.<ext> convention.
+
+ * Now uses Boost foreach (if Rivet can, so can AGILe!)
+
+2008-07-09 Andy Buckley <andy@insectnation.org>
+
+ * Loader improvements: LHAPDF availability is now tested as for
+ generators, and is done only once.
+
+ * Upgraded Sherpa to use new HepMC interface fixes. This requires
+ the unreleased Sherpa 1.1.2, either from trunk or beta tarball.
+
+ * Replaced cout and cerr with proper logging classes.
+
+2008-07-07 Andy Buckley <andy@insectnation.org>
+
+ * Added "AGILE_" namespacing to all header guards.
+
+ * Added flag to Sherpa build to disable warnings about deprecated
+ "const char*" to "char*" implicit conversions. We can't do
+ anything about this and it's not a "real" problem at the binary
+ level.
+
+ * Compatibility fixes for GCC 4.3.
+
+2008-07-04 Andy Buckley <andy@insectnation.org>
+
+ * Loader now only tests that libraries are present rather than
+ dlopen/dlclosing them when building the "available gens"
+ list. This solves the problems we've seen where Sherpa being
+ present breaks all the other generators (for reasons not fully
+ understood.)
+
+ * More Sherpa improvements: SHERPA_CPP_PATH and RESULTS_DIRECTORY
+ are now created if they weren't already present.
+
+2008-06-19 Andy Buckley <andy@insectnation.org>
+
+ * Fix to Sherpa interface - changed header name in Sherpa version
+ 1.1.1.
+
+2008-06-11 Andy Buckley <andy@insectnation.org>
+
+ * AGILe 1.1.1 release.
+
+2008-06-11 Jon Butterworth <jmb@hep.ucl.ac.uk>
+
+ * Fixed dynamic loader for "enhanced" Herwigs to also load the
+ basic libAGILeFHerwig AGILe module.
+
+ * Added HWBEAM and HWUIDT param wrappers.
+
+2008-06-10 Andy Buckley <andy@insectnation.org>
+
+ * Re-added assigning of the agilehandler variable in the library
+ loader. This had been accidentally removed but worked as a fluke
+ on Linux systems because dlsym seems to treat a null pointer as
+ meaning RTLD_DEFAULT: it broke on Mac OS X.
+
+2008-06-06 Andy Buckley <andy@insectnation.org>
+
+ * Changed generator names to use a closer match to the Genser
+ convention, which means that Genser-convention version numbers can
+ be extracted. This fixes the problem with loading Pythia6 and
+ Pythia8 on CERN AFS.
+
+2008-06-03 Andy Buckley <andy@insectnation.org>
+
+ * 1.1.0 release.
+
+2008-05-28 Andy Buckley <andy@insectnation.org>
+
+ * Added conditional compilation of C++ generator Loader.cc entries
+ based on configure results, to avoid problems with AFS version of
+ SHERPA.
+
+2008-05-15 Andy Buckley <andy@insectnation.org>
+
+ * Disabled loading f(py/hw)_dummies for AlgGen and Charybdis
+ interfaces, since they specialise the up* routines.
+
+ * Added LHAPDF loading to C++ gens.
+
+ * Fixed loading of LHAPDF in FHerwig and FPythia with fallback to
+ PDF dummy libs.
+
+2008-05-13 Andy Buckley <andy@insectnation.org>
+
+ * Improved logging interface: log levels are now integers (for
+ cross-library compatibility and level setting also applies to
+ existing loggers.
+
+2008-05-09 Andy Buckley <andy@insectnation.org>
+
+ * Added agile-config script.
+
+ * Merged Herwig++ 2.1 -> 2.2 implementation changes.
+
+2008-04-23 Andy Buckley <andy@insectnation.org>
+
+ * Added a hack to make libtool able to use gfortran, thinking that
+ it's the F77 compiler.
+
+2008-03-19 Andy Buckley <andy@insectnation.org>
+
+ * Added library versioning flags in the configure.ac file.
+
+ * Re-organised directory structure to allow builds of single
+ generators by "cd"ing to the appropriate subdirectory, and to
+ remove the redundant "Generators" layer.
+
+2008-03-19 Andy Buckley <andy@insectnation.org>
+
+ * FPythia parameter passing now converts the param name to upper
+ case before passing to PYGIVE, since weird behaviour has been
+ noticed when passing the MDME params with lower-case names.
+
+2008-03-18 Andy Buckley <andy@insectnation.org>
+
+ * Fixes to the Sherpa interface to make the paths work, to handle
+ the "normal makelibs exception" a bit better, and other general
+ tweaks. It now works, but SHERPA itself needs a patch to enable
+ the HepMC filling - this will be in the next version. HepMC >=
+ 2.3.6 is required for the GenEvent copying to work properly.
+
+2008-02-08 Andy Buckley <andy@insectnation.org>
+
+ * Fixes and extensions for HERA running added to FPythia and
+ FHerwig.
+
+2008-01-22 Andy Buckley <andy@insectnation.org>
+
+ * FPythia now changed to use the Genser HEPEVT size of 10000 (the
+ mismatch with the previous default value of 4000 resulted in
+ generating lots of events with no momenta)
+
+2008-01-17 Andy Buckley <andy@insectnation.org>
+
+ * Loader now tries to use the Genser liblinks area by default,
+ using a precomputed value and the CMTCONFIG variable as guesses
+ for the non-programmatic 'LGC platform tag'
+
+ * Fixed loader so that the FHerwig dummy HWAEND symbol gets
+ exported - FHerwig now works again.
+
+ * Added more configurable generator library loading, including new
+ AGILE_GEN_PATH variable.
+
+ * Added binreloc path detection.
+
+2007-11-26 Andy Buckley <andy@insectnation.org>
+
+ * Removing RivetGun components and re-branding this project as
+ pure AGILe.
+
+ * Splitting generator library detection into AGIle
+
+2007-10-31 Andy Buckley <andy@insectnation.org>
+
+ * Tagging as 1.0b3 for HERA-LHC meeting.
+
+ * Now dlopening LHAPDF all the time - this is because LHADF uses
+ some FPythia common blocks and the loading order is therefore
+ significant.
+
+2007-10-29 Andy Buckley <andy@insectnation.org>
+
+ * Fixed FHerwigJimmy event loop: this aborted at the wrong point
+ and didn't handle MSPARM == 0 properly (it trapped it in an
+ infinite loop until the failure counter overflowed).
+
+ * Fixed istringstream handling of params by introducing the
+ templated as<T> functions and their asInt/Double/Bool wrappers in
+ Utils.hh. Previously the stream was being used many times, often
+ through stream failures, which led to nonsense results. The new
+ approach makes a new inline stream each time.
+
+ * Now linking LHAPDF against rivetgun executable.
+
+ * Got Charybdis working with FHerwig and loading properly (but not
+ running correctly) with FPythia.
+
+2007-10-28 Andy Buckley <andy@insectnation.org>
+
+ * Using a vector of dlopen handles to allow arbitrary numbers of
+ libs to be dynamically loaded (dlopened).
+
+2007-10-23 Andy Buckley <andy@insectnation.org>
+
+ * rivetgun now throws an error if it can't read a specified config
+ file.
+
+2007-10-18 Andy Buckley <andy@insectnation.org>
+
+ * Removed default build of rivetgun-static.
+
+ * Using HepMC::GenEvent::clear() method.
+
+ * Removed defunct tests.
+
+ * Conversion of setParam methods to only implement the
+ string-valued one and to use stringstreams for type conversions
+ where needed.
+
+ * Added methods to Generator to perform common functionality:
+ these are conventionally called as utility functions by the
+ derived class implementations.
+
+ * Huge overhaul of generator classes: renames of Herwig++ class to
+ CCHerwig, introduction of AGILe namespace and header area, removal
+ of *Mod libraries, reworking of AlpGen, Jimmy and Charybdis
+ interfaces via inheritance, interface improvements to rivetgun.
+
+2007-10-16 James Monk
+
+ * Fixed dynamic loading for Mac OS X.
+
+2007-10-03 Andy Buckley <andy@insectnation.org>
+
+ * Added more Herwig++ features: now works but leaks memory per
+ event.
+
+2007-10-02 Andy Buckley <andy@insectnation.org>
+
+ * Removed explicit FPythia::setParam and Herwig::setParam methods,
+ except for inlined versions to call the Generator::setParam
+ defaults.
+
+ * Made Generator::makeEvent and Generator::setSeed methods pure
+ virtual, since throwing a runtime_error by default wasn't
+ producing any helpful hints to interface implementers.
+
+2007-09-28 Andy Buckley <andy@insectnation.org>
+
+ * Added portable paths to the Herwig++ tester and moved the new
+ Herwig++ control code into the existing Herwig class, which
+ doesn't really do what we want.
+
+2007-09-26 Andy Buckley <andy@insectnation.org>
+
+ * Added autoconf Fortran portability features to RivetGun
+ executables and the Fortran Herwig, Pythia, AlpGen and Charybdis
+ generators.
+
+2007-09-21 Andy Buckley <andy@insectnation.org>
+
+ * rivetgun executable now tests for ability to dlopen() each
+ potential generator library when building the command line list of
+ valid generators.
+
+2007-06-24 Andy Buckley <andy@insectnation.org>
+
+ * Changed the logging of event numbers to use a specific logger
+ and to assign different log levels to every 100th and 1000th
+ event. Most event numbers are now at the DEBUG level and so won't
+ be shown by default.
+
+ * src/Test/RivetGunInterfaceStatic.cc: Moved the available
+ generators code into a new include/RivetGun/AvailableGenerators.hh
+
+2007-06-16 Jon Butterworth <jmb@hep.ucl.ac.uk>
+
+ * Make Pythia 6.411 the latest default.
+
+2007-06-01 Doug Gingrich <gingrich@ualberta.ca>
+
+ * Added Charybdis interfaces, not yet linking them.
+
+2007-05-23 Jon Butterworth <jmb@hep.ucl.ac.uk>
+
+ * Added a local event counter for FPythia.
+
+2007-05-17 Andy Buckley <andy@insectnation.org>
+
+ * Added convenience LTDL library, based on instructions at
+ http://www.gnu.org/software/libtool/manual.html#Distributing-libltdl
+
+2007-02-09 Leif Lönnblad <Leif.Lonnblad@thep.lu.se>
+
+ * src/Test/RivetGunInterfaceStatic.cc: Now includes Generator.hh
+ to avoid compilation errors if stupid people try to compile
+ without any generators.
+
+2006-12-19 Andy Buckley <andy.buckley@durham.ac.uk>
+
+ * Added src/Test/RivetGunInterfaceStatic.cc with command line
+ parsing handled by TCLAP (Templated Command Line Argument Parser).
+
+2005-12-27 Leif Lönnblad <Leif.Lonnblad@thep.lu.se>
+
+ * configure.ac: Added -I$THEPEGPATH/include to AM_CPPFLAGS.
+
+ * Config/Rivet.h: Added some std incudes and using std::
+ declaration.
+
+ * Analysis/RivetInfo.*: Fixed some bugs. The RivetInfo facility
+ now works, although it has not been thoroughly tested.
+
+ * Analysis/Examples/TestMultiplicity.*: Re-introduced
+ FinalStateHCM for testing purposes but commented it away again.
+
+ * .: Made a number of changes to implement handling of RivetInfo
+ objects.
+
Index: tags/agile-1.2.0/src/Test/Makefile.am
===================================================================
--- tags/agile-1.2.0/src/Test/Makefile.am (revision 0)
+++ tags/agile-1.2.0/src/Test/Makefile.am (revision 755)
@@ -0,0 +1,6 @@
+noinst_PROGRAMS =
+
+MYCPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/include -I$(RIVETINCPATH)
+MYLDFLAGS = $(AM_LDFLAGS) -L$(HEPMCLIBPATH) -L$(HEPMCFIOLIBPATH) -L$(RIVETLIBPATH) \
+ -L$(top_srcdir)/src/Generators -export-dynamic
+MYLDADD = -lRivetGun -l$(RIVETLIBNAME)
Index: tags/agile-1.2.0/src/Test
===================================================================
--- tags/agile-1.2.0/src/Test (revision 754)
+++ tags/agile-1.2.0/src/Test (revision 755)
Property changes on: tags/agile-1.2.0/src/Test
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,8 ##
+.deps
+.libs
+Makefile
+Makefile.in
+testrivet
+testloop
+testCommandLine
+rivetgun-static
Index: tags/agile-1.2.0/src/Tools/TinyXML/tinyxmlerror.cpp
===================================================================
--- tags/agile-1.2.0/src/Tools/TinyXML/tinyxmlerror.cpp (revision 0)
+++ tags/agile-1.2.0/src/Tools/TinyXML/tinyxmlerror.cpp (revision 755)
@@ -0,0 +1,53 @@
+/*
+www.sourceforge.net/projects/tinyxml
+Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com)
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any
+damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any
+purpose, including commercial applications, and to alter it and
+redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must
+not claim that you wrote the original software. If you use this
+software in a product, an acknowledgment in the product documentation
+would be appreciated but is not required.
+
+2. Altered source versions must be plainly marked as such, and
+must not be misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source
+distribution.
+*/
+
+#include "tinyxml.h"
+
+// The goal of the seperate error file is to make the first
+// step towards localization. tinyxml (currently) only supports
+// english error messages, but the could now be translated.
+//
+// It also cleans up the code a bit.
+//
+
+const char* TiXmlBase::errorString[ TIXML_ERROR_STRING_COUNT ] =
+{
+ "No error",
+ "Error",
+ "Failed to open file",
+ "Memory allocation failed.",
+ "Error parsing Element.",
+ "Failed to read Element name",
+ "Error reading Element value.",
+ "Error reading Attributes.",
+ "Error: empty tag.",
+ "Error reading end tag.",
+ "Error parsing Unknown.",
+ "Error parsing Comment.",
+ "Error parsing Declaration.",
+ "Error document empty.",
+ "Error null (0) or unexpected EOF found in input stream.",
+ "Error parsing CDATA.",
+ "Error when TiXmlDocument added to document, because TiXmlDocument can only be at the root.",
+};
Index: tags/agile-1.2.0/src/Tools/TinyXML/tinyxmlparser.cpp
===================================================================
--- tags/agile-1.2.0/src/Tools/TinyXML/tinyxmlparser.cpp (revision 0)
+++ tags/agile-1.2.0/src/Tools/TinyXML/tinyxmlparser.cpp (revision 755)
@@ -0,0 +1,1594 @@
+/*
+www.sourceforge.net/projects/tinyxml
+Original code (2.0 and earlier )copyright (c) 2000-2002 Lee Thomason (www.grinninglizard.com)
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any
+damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any
+purpose, including commercial applications, and to alter it and
+redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must
+not claim that you wrote the original software. If you use this
+software in a product, an acknowledgment in the product documentation
+would be appreciated but is not required.
+
+2. Altered source versions must be plainly marked as such, and
+must not be misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source
+distribution.
+*/
+
+#include <ctype.h>
+#include <stddef.h>
+
+#include "tinyxml.h"
+
+//#define DEBUG_PARSER
+#if defined( DEBUG_PARSER )
+# if defined( DEBUG ) && defined( _MSC_VER )
+# include <windows.h>
+# define TIXML_LOG OutputDebugString
+# else
+# define TIXML_LOG printf
+# endif
+#endif
+
+// Note tha "PutString" hardcodes the same list. This
+// is less flexible than it appears. Changing the entries
+// or order will break putstring.
+TiXmlBase::Entity TiXmlBase::entity[ NUM_ENTITY ] =
+{
+ { "&amp;", 5, '&' },
+ { "&lt;", 4, '<' },
+ { "&gt;", 4, '>' },
+ { "&quot;", 6, '\"' },
+ { "&apos;", 6, '\'' }
+};
+
+// Bunch of unicode info at:
+// http://www.unicode.org/faq/utf_bom.html
+// Including the basic of this table, which determines the #bytes in the
+// sequence from the lead byte. 1 placed for invalid sequences --
+// although the result will be junk, pass it through as much as possible.
+// Beware of the non-characters in UTF-8:
+// ef bb bf (Microsoft "lead bytes")
+// ef bf be
+// ef bf bf
+
+const unsigned char TIXML_UTF_LEAD_0 = 0xefU;
+const unsigned char TIXML_UTF_LEAD_1 = 0xbbU;
+const unsigned char TIXML_UTF_LEAD_2 = 0xbfU;
+
+const int TiXmlBase::utf8ByteTable[256] =
+{
+ // 0 1 2 3 4 5 6 7 8 9 a b c d e f
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x00
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x10
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x20
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x30
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x40
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x50
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x60
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x70 End of ASCII range
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x80 0x80 to 0xc1 invalid
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0x90
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0xa0
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0xb0
+ 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xc0 0xc2 to 0xdf 2 byte
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // 0xd0
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 0xe0 0xe0 to 0xef 3 byte
+ 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // 0xf0 0xf0 to 0xf4 4 byte, 0xf5 and higher invalid
+};
+
+
+void TiXmlBase::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length )
+{
+ const unsigned long BYTE_MASK = 0xBF;
+ const unsigned long BYTE_MARK = 0x80;
+ const unsigned long FIRST_BYTE_MARK[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
+
+ if (input < 0x80)
+ *length = 1;
+ else if ( input < 0x800 )
+ *length = 2;
+ else if ( input < 0x10000 )
+ *length = 3;
+ else if ( input < 0x200000 )
+ *length = 4;
+ else
+ { *length = 0; return; } // This code won't covert this correctly anyway.
+
+ output += *length;
+
+ // Scary scary fall throughs.
+ switch (*length)
+ {
+ case 4:
+ --output;
+ *output = (char)((input | BYTE_MARK) & BYTE_MASK);
+ input >>= 6;
+ case 3:
+ --output;
+ *output = (char)((input | BYTE_MARK) & BYTE_MASK);
+ input >>= 6;
+ case 2:
+ --output;
+ *output = (char)((input | BYTE_MARK) & BYTE_MASK);
+ input >>= 6;
+ case 1:
+ --output;
+ *output = (char)(input | FIRST_BYTE_MARK[*length]);
+ }
+}
+
+
+/*static*/ int TiXmlBase::IsAlpha( unsigned char anyByte, TiXmlEncoding /*encoding*/ )
+{
+ // This will only work for low-ascii, everything else is assumed to be a valid
+ // letter. I'm not sure this is the best approach, but it is quite tricky trying
+ // to figure out alhabetical vs. not across encoding. So take a very
+ // conservative approach.
+
+// if ( encoding == TIXML_ENCODING_UTF8 )
+// {
+ if ( anyByte < 127 )
+ return isalpha( anyByte );
+ else
+ return 1; // What else to do? The unicode set is huge...get the english ones right.
+// }
+// else
+// {
+// return isalpha( anyByte );
+// }
+}
+
+
+/*static*/ int TiXmlBase::IsAlphaNum( unsigned char anyByte, TiXmlEncoding /*encoding*/ )
+{
+ // This will only work for low-ascii, everything else is assumed to be a valid
+ // letter. I'm not sure this is the best approach, but it is quite tricky trying
+ // to figure out alhabetical vs. not across encoding. So take a very
+ // conservative approach.
+
+// if ( encoding == TIXML_ENCODING_UTF8 )
+// {
+ if ( anyByte < 127 )
+ return isalnum( anyByte );
+ else
+ return 1; // What else to do? The unicode set is huge...get the english ones right.
+// }
+// else
+// {
+// return isalnum( anyByte );
+// }
+}
+
+
+class TiXmlParsingData
+{
+ friend class TiXmlDocument;
+ public:
+ void Stamp( const char* now, TiXmlEncoding encoding );
+
+ const TiXmlCursor& Cursor() { return cursor; }
+
+ private:
+ // Only used by the document!
+ TiXmlParsingData( const char* start, int _tabsize, int row, int col )
+ {
+ assert( start );
+ stamp = start;
+ tabsize = _tabsize;
+ cursor.row = row;
+ cursor.col = col;
+ }
+
+ TiXmlCursor cursor;
+ const char* stamp;
+ int tabsize;
+};
+
+
+void TiXmlParsingData::Stamp( const char* now, TiXmlEncoding encoding )
+{
+ assert( now );
+
+ // Do nothing if the tabsize is 0.
+ if ( tabsize < 1 )
+ {
+ return;
+ }
+
+ // Get the current row, column.
+ int row = cursor.row;
+ int col = cursor.col;
+ const char* p = stamp;
+ assert( p );
+
+ while ( p < now )
+ {
+ // Treat p as unsigned, so we have a happy compiler.
+ const unsigned char* pU = (const unsigned char*)p;
+
+ // Code contributed by Fletcher Dunn: (modified by lee)
+ switch (*pU) {
+ case 0:
+ // We *should* never get here, but in case we do, don't
+ // advance past the terminating null character, ever
+ return;
+
+ case '\r':
+ // bump down to the next line
+ ++row;
+ col = 0;
+ // Eat the character
+ ++p;
+
+ // Check for \r\n sequence, and treat this as a single character
+ if (*p == '\n') {
+ ++p;
+ }
+ break;
+
+ case '\n':
+ // bump down to the next line
+ ++row;
+ col = 0;
+
+ // Eat the character
+ ++p;
+
+ // Check for \n\r sequence, and treat this as a single
+ // character. (Yes, this bizarre thing does occur still
+ // on some arcane platforms...)
+ if (*p == '\r') {
+ ++p;
+ }
+ break;
+
+ case '\t':
+ // Eat the character
+ ++p;
+
+ // Skip to next tab stop
+ col = (col / tabsize + 1) * tabsize;
+ break;
+
+ case TIXML_UTF_LEAD_0:
+ if ( encoding == TIXML_ENCODING_UTF8 )
+ {
+ if ( *(p+1) && *(p+2) )
+ {
+ // In these cases, don't advance the column. These are
+ // 0-width spaces.
+ if ( *(pU+1)==TIXML_UTF_LEAD_1 && *(pU+2)==TIXML_UTF_LEAD_2 )
+ p += 3;
+ else if ( *(pU+1)==0xbfU && *(pU+2)==0xbeU )
+ p += 3;
+ else if ( *(pU+1)==0xbfU && *(pU+2)==0xbfU )
+ p += 3;
+ else
+ { p +=3; ++col; } // A normal character.
+ }
+ }
+ else
+ {
+ ++p;
+ ++col;
+ }
+ break;
+
+ default:
+ if ( encoding == TIXML_ENCODING_UTF8 )
+ {
+ // Eat the 1 to 4 byte utf8 character.
+ int step = TiXmlBase::utf8ByteTable[*((const unsigned char*)p)];
+ if ( step == 0 )
+ step = 1; // Error case from bad encoding, but handle gracefully.
+ p += step;
+
+ // Just advance one column, of course.
+ ++col;
+ }
+ else
+ {
+ ++p;
+ ++col;
+ }
+ break;
+ }
+ }
+ cursor.row = row;
+ cursor.col = col;
+ assert( cursor.row >= -1 );
+ assert( cursor.col >= -1 );
+ stamp = p;
+ assert( stamp );
+}
+
+
+const char* TiXmlBase::SkipWhiteSpace( const char* p, TiXmlEncoding encoding )
+{
+ if ( !p || !*p )
+ {
+ return 0;
+ }
+ if ( encoding == TIXML_ENCODING_UTF8 )
+ {
+ while ( *p )
+ {
+ const unsigned char* pU = (const unsigned char*)p;
+
+ // Skip the stupid Microsoft UTF-8 Byte order marks
+ if ( *(pU+0)==TIXML_UTF_LEAD_0
+ && *(pU+1)==TIXML_UTF_LEAD_1
+ && *(pU+2)==TIXML_UTF_LEAD_2 )
+ {
+ p += 3;
+ continue;
+ }
+ else if(*(pU+0)==TIXML_UTF_LEAD_0
+ && *(pU+1)==0xbfU
+ && *(pU+2)==0xbeU )
+ {
+ p += 3;
+ continue;
+ }
+ else if(*(pU+0)==TIXML_UTF_LEAD_0
+ && *(pU+1)==0xbfU
+ && *(pU+2)==0xbfU )
+ {
+ p += 3;
+ continue;
+ }
+
+ if ( IsWhiteSpace( *p ) || *p == '\n' || *p =='\r' ) // Still using old rules for white space.
+ ++p;
+ else
+ break;
+ }
+ }
+ else
+ {
+ while ( (*p && IsWhiteSpace( *p )) || *p == '\n' || *p =='\r' )
+ ++p;
+ }
+
+ return p;
+}
+
+/*static*/ bool TiXmlBase::StreamWhiteSpace( std::istream * in, TIXML_STRING * tag )
+{
+ for( ;; )
+ {
+ if ( !in->good() ) return false;
+
+ int c = in->peek();
+ // At this scope, we can't get to a document. So fail silently.
+ if ( !IsWhiteSpace( c ) || c <= 0 )
+ return true;
+
+ *tag += (char) in->get();
+ }
+}
+
+/*static*/ bool TiXmlBase::StreamTo( std::istream * in, int character, TIXML_STRING * tag )
+{
+ //assert( character > 0 && character < 128 ); // else it won't work in utf-8
+ while ( in->good() )
+ {
+ int c = in->peek();
+ if ( c == character )
+ return true;
+ if ( c <= 0 ) // Silent failure: can't get document at this scope
+ return false;
+
+ in->get();
+ *tag += (char) c;
+ }
+ return false;
+}
+
+// One of TinyXML's more performance demanding functions. Try to keep the memory overhead down. The
+// "assign" optimization removes over 10% of the execution time.
+//
+const char* TiXmlBase::ReadName( const char* p, TIXML_STRING * name, TiXmlEncoding encoding )
+{
+ // Oddly, not supported on some comilers,
+ //name->clear();
+ // So use this:
+ *name = "";
+ assert( p );
+
+ // Names start with letters or underscores.
+ // Of course, in unicode, tinyxml has no idea what a letter *is*. The
+ // algorithm is generous.
+ //
+ // After that, they can be letters, underscores, numbers,
+ // hyphens, or colons. (Colons are valid ony for namespaces,
+ // but tinyxml can't tell namespaces from names.)
+ if ( p && *p
+ && ( IsAlpha( (unsigned char) *p, encoding ) || *p == '_' ) )
+ {
+ const char* start = p;
+ while( p && *p
+ && ( IsAlphaNum( (unsigned char ) *p, encoding )
+ || *p == '_'
+ || *p == '-'
+ || *p == '.'
+ || *p == ':' ) )
+ {
+ //(*name) += *p; // expensive
+ ++p;
+ }
+ if ( p-start > 0 ) {
+ name->assign( start, p-start );
+ }
+ return p;
+ }
+ return 0;
+}
+
+const char* TiXmlBase::GetEntity( const char* p, char* value, int* length, TiXmlEncoding encoding )
+{
+ // Presume an entity, and pull it out.
+ TIXML_STRING ent;
+ int i;
+ *length = 0;
+
+ if ( *(p+1) && *(p+1) == '#' && *(p+2) )
+ {
+ unsigned long ucs = 0;
+ ptrdiff_t delta = 0;
+ unsigned mult = 1;
+
+ if ( *(p+2) == 'x' )
+ {
+ // Hexadecimal.
+ if ( !*(p+3) ) return 0;
+
+ const char* q = p+3;
+ q = strchr( q, ';' );
+
+ if ( !q || !*q ) return 0;
+
+ delta = q-p;
+ --q;
+
+ while ( *q != 'x' )
+ {
+ if ( *q >= '0' && *q <= '9' )
+ ucs += mult * (*q - '0');
+ else if ( *q >= 'a' && *q <= 'f' )
+ ucs += mult * (*q - 'a' + 10);
+ else if ( *q >= 'A' && *q <= 'F' )
+ ucs += mult * (*q - 'A' + 10 );
+ else
+ return 0;
+ mult *= 16;
+ --q;
+ }
+ }
+ else
+ {
+ // Decimal.
+ if ( !*(p+2) ) return 0;
+
+ const char* q = p+2;
+ q = strchr( q, ';' );
+
+ if ( !q || !*q ) return 0;
+
+ delta = q-p;
+ --q;
+
+ while ( *q != '#' )
+ {
+ if ( *q >= '0' && *q <= '9' )
+ ucs += mult * (*q - '0');
+ else
+ return 0;
+ mult *= 10;
+ --q;
+ }
+ }
+ if ( encoding == TIXML_ENCODING_UTF8 )
+ {
+ // convert the UCS to UTF-8
+ ConvertUTF32ToUTF8( ucs, value, length );
+ }
+ else
+ {
+ *value = (char)ucs;
+ *length = 1;
+ }
+ return p + delta + 1;
+ }
+
+ // Now try to match it.
+ for( i=0; i<NUM_ENTITY; ++i )
+ {
+ if ( strncmp( entity[i].str, p, entity[i].strLength ) == 0 )
+ {
+ assert( strlen( entity[i].str ) == entity[i].strLength );
+ *value = entity[i].chr;
+ *length = 1;
+ return ( p + entity[i].strLength );
+ }
+ }
+
+ // So it wasn't an entity, its unrecognized, or something like that.
+ *value = *p; // Don't put back the last one, since we return it!
+ //*length = 1; // Leave unrecognized entities - this doesn't really work.
+ // Just writes strange XML.
+ return p+1;
+}
+
+
+bool TiXmlBase::StringEqual( const char* p,
+ const char* tag,
+ bool ignoreCase,
+ TiXmlEncoding encoding )
+{
+ assert( p );
+ assert( tag );
+ if ( !p || !*p )
+ {
+ assert( 0 );
+ return false;
+ }
+
+ const char* q = p;
+
+ if ( ignoreCase )
+ {
+ while ( *q && *tag && ToLower( *q, encoding ) == ToLower( *tag, encoding ) )
+ {
+ ++q;
+ ++tag;
+ }
+
+ if ( *tag == 0 )
+ return true;
+ }
+ else
+ {
+ while ( *q && *tag && *q == *tag )
+ {
+ ++q;
+ ++tag;
+ }
+
+ if ( *tag == 0 ) // Have we found the end of the tag, and everything equal?
+ return true;
+ }
+ return false;
+}
+
+const char* TiXmlBase::ReadText( const char* p,
+ TIXML_STRING * text,
+ bool trimWhiteSpace,
+ const char* endTag,
+ bool caseInsensitive,
+ TiXmlEncoding encoding )
+{
+ *text = "";
+ if ( !trimWhiteSpace // certain tags always keep whitespace
+ || !condenseWhiteSpace ) // if true, whitespace is always kept
+ {
+ // Keep all the white space.
+ while ( p && *p
+ && !StringEqual( p, endTag, caseInsensitive, encoding )
+ )
+ {
+ int len;
+ char cArr[4] = { 0, 0, 0, 0 };
+ p = GetChar( p, cArr, &len, encoding );
+ text->append( cArr, len );
+ }
+ }
+ else
+ {
+ bool whitespace = false;
+
+ // Remove leading white space:
+ p = SkipWhiteSpace( p, encoding );
+ while ( p && *p
+ && !StringEqual( p, endTag, caseInsensitive, encoding ) )
+ {
+ if ( *p == '\r' || *p == '\n' )
+ {
+ whitespace = true;
+ ++p;
+ }
+ else if ( IsWhiteSpace( *p ) )
+ {
+ whitespace = true;
+ ++p;
+ }
+ else
+ {
+ // If we've found whitespace, add it before the
+ // new character. Any whitespace just becomes a space.
+ if ( whitespace )
+ {
+ (*text) += ' ';
+ whitespace = false;
+ }
+ int len;
+ char cArr[4] = { 0, 0, 0, 0 };
+ p = GetChar( p, cArr, &len, encoding );
+ if ( len == 1 )
+ (*text) += cArr[0]; // more efficient
+ else
+ text->append( cArr, len );
+ }
+ }
+ }
+ if ( p )
+ p += strlen( endTag );
+ return p;
+}
+
+
+void TiXmlDocument::StreamIn( std::istream * in, TIXML_STRING * tag )
+{
+ // The basic issue with a document is that we don't know what we're
+ // streaming. Read something presumed to be a tag (and hope), then
+ // identify it, and call the appropriate stream method on the tag.
+ //
+ // This "pre-streaming" will never read the closing ">" so the
+ // sub-tag can orient itself.
+
+ if ( !StreamTo( in, '<', tag ) )
+ {
+ SetError( TIXML_ERROR_PARSING_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN );
+ return;
+ }
+
+ while ( in->good() )
+ {
+ int tagIndex = (int) tag->length();
+ while ( in->good() && in->peek() != '>' )
+ {
+ int c = in->get();
+ if ( c <= 0 )
+ {
+ SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN );
+ break;
+ }
+ (*tag) += (char) c;
+ }
+
+ if ( in->good() )
+ {
+ // We now have something we presume to be a node of
+ // some sort. Identify it, and call the node to
+ // continue streaming.
+ TiXmlNode* node = Identify( tag->c_str() + tagIndex, TIXML_DEFAULT_ENCODING );
+
+ if ( node )
+ {
+ node->StreamIn( in, tag );
+ bool isElement = node->ToElement() != 0;
+ delete node;
+ node = 0;
+
+ // If this is the root element, we're done. Parsing will be
+ // done by the >> operator.
+ if ( isElement )
+ {
+ return;
+ }
+ }
+ else
+ {
+ SetError( TIXML_ERROR, 0, 0, TIXML_ENCODING_UNKNOWN );
+ return;
+ }
+ }
+ }
+ // We should have returned sooner.
+ SetError( TIXML_ERROR, 0, 0, TIXML_ENCODING_UNKNOWN );
+}
+
+
+const char* TiXmlDocument::Parse( const char* p, TiXmlParsingData* prevData, TiXmlEncoding encoding )
+{
+ ClearError();
+
+ // Parse away, at the document level. Since a document
+ // contains nothing but other tags, most of what happens
+ // here is skipping white space.
+ if ( !p || !*p )
+ {
+ SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN );
+ return 0;
+ }
+
+ // Note that, for a document, this needs to come
+ // before the while space skip, so that parsing
+ // starts from the pointer we are given.
+ location.Clear();
+ if ( prevData )
+ {
+ location.row = prevData->cursor.row;
+ location.col = prevData->cursor.col;
+ }
+ else
+ {
+ location.row = 0;
+ location.col = 0;
+ }
+ TiXmlParsingData data( p, TabSize(), location.row, location.col );
+ location = data.Cursor();
+
+ if ( encoding == TIXML_ENCODING_UNKNOWN )
+ {
+ // Check for the Microsoft UTF-8 lead bytes.
+ const unsigned char* pU = (const unsigned char*)p;
+ if ( *(pU+0) && *(pU+0) == TIXML_UTF_LEAD_0
+ && *(pU+1) && *(pU+1) == TIXML_UTF_LEAD_1
+ && *(pU+2) && *(pU+2) == TIXML_UTF_LEAD_2 )
+ {
+ encoding = TIXML_ENCODING_UTF8;
+ useMicrosoftBOM = true;
+ }
+ }
+
+ p = SkipWhiteSpace( p, encoding );
+ if ( !p )
+ {
+ SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN );
+ return 0;
+ }
+
+ while ( p && *p )
+ {
+ TiXmlNode* node = Identify( p, encoding );
+ if ( node )
+ {
+ p = node->Parse( p, &data, encoding );
+ LinkEndChild( node );
+ }
+ else
+ {
+ break;
+ }
+
+ // Did we get encoding info?
+ if ( encoding == TIXML_ENCODING_UNKNOWN
+ && node->ToDeclaration() )
+ {
+ TiXmlDeclaration* dec = node->ToDeclaration();
+ const char* enc = dec->Encoding();
+ assert( enc );
+
+ if ( *enc == 0 )
+ encoding = TIXML_ENCODING_UTF8;
+ else if ( StringEqual( enc, "UTF-8", true, TIXML_ENCODING_UNKNOWN ) )
+ encoding = TIXML_ENCODING_UTF8;
+ else if ( StringEqual( enc, "UTF8", true, TIXML_ENCODING_UNKNOWN ) )
+ encoding = TIXML_ENCODING_UTF8; // incorrect, but be nice
+ else
+ encoding = TIXML_ENCODING_LEGACY;
+ }
+
+ p = SkipWhiteSpace( p, encoding );
+ }
+
+ // Was this empty?
+ if ( !firstChild ) {
+ SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, encoding );
+ return 0;
+ }
+
+ // All is well.
+ return p;
+}
+
+void TiXmlDocument::SetError( int err, const char* pError, TiXmlParsingData* data, TiXmlEncoding encoding )
+{
+ // The first error in a chain is more accurate - don't set again!
+ if ( error )
+ return;
+
+ assert( err > 0 && err < TIXML_ERROR_STRING_COUNT );
+ error = true;
+ errorId = err;
+ errorDesc = errorString[ errorId ];
+
+ errorLocation.Clear();
+ if ( pError && data )
+ {
+ data->Stamp( pError, encoding );
+ errorLocation = data->Cursor();
+ }
+}
+
+
+TiXmlNode* TiXmlNode::Identify( const char* p, TiXmlEncoding encoding )
+{
+ TiXmlNode* returnNode = 0;
+
+ p = SkipWhiteSpace( p, encoding );
+ if( !p || !*p || *p != '<' )
+ {
+ return 0;
+ }
+
+ TiXmlDocument* doc = GetDocument();
+ p = SkipWhiteSpace( p, encoding );
+
+ if ( !p || !*p )
+ {
+ return 0;
+ }
+
+ // What is this thing?
+ // - Elements start with a letter or underscore, but xml is reserved.
+ // - Comments: <!--
+ // - Decleration: <?xml
+ // - Everthing else is unknown to tinyxml.
+ //
+
+ const char* xmlHeader = { "<?xml" };
+ const char* commentHeader = { "<!--" };
+ const char* dtdHeader = { "<!" };
+ const char* cdataHeader = { "<![CDATA[" };
+
+ if ( StringEqual( p, xmlHeader, true, encoding ) )
+ {
+ #ifdef DEBUG_PARSER
+ TIXML_LOG( "XML parsing Declaration\n" );
+ #endif
+ returnNode = new TiXmlDeclaration();
+ }
+ else if ( StringEqual( p, commentHeader, false, encoding ) )
+ {
+ #ifdef DEBUG_PARSER
+ TIXML_LOG( "XML parsing Comment\n" );
+ #endif
+ returnNode = new TiXmlComment();
+ }
+ else if ( StringEqual( p, cdataHeader, false, encoding ) )
+ {
+ #ifdef DEBUG_PARSER
+ TIXML_LOG( "XML parsing CDATA\n" );
+ #endif
+ TiXmlText* text = new TiXmlText( "" );
+ text->SetCDATA( true );
+ returnNode = text;
+ }
+ else if ( StringEqual( p, dtdHeader, false, encoding ) )
+ {
+ #ifdef DEBUG_PARSER
+ TIXML_LOG( "XML parsing Unknown(1)\n" );
+ #endif
+ returnNode = new TiXmlUnknown();
+ }
+ else if ( IsAlpha( *(p+1), encoding )
+ || *(p+1) == '_' )
+ {
+ #ifdef DEBUG_PARSER
+ TIXML_LOG( "XML parsing Element\n" );
+ #endif
+ returnNode = new TiXmlElement( "" );
+ }
+ else
+ {
+ #ifdef DEBUG_PARSER
+ TIXML_LOG( "XML parsing Unknown(2)\n" );
+ #endif
+ returnNode = new TiXmlUnknown();
+ }
+
+ if ( returnNode )
+ {
+ // Set the parent, so it can report errors
+ returnNode->parent = this;
+ }
+ else
+ {
+ if ( doc )
+ doc->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN );
+ }
+ return returnNode;
+}
+
+
+void TiXmlElement::StreamIn (std::istream * in, TIXML_STRING * tag)
+{
+ // We're called with some amount of pre-parsing. That is, some of "this"
+ // element is in "tag". Go ahead and stream to the closing ">"
+ while( in->good() )
+ {
+ int c = in->get();
+ if ( c <= 0 )
+ {
+ TiXmlDocument* document = GetDocument();
+ if ( document )
+ document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN );
+ return;
+ }
+ (*tag) += (char) c ;
+
+ if ( c == '>' )
+ break;
+ }
+
+ if ( tag->length() < 3 ) return;
+
+ // Okay...if we are a "/>" tag, then we're done. We've read a complete tag.
+ // If not, identify and stream.
+
+ if ( tag->at( tag->length() - 1 ) == '>'
+ && tag->at( tag->length() - 2 ) == '/' )
+ {
+ // All good!
+ return;
+ }
+ else if ( tag->at( tag->length() - 1 ) == '>' )
+ {
+ // There is more. Could be:
+ // text
+ // cdata text (which looks like another node)
+ // closing tag
+ // another node.
+ for ( ;; )
+ {
+ StreamWhiteSpace( in, tag );
+
+ // Do we have text?
+ if ( in->good() && in->peek() != '<' )
+ {
+ // Yep, text.
+ TiXmlText text( "" );
+ text.StreamIn( in, tag );
+
+ // What follows text is a closing tag or another node.
+ // Go around again and figure it out.
+ continue;
+ }
+
+ // We now have either a closing tag...or another node.
+ // We should be at a "<", regardless.
+ if ( !in->good() ) return;
+ assert( in->peek() == '<' );
+ int tagIndex = (int) tag->length();
+
+ bool closingTag = false;
+ bool firstCharFound = false;
+
+ for( ;; )
+ {
+ if ( !in->good() )
+ return;
+
+ int c = in->peek();
+ if ( c <= 0 )
+ {
+ TiXmlDocument* document = GetDocument();
+ if ( document )
+ document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN );
+ return;
+ }
+
+ if ( c == '>' )
+ break;
+
+ *tag += (char) c;
+ in->get();
+
+ // Early out if we find the CDATA id.
+ if ( c == '[' && tag->size() >= 9 )
+ {
+ size_t len = tag->size();
+ const char* start = tag->c_str() + len - 9;
+ if ( strcmp( start, "<![CDATA[" ) == 0 ) {
+ assert( !closingTag );
+ break;
+ }
+ }
+
+ if ( !firstCharFound && c != '<' && !IsWhiteSpace( c ) )
+ {
+ firstCharFound = true;
+ if ( c == '/' )
+ closingTag = true;
+ }
+ }
+ // If it was a closing tag, then read in the closing '>' to clean up the input stream.
+ // If it was not, the streaming will be done by the tag.
+ if ( closingTag )
+ {
+ if ( !in->good() )
+ return;
+
+ int c = in->get();
+ if ( c <= 0 )
+ {
+ TiXmlDocument* document = GetDocument();
+ if ( document )
+ document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN );
+ return;
+ }
+ assert( c == '>' );
+ *tag += (char) c;
+
+ // We are done, once we've found our closing tag.
+ return;
+ }
+ else
+ {
+ // If not a closing tag, id it, and stream.
+ const char* tagloc = tag->c_str() + tagIndex;
+ TiXmlNode* node = Identify( tagloc, TIXML_DEFAULT_ENCODING );
+ if ( !node )
+ return;
+ node->StreamIn( in, tag );
+ delete node;
+ node = 0;
+
+ // No return: go around from the beginning: text, closing tag, or node.
+ }
+ }
+ }
+}
+
+
+const char* TiXmlElement::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding )
+{
+ p = SkipWhiteSpace( p, encoding );
+ TiXmlDocument* document = GetDocument();
+
+ if ( !p || !*p )
+ {
+ if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, 0, 0, encoding );
+ return 0;
+ }
+
+ if ( data )
+ {
+ data->Stamp( p, encoding );
+ location = data->Cursor();
+ }
+
+ if ( *p != '<' )
+ {
+ if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, p, data, encoding );
+ return 0;
+ }
+
+ p = SkipWhiteSpace( p+1, encoding );
+
+ // Read the name.
+ const char* pErr = p;
+
+ p = ReadName( p, &value, encoding );
+ if ( !p || !*p )
+ {
+ if ( document ) document->SetError( TIXML_ERROR_FAILED_TO_READ_ELEMENT_NAME, pErr, data, encoding );
+ return 0;
+ }
+
+ TIXML_STRING endTag ("</");
+ endTag += value;
+ endTag += ">";
+
+ // Check for and read attributes. Also look for an empty
+ // tag or an end tag.
+ while ( p && *p )
+ {
+ pErr = p;
+ p = SkipWhiteSpace( p, encoding );
+ if ( !p || !*p )
+ {
+ if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, pErr, data, encoding );
+ return 0;
+ }
+ if ( *p == '/' )
+ {
+ ++p;
+ // Empty tag.
+ if ( *p != '>' )
+ {
+ if ( document ) document->SetError( TIXML_ERROR_PARSING_EMPTY, p, data, encoding );
+ return 0;
+ }
+ return (p+1);
+ }
+ else if ( *p == '>' )
+ {
+ // Done with attributes (if there were any.)
+ // Read the value -- which can include other
+ // elements -- read the end tag, and return.
+ ++p;
+ p = ReadValue( p, data, encoding ); // Note this is an Element method, and will set the error if one happens.
+ if ( !p || !*p )
+ return 0;
+
+ // We should find the end tag now
+ if ( StringEqual( p, endTag.c_str(), false, encoding ) )
+ {
+ p += endTag.length();
+ return p;
+ }
+ else
+ {
+ if ( document ) document->SetError( TIXML_ERROR_READING_END_TAG, p, data, encoding );
+ return 0;
+ }
+ }
+ else
+ {
+ // Try to read an attribute:
+ TiXmlAttribute* attrib = new TiXmlAttribute();
+ if ( !attrib )
+ {
+ if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, pErr, data, encoding );
+ return 0;
+ }
+
+ attrib->SetDocument( document );
+ pErr = p;
+ p = attrib->Parse( p, data, encoding );
+
+ if ( !p || !*p )
+ {
+ if ( document ) document->SetError( TIXML_ERROR_PARSING_ELEMENT, pErr, data, encoding );
+ delete attrib;
+ return 0;
+ }
+
+ // Handle the strange case of double attributes:
+ TiXmlAttribute* node = attributeSet.Find( attrib->NameTStr() );
+ if ( node )
+ {
+ node->SetValue( attrib->Value() );
+ delete attrib;
+ return 0;
+ }
+
+ attributeSet.Add( attrib );
+ }
+ }
+ return p;
+}
+
+
+const char* TiXmlElement::ReadValue( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding )
+{
+ TiXmlDocument* document = GetDocument();
+
+ // Read in text and elements in any order.
+ const char* pWithWhiteSpace = p;
+ p = SkipWhiteSpace( p, encoding );
+
+ while ( p && *p )
+ {
+ if ( *p != '<' )
+ {
+ // Take what we have, make a text element.
+ TiXmlText* textNode = new TiXmlText( "" );
+
+ if ( !textNode )
+ {
+ if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, encoding );
+ return 0;
+ }
+
+ if ( TiXmlBase::IsWhiteSpaceCondensed() )
+ {
+ p = textNode->Parse( p, data, encoding );
+ }
+ else
+ {
+ // Special case: we want to keep the white space
+ // so that leading spaces aren't removed.
+ p = textNode->Parse( pWithWhiteSpace, data, encoding );
+ }
+
+ if ( !textNode->Blank() )
+ LinkEndChild( textNode );
+ else
+ delete textNode;
+ }
+ else
+ {
+ // We hit a '<'
+ // Have we hit a new element or an end tag? This could also be
+ // a TiXmlText in the "CDATA" style.
+ if ( StringEqual( p, "</", false, encoding ) )
+ {
+ return p;
+ }
+ else
+ {
+ TiXmlNode* node = Identify( p, encoding );
+ if ( node )
+ {
+ p = node->Parse( p, data, encoding );
+ LinkEndChild( node );
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ }
+ pWithWhiteSpace = p;
+ p = SkipWhiteSpace( p, encoding );
+ }
+
+ if ( !p )
+ {
+ if ( document ) document->SetError( TIXML_ERROR_READING_ELEMENT_VALUE, 0, 0, encoding );
+ }
+ return p;
+}
+
+
+void TiXmlUnknown::StreamIn( std::istream * in, TIXML_STRING * tag )
+{
+ while ( in->good() )
+ {
+ int c = in->get();
+ if ( c <= 0 )
+ {
+ TiXmlDocument* document = GetDocument();
+ if ( document )
+ document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN );
+ return;
+ }
+ (*tag) += (char) c;
+
+ if ( c == '>' )
+ {
+ // All is well.
+ return;
+ }
+ }
+}
+
+
+const char* TiXmlUnknown::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding )
+{
+ TiXmlDocument* document = GetDocument();
+ p = SkipWhiteSpace( p, encoding );
+
+ if ( data )
+ {
+ data->Stamp( p, encoding );
+ location = data->Cursor();
+ }
+ if ( !p || !*p || *p != '<' )
+ {
+ if ( document ) document->SetError( TIXML_ERROR_PARSING_UNKNOWN, p, data, encoding );
+ return 0;
+ }
+ ++p;
+ value = "";
+
+ while ( p && *p && *p != '>' )
+ {
+ value += *p;
+ ++p;
+ }
+
+ if ( !p )
+ {
+ if ( document ) document->SetError( TIXML_ERROR_PARSING_UNKNOWN, 0, 0, encoding );
+ }
+ if ( *p == '>' )
+ return p+1;
+ return p;
+}
+
+
+void TiXmlComment::StreamIn( std::istream * in, TIXML_STRING * tag )
+{
+ while ( in->good() )
+ {
+ int c = in->get();
+ if ( c <= 0 )
+ {
+ TiXmlDocument* document = GetDocument();
+ if ( document )
+ document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN );
+ return;
+ }
+
+ (*tag) += (char) c;
+
+ if ( c == '>'
+ && tag->at( tag->length() - 2 ) == '-'
+ && tag->at( tag->length() - 3 ) == '-' )
+ {
+ // All is well.
+ return;
+ }
+ }
+}
+
+
+const char* TiXmlComment::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding )
+{
+ TiXmlDocument* document = GetDocument();
+ value = "";
+
+ p = SkipWhiteSpace( p, encoding );
+
+ if ( data )
+ {
+ data->Stamp( p, encoding );
+ location = data->Cursor();
+ }
+ const char* startTag = "<!--";
+ const char* endTag = "-->";
+
+ if ( !StringEqual( p, startTag, false, encoding ) )
+ {
+ document->SetError( TIXML_ERROR_PARSING_COMMENT, p, data, encoding );
+ return 0;
+ }
+ p += strlen( startTag );
+ p = ReadText( p, &value, false, endTag, false, encoding );
+ return p;
+}
+
+
+const char* TiXmlAttribute::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding )
+{
+ p = SkipWhiteSpace( p, encoding );
+ if ( !p || !*p ) return 0;
+
+// int tabsize = 4;
+// if ( document )
+// tabsize = document->TabSize();
+
+ if ( data )
+ {
+ data->Stamp( p, encoding );
+ location = data->Cursor();
+ }
+ // Read the name, the '=' and the value.
+ const char* pErr = p;
+ p = ReadName( p, &name, encoding );
+ if ( !p || !*p )
+ {
+ if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, pErr, data, encoding );
+ return 0;
+ }
+ p = SkipWhiteSpace( p, encoding );
+ if ( !p || !*p || *p != '=' )
+ {
+ if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding );
+ return 0;
+ }
+
+ ++p; // skip '='
+ p = SkipWhiteSpace( p, encoding );
+ if ( !p || !*p )
+ {
+ if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding );
+ return 0;
+ }
+
+ const char* end;
+ const char SINGLE_QUOTE = '\'';
+ const char DOUBLE_QUOTE = '\"';
+
+ if ( *p == SINGLE_QUOTE )
+ {
+ ++p;
+ end = "\'"; // single quote in string
+ p = ReadText( p, &value, false, end, false, encoding );
+ }
+ else if ( *p == DOUBLE_QUOTE )
+ {
+ ++p;
+ end = "\""; // double quote in string
+ p = ReadText( p, &value, false, end, false, encoding );
+ }
+ else
+ {
+ // All attribute values should be in single or double quotes.
+ // But this is such a common error that the parser will try
+ // its best, even without them.
+ value = "";
+ while ( p && *p // existence
+ && !IsWhiteSpace( *p ) && *p != '\n' && *p != '\r' // whitespace
+ && *p != '/' && *p != '>' ) // tag end
+ {
+ if ( *p == SINGLE_QUOTE || *p == DOUBLE_QUOTE ) {
+ // [ 1451649 ] Attribute values with trailing quotes not handled correctly
+ // We did not have an opening quote but seem to have a
+ // closing one. Give up and throw an error.
+ if ( document ) document->SetError( TIXML_ERROR_READING_ATTRIBUTES, p, data, encoding );
+ return 0;
+ }
+ value += *p;
+ ++p;
+ }
+ }
+ return p;
+}
+
+
+void TiXmlText::StreamIn( std::istream * in, TIXML_STRING * tag )
+{
+ while ( in->good() )
+ {
+ int c = in->peek();
+ if ( !cdata && (c == '<' ) )
+ {
+ return;
+ }
+ if ( c <= 0 )
+ {
+ TiXmlDocument* document = GetDocument();
+ if ( document )
+ document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN );
+ return;
+ }
+
+ (*tag) += (char) c;
+ in->get(); // "commits" the peek made above
+
+ if ( cdata && c == '>' && tag->size() >= 3 ) {
+ size_t len = tag->size();
+ if ( (*tag)[len-2] == ']' && (*tag)[len-3] == ']' ) {
+ // terminator of cdata.
+ return;
+ }
+ }
+ }
+}
+
+
+const char* TiXmlText::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding encoding )
+{
+ value = "";
+ TiXmlDocument* document = GetDocument();
+
+ if ( data )
+ {
+ data->Stamp( p, encoding );
+ location = data->Cursor();
+ }
+
+ const char* const startTag = "<![CDATA[";
+ const char* const endTag = "]]>";
+
+ if ( cdata || StringEqual( p, startTag, false, encoding ) )
+ {
+ cdata = true;
+
+ if ( !StringEqual( p, startTag, false, encoding ) )
+ {
+ document->SetError( TIXML_ERROR_PARSING_CDATA, p, data, encoding );
+ return 0;
+ }
+ p += strlen( startTag );
+
+ // Keep all the white space, ignore the encoding, etc.
+ while ( p && *p
+ && !StringEqual( p, endTag, false, encoding )
+ )
+ {
+ value += *p;
+ ++p;
+ }
+
+ TIXML_STRING dummy;
+ p = ReadText( p, &dummy, false, endTag, false, encoding );
+ return p;
+ }
+ else
+ {
+ bool ignoreWhite = true;
+
+ const char* end = "<";
+ p = ReadText( p, &value, ignoreWhite, end, false, encoding );
+ if ( p )
+ return p-1; // don't truncate the '<'
+ return 0;
+ }
+}
+
+
+void TiXmlDeclaration::StreamIn( std::istream * in, TIXML_STRING * tag )
+{
+ while ( in->good() )
+ {
+ int c = in->get();
+ if ( c <= 0 )
+ {
+ TiXmlDocument* document = GetDocument();
+ if ( document )
+ document->SetError( TIXML_ERROR_EMBEDDED_NULL, 0, 0, TIXML_ENCODING_UNKNOWN );
+ return;
+ }
+ (*tag) += (char) c;
+
+ if ( c == '>' )
+ {
+ // All is well.
+ return;
+ }
+ }
+}
+
+
+const char* TiXmlDeclaration::Parse( const char* p, TiXmlParsingData* data, TiXmlEncoding _encoding )
+{
+ p = SkipWhiteSpace( p, _encoding );
+ // Find the beginning, find the end, and look for
+ // the stuff in-between.
+ TiXmlDocument* document = GetDocument();
+ if ( !p || !*p || !StringEqual( p, "<?xml", true, _encoding ) )
+ {
+ if ( document ) document->SetError( TIXML_ERROR_PARSING_DECLARATION, 0, 0, _encoding );
+ return 0;
+ }
+ if ( data )
+ {
+ data->Stamp( p, _encoding );
+ location = data->Cursor();
+ }
+ p += 5;
+
+ version = "";
+ encoding = "";
+ standalone = "";
+
+ while ( p && *p )
+ {
+ if ( *p == '>' )
+ {
+ ++p;
+ return p;
+ }
+
+ p = SkipWhiteSpace( p, _encoding );
+ if ( StringEqual( p, "version", true, _encoding ) )
+ {
+ TiXmlAttribute attrib;
+ p = attrib.Parse( p, data, _encoding );
+ version = attrib.Value();
+ }
+ else if ( StringEqual( p, "encoding", true, _encoding ) )
+ {
+ TiXmlAttribute attrib;
+ p = attrib.Parse( p, data, _encoding );
+ encoding = attrib.Value();
+ }
+ else if ( StringEqual( p, "standalone", true, _encoding ) )
+ {
+ TiXmlAttribute attrib;
+ p = attrib.Parse( p, data, _encoding );
+ standalone = attrib.Value();
+ }
+ else
+ {
+ // Read over whatever it is.
+ while( p && *p && *p != '>' && !IsWhiteSpace( *p ) )
+ ++p;
+ }
+ }
+ return 0;
+}
+
+bool TiXmlText::Blank() const
+{
+ for ( unsigned i=0; i<value.length(); i++ )
+ if ( !IsWhiteSpace( value[i] ) )
+ return false;
+ return true;
+}
+
Index: tags/agile-1.2.0/src/Tools/TinyXML/tinyxml.cpp
===================================================================
--- tags/agile-1.2.0/src/Tools/TinyXML/tinyxml.cpp (revision 0)
+++ tags/agile-1.2.0/src/Tools/TinyXML/tinyxml.cpp (revision 755)
@@ -0,0 +1,1824 @@
+/*
+www.sourceforge.net/projects/tinyxml
+Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com)
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any
+damages arising from the use of this software.
+
+Permission is granted to anyone to use this software for any
+purpose, including commercial applications, and to alter it and
+redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must
+not claim that you wrote the original software. If you use this
+software in a product, an acknowledgment in the product documentation
+would be appreciated but is not required.
+
+2. Altered source versions must be plainly marked as such, and
+must not be misrepresented as being the original software.
+
+3. This notice may not be removed or altered from any source
+distribution.
+*/
+
+#include <ctype.h>
+#include <sstream>
+#include <iostream>
+#include "tinyxml.h"
+
+
+bool TiXmlBase::condenseWhiteSpace = true;
+
+void TiXmlBase::PutString( const TIXML_STRING& str, TIXML_STRING* outString )
+{
+ int i=0;
+
+ while( i<(int)str.length() )
+ {
+ unsigned char c = (unsigned char) str[i];
+
+ if ( c == '&'
+ && i < ( (int)str.length() - 2 )
+ && str[i+1] == '#'
+ && str[i+2] == 'x' )
+ {
+ // Hexadecimal character reference.
+ // Pass through unchanged.
+ // &#xA9; -- copyright symbol, for example.
+ //
+ // The -1 is a bug fix from Rob Laveaux. It keeps
+ // an overflow from happening if there is no ';'.
+ // There are actually 2 ways to exit this loop -
+ // while fails (error case) and break (semicolon found).
+ // However, there is no mechanism (currently) for
+ // this function to return an error.
+ while ( i<(int)str.length()-1 )
+ {
+ outString->append( str.c_str() + i, 1 );
+ ++i;
+ if ( str[i] == ';' )
+ break;
+ }
+ }
+ else if ( c == '&' )
+ {
+ outString->append( entity[0].str, entity[0].strLength );
+ ++i;
+ }
+ else if ( c == '<' )
+ {
+ outString->append( entity[1].str, entity[1].strLength );
+ ++i;
+ }
+ else if ( c == '>' )
+ {
+ outString->append( entity[2].str, entity[2].strLength );
+ ++i;
+ }
+ else if ( c == '\"' )
+ {
+ outString->append( entity[3].str, entity[3].strLength );
+ ++i;
+ }
+ else if ( c == '\'' )
+ {
+ outString->append( entity[4].str, entity[4].strLength );
+ ++i;
+ }
+ else if ( c < 32 )
+ {
+ // Easy pass at non-alpha/numeric/symbol
+ // Below 32 is symbolic.
+ char buf[ 32 ];
+
+ #if defined(TIXML_SNPRINTF)
+ TIXML_SNPRINTF( buf, sizeof(buf), "&#x%02X;", (unsigned) ( c & 0xff ) );
+ #else
+ sprintf( buf, "&#x%02X;", (unsigned) ( c & 0xff ) );
+ #endif
+
+ //*ME: warning C4267: convert 'size_t' to 'int'
+ //*ME: Int-Cast to make compiler happy ...
+ outString->append( buf, (int)strlen( buf ) );
+ ++i;
+ }
+ else
+ {
+ //char realc = (char) c;
+ //outString->append( &realc, 1 );
+ *outString += (char) c; // somewhat more efficient function call.
+ ++i;
+ }
+ }
+}
+
+
+TiXmlNode::TiXmlNode( NodeType _type ) : TiXmlBase()
+{
+ parent = 0;
+ type = _type;
+ firstChild = 0;
+ lastChild = 0;
+ prev = 0;
+ next = 0;
+}
+
+
+TiXmlNode::~TiXmlNode()
+{
+ TiXmlNode* node = firstChild;
+ TiXmlNode* temp = 0;
+
+ while ( node )
+ {
+ temp = node;
+ node = node->next;
+ delete temp;
+ }
+}
+
+
+void TiXmlNode::CopyTo( TiXmlNode* target ) const
+{
+ target->SetValue (value.c_str() );
+ target->userData = userData;
+}
+
+
+void TiXmlNode::Clear()
+{
+ TiXmlNode* node = firstChild;
+ TiXmlNode* temp = 0;
+
+ while ( node )
+ {
+ temp = node;
+ node = node->next;
+ delete temp;
+ }
+
+ firstChild = 0;
+ lastChild = 0;
+}
+
+
+TiXmlNode* TiXmlNode::LinkEndChild( TiXmlNode* node )
+{
+ assert( node->parent == 0 || node->parent == this );
+ assert( node->GetDocument() == 0 || node->GetDocument() == this->GetDocument() );
+
+ if ( node->Type() == TiXmlNode::DOCUMENT )
+ {
+ delete node;
+ if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
+ return 0;
+ }
+
+ node->parent = this;
+
+ node->prev = lastChild;
+ node->next = 0;
+
+ if ( lastChild )
+ lastChild->next = node;
+ else
+ firstChild = node; // it was an empty list.
+
+ lastChild = node;
+ return node;
+}
+
+
+TiXmlNode* TiXmlNode::InsertEndChild( const TiXmlNode& addThis )
+{
+ if ( addThis.Type() == TiXmlNode::DOCUMENT )
+ {
+ if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
+ return 0;
+ }
+ TiXmlNode* node = addThis.Clone();
+ if ( !node )
+ return 0;
+
+ return LinkEndChild( node );
+}
+
+
+TiXmlNode* TiXmlNode::InsertBeforeChild( TiXmlNode* beforeThis, const TiXmlNode& addThis )
+{
+ if ( !beforeThis || beforeThis->parent != this ) {
+ return 0;
+ }
+ if ( addThis.Type() == TiXmlNode::DOCUMENT )
+ {
+ if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
+ return 0;
+ }
+
+ TiXmlNode* node = addThis.Clone();
+ if ( !node )
+ return 0;
+ node->parent = this;
+
+ node->next = beforeThis;
+ node->prev = beforeThis->prev;
+ if ( beforeThis->prev )
+ {
+ beforeThis->prev->next = node;
+ }
+ else
+ {
+ assert( firstChild == beforeThis );
+ firstChild = node;
+ }
+ beforeThis->prev = node;
+ return node;
+}
+
+
+TiXmlNode* TiXmlNode::InsertAfterChild( TiXmlNode* afterThis, const TiXmlNode& addThis )
+{
+ if ( !afterThis || afterThis->parent != this ) {
+ return 0;
+ }
+ if ( addThis.Type() == TiXmlNode::DOCUMENT )
+ {
+ if ( GetDocument() ) GetDocument()->SetError( TIXML_ERROR_DOCUMENT_TOP_ONLY, 0, 0, TIXML_ENCODING_UNKNOWN );
+ return 0;
+ }
+
+ TiXmlNode* node = addThis.Clone();
+ if ( !node )
+ return 0;
+ node->parent = this;
+
+ node->prev = afterThis;
+ node->next = afterThis->next;
+ if ( afterThis->next )
+ {
+ afterThis->next->prev = node;
+ }
+ else
+ {
+ assert( lastChild == afterThis );
+ lastChild = node;
+ }
+ afterThis->next = node;
+ return node;
+}
+
+
+TiXmlNode* TiXmlNode::ReplaceChild( TiXmlNode* replaceThis, const TiXmlNode& withThis )
+{
+ if ( replaceThis->parent != this )
+ return 0;
+
+ TiXmlNode* node = withThis.Clone();
+ if ( !node )
+ return 0;
+
+ node->next = replaceThis->next;
+ node->prev = replaceThis->prev;
+
+ if ( replaceThis->next )
+ replaceThis->next->prev = node;
+ else
+ lastChild = node;
+
+ if ( replaceThis->prev )
+ replaceThis->prev->next = node;
+ else
+ firstChild = node;
+
+ delete replaceThis;
+ node->parent = this;
+ return node;
+}
+
+
+bool TiXmlNode::RemoveChild( TiXmlNode* removeThis )
+{
+ if ( removeThis->parent != this )
+ {
+ assert( 0 );
+ return false;
+ }
+
+ if ( removeThis->next )
+ removeThis->next->prev = removeThis->prev;
+ else
+ lastChild = removeThis->prev;
+
+ if ( removeThis->prev )
+ removeThis->prev->next = removeThis->next;
+ else
+ firstChild = removeThis->next;
+
+ delete removeThis;
+ return true;
+}
+
+const TiXmlNode* TiXmlNode::FirstChild( const char * _value ) const
+{
+ const TiXmlNode* node;
+ for ( node = firstChild; node; node = node->next )
+ {
+ if ( strcmp( node->Value(), _value ) == 0 )
+ return node;
+ }
+ return 0;
+}
+
+
+const TiXmlNode* TiXmlNode::LastChild( const char * _value ) const
+{
+ const TiXmlNode* node;
+ for ( node = lastChild; node; node = node->prev )
+ {
+ if ( strcmp( node->Value(), _value ) == 0 )
+ return node;
+ }
+ return 0;
+}
+
+
+const TiXmlNode* TiXmlNode::IterateChildren( const TiXmlNode* previous ) const
+{
+ if ( !previous )
+ {
+ return FirstChild();
+ }
+ else
+ {
+ assert( previous->parent == this );
+ return previous->NextSibling();
+ }
+}
+
+
+const TiXmlNode* TiXmlNode::IterateChildren( const char * val, const TiXmlNode* previous ) const
+{
+ if ( !previous )
+ {
+ return FirstChild( val );
+ }
+ else
+ {
+ assert( previous->parent == this );
+ return previous->NextSibling( val );
+ }
+}
+
+
+const TiXmlNode* TiXmlNode::NextSibling( const char * _value ) const
+{
+ const TiXmlNode* node;
+ for ( node = next; node; node = node->next )
+ {
+ if ( strcmp( node->Value(), _value ) == 0 )
+ return node;
+ }
+ return 0;
+}
+
+
+const TiXmlNode* TiXmlNode::PreviousSibling( const char * _value ) const
+{
+ const TiXmlNode* node;
+ for ( node = prev; node; node = node->prev )
+ {
+ if ( strcmp( node->Value(), _value ) == 0 )
+ return node;
+ }
+ return 0;
+}
+
+
+void TiXmlElement::RemoveAttribute( const char * name )
+{
+ TIXML_STRING str( name );
+ TiXmlAttribute* node = attributeSet.Find( str );
+ if ( node )
+ {
+ attributeSet.Remove( node );
+ delete node;
+ }
+}
+
+const TiXmlElement* TiXmlNode::FirstChildElement() const
+{
+ const TiXmlNode* node;
+
+ for ( node = FirstChild();
+ node;
+ node = node->NextSibling() )
+ {
+ if ( node->ToElement() )
+ return node->ToElement();
+ }
+ return 0;
+}
+
+
+const TiXmlElement* TiXmlNode::FirstChildElement( const char * _value ) const
+{
+ const TiXmlNode* node;
+
+ for ( node = FirstChild( _value );
+ node;
+ node = node->NextSibling( _value ) )
+ {
+ if ( node->ToElement() )
+ return node->ToElement();
+ }
+ return 0;
+}
+
+
+const TiXmlElement* TiXmlNode::NextSiblingElement() const
+{
+ const TiXmlNode* node;
+
+ for ( node = NextSibling();
+ node;
+ node = node->NextSibling() )
+ {
+ if ( node->ToElement() )
+ return node->ToElement();
+ }
+ return 0;
+}
+
+
+const TiXmlElement* TiXmlNode::NextSiblingElement( const char * _value ) const
+{
+ const TiXmlNode* node;
+
+ for ( node = NextSibling( _value );
+ node;
+ node = node->NextSibling( _value ) )
+ {
+ if ( node->ToElement() )
+ return node->ToElement();
+ }
+ return 0;
+}
+
+
+const TiXmlDocument* TiXmlNode::GetDocument() const
+{
+ const TiXmlNode* node;
+
+ for( node = this; node; node = node->parent )
+ {
+ if ( node->ToDocument() )
+ return node->ToDocument();
+ }
+ return 0;
+}
+
+
+TiXmlElement::TiXmlElement (const char * _value)
+ : TiXmlNode( TiXmlNode::ELEMENT )
+{
+ firstChild = lastChild = 0;
+ value = _value;
+}
+
+
+TiXmlElement::TiXmlElement( const std::string& _value )
+ : TiXmlNode( TiXmlNode::ELEMENT )
+{
+ firstChild = lastChild = 0;
+ value = _value;
+}
+
+
+TiXmlElement::TiXmlElement( const TiXmlElement& copy)
+ : TiXmlNode( TiXmlNode::ELEMENT )
+{
+ firstChild = lastChild = 0;
+ copy.CopyTo( this );
+}
+
+
+void TiXmlElement::operator=( const TiXmlElement& base )
+{
+ ClearThis();
+ base.CopyTo( this );
+}
+
+
+TiXmlElement::~TiXmlElement()
+{
+ ClearThis();
+}
+
+
+void TiXmlElement::ClearThis()
+{
+ Clear();
+ while( attributeSet.First() )
+ {
+ TiXmlAttribute* node = attributeSet.First();
+ attributeSet.Remove( node );
+ delete node;
+ }
+}
+
+
+const char* TiXmlElement::Attribute( const char* name ) const
+{
+ const TiXmlAttribute* node = attributeSet.Find( name );
+ if ( node )
+ return node->Value();
+ return 0;
+}
+
+
+const std::string* TiXmlElement::Attribute( const std::string& name ) const
+{
+ const TiXmlAttribute* node = attributeSet.Find( name );
+ if ( node )
+ return &node->ValueStr();
+ return 0;
+}
+
+
+const char* TiXmlElement::Attribute( const char* name, int* i ) const
+{
+ const char* s = Attribute( name );
+ if ( i )
+ {
+ if ( s ) {
+ *i = atoi( s );
+ }
+ else {
+ *i = 0;
+ }
+ }
+ return s;
+}
+
+
+const std::string* TiXmlElement::Attribute( const std::string& name, int* i ) const
+{
+ const std::string* s = Attribute( name );
+ if ( i )
+ {
+ if ( s ) {
+ *i = atoi( s->c_str() );
+ }
+ else {
+ *i = 0;
+ }
+ }
+ return s;
+}
+
+
+const char* TiXmlElement::Attribute( const char* name, double* d ) const
+{
+ const char* s = Attribute( name );
+ if ( d )
+ {
+ if ( s ) {
+ *d = atof( s );
+ }
+ else {
+ *d = 0;
+ }
+ }
+ return s;
+}
+
+
+const std::string* TiXmlElement::Attribute( const std::string& name, double* d ) const
+{
+ const std::string* s = Attribute( name );
+ if ( d )
+ {
+ if ( s ) {
+ *d = atof( s->c_str() );
+ }
+ else {
+ *d = 0;
+ }
+ }
+ return s;
+}
+
+
+int TiXmlElement::QueryIntAttribute( const char* name, int* ival ) const
+{
+ const TiXmlAttribute* node = attributeSet.Find( name );
+ if ( !node )
+ return TIXML_NO_ATTRIBUTE;
+ return node->QueryIntValue( ival );
+}
+
+
+int TiXmlElement::QueryIntAttribute( const std::string& name, int* ival ) const
+{
+ const TiXmlAttribute* node = attributeSet.Find( name );
+ if ( !node )
+ return TIXML_NO_ATTRIBUTE;
+ return node->QueryIntValue( ival );
+}
+
+
+
+int TiXmlElement::QueryDoubleAttribute( const char* name, double* dval ) const
+{
+ const TiXmlAttribute* node = attributeSet.Find( name );
+ if ( !node )
+ return TIXML_NO_ATTRIBUTE;
+ return node->QueryDoubleValue( dval );
+}
+
+
+int TiXmlElement::QueryDoubleAttribute( const std::string& name, double* dval ) const
+{
+ const TiXmlAttribute* node = attributeSet.Find( name );
+ if ( !node )
+ return TIXML_NO_ATTRIBUTE;
+ return node->QueryDoubleValue( dval );
+}
+
+
+void TiXmlElement::SetAttribute( const char * name, int val )
+{
+ char buf[64];
+ #if defined(TIXML_SNPRINTF)
+ TIXML_SNPRINTF( buf, sizeof(buf), "%d", val );
+ #else
+ sprintf( buf, "%d", val );
+ #endif
+ SetAttribute( name, buf );
+}
+
+
+void TiXmlElement::SetAttribute( const std::string& name, int val )
+{
+ std::ostringstream oss;
+ oss << val;
+ SetAttribute( name, oss.str() );
+}
+
+
+void TiXmlElement::SetDoubleAttribute( const char * name, double val )
+{
+ char buf[256];
+ #if defined(TIXML_SNPRINTF)
+ TIXML_SNPRINTF( buf, sizeof(buf), "%f", val );
+ #else
+ sprintf( buf, "%f", val );
+ #endif
+ SetAttribute( name, buf );
+}
+
+
+void TiXmlElement::SetAttribute( const char * cname, const char * cvalue )
+{
+ TIXML_STRING _name( cname );
+ TIXML_STRING _value( cvalue );
+
+ TiXmlAttribute* node = attributeSet.Find( _name );
+ if ( node )
+ {
+ node->SetValue( _value );
+ return;
+ }
+
+ TiXmlAttribute* attrib = new TiXmlAttribute( cname, cvalue );
+ if ( attrib )
+ {
+ attributeSet.Add( attrib );
+ }
+ else
+ {
+ TiXmlDocument* document = GetDocument();
+ if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN );
+ }
+}
+
+
+void TiXmlElement::SetAttribute( const std::string& name, const std::string& _value )
+{
+ TiXmlAttribute* node = attributeSet.Find( name );
+ if ( node )
+ {
+ node->SetValue( _value );
+ return;
+ }
+
+ TiXmlAttribute* attrib = new TiXmlAttribute( name, _value );
+ if ( attrib )
+ {
+ attributeSet.Add( attrib );
+ }
+ else
+ {
+ TiXmlDocument* document = GetDocument();
+ if ( document ) document->SetError( TIXML_ERROR_OUT_OF_MEMORY, 0, 0, TIXML_ENCODING_UNKNOWN );
+ }
+}
+
+
+void TiXmlElement::Print( FILE* cfile, int depth ) const
+{
+ int i;
+ assert( cfile );
+ for ( i=0; i<depth; i++ ) {
+ fprintf( cfile, " " );
+ }
+
+ fprintf( cfile, "<%s", value.c_str() );
+
+ const TiXmlAttribute* attrib;
+ for ( attrib = attributeSet.First(); attrib; attrib = attrib->Next() )
+ {
+ fprintf( cfile, " " );
+ attrib->Print( cfile, depth );
+ }
+
+ // There are 3 different formatting approaches:
+ // 1) An element without children is printed as a <foo /> node
+ // 2) An element with only a text child is printed as <foo> text </foo>
+ // 3) An element with children is printed on multiple lines.
+ TiXmlNode* node;
+ if ( !firstChild )
+ {
+ fprintf( cfile, " />" );
+ }
+ else if ( firstChild == lastChild && firstChild->ToText() )
+ {
+ fprintf( cfile, ">" );
+ firstChild->Print( cfile, depth + 1 );
+ fprintf( cfile, "</%s>", value.c_str() );
+ }
+ else
+ {
+ fprintf( cfile, ">" );
+
+ for ( node = firstChild; node; node=node->NextSibling() )
+ {
+ if ( !node->ToText() )
+ {
+ fprintf( cfile, "\n" );
+ }
+ node->Print( cfile, depth+1 );
+ }
+ fprintf( cfile, "\n" );
+ for( i=0; i<depth; ++i ) {
+ fprintf( cfile, " " );
+ }
+ fprintf( cfile, "</%s>", value.c_str() );
+ }
+}
+
+
+void TiXmlElement::CopyTo( TiXmlElement* target ) const
+{
+ // superclass:
+ TiXmlNode::CopyTo( target );
+
+ // Element class:
+ // Clone the attributes, then clone the children.
+ const TiXmlAttribute* attribute = 0;
+ for( attribute = attributeSet.First();
+ attribute;
+ attribute = attribute->Next() )
+ {
+ target->SetAttribute( attribute->Name(), attribute->Value() );
+ }
+
+ TiXmlNode* node = 0;
+ for ( node = firstChild; node; node = node->NextSibling() )
+ {
+ target->LinkEndChild( node->Clone() );
+ }
+}
+
+bool TiXmlElement::Accept( TiXmlVisitor* visitor ) const
+{
+ if ( visitor->VisitEnter( *this, attributeSet.First() ) )
+ {
+ for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() )
+ {
+ if ( !node->Accept( visitor ) )
+ break;
+ }
+ }
+ return visitor->VisitExit( *this );
+}
+
+
+TiXmlNode* TiXmlElement::Clone() const
+{
+ TiXmlElement* clone = new TiXmlElement( Value() );
+ if ( !clone )
+ return 0;
+
+ CopyTo( clone );
+ return clone;
+}
+
+
+const char* TiXmlElement::GetText() const
+{
+ const TiXmlNode* child = this->FirstChild();
+ if ( child ) {
+ const TiXmlText* childText = child->ToText();
+ if ( childText ) {
+ return childText->Value();
+ }
+ }
+ return 0;
+}
+
+
+TiXmlDocument::TiXmlDocument() : TiXmlNode( TiXmlNode::DOCUMENT )
+{
+ tabsize = 4;
+ useMicrosoftBOM = false;
+ ClearError();
+}
+
+TiXmlDocument::TiXmlDocument( const char * documentName ) : TiXmlNode( TiXmlNode::DOCUMENT )
+{
+ tabsize = 4;
+ useMicrosoftBOM = false;
+ value = documentName;
+ ClearError();
+}
+
+
+TiXmlDocument::TiXmlDocument( const std::string& documentName ) : TiXmlNode( TiXmlNode::DOCUMENT )
+{
+ tabsize = 4;
+ useMicrosoftBOM = false;
+ value = documentName;
+ ClearError();
+}
+
+
+TiXmlDocument::TiXmlDocument( const TiXmlDocument& copy ) : TiXmlNode( TiXmlNode::DOCUMENT )
+{
+ copy.CopyTo( this );
+}
+
+
+void TiXmlDocument::operator=( const TiXmlDocument& copy )
+{
+ Clear();
+ copy.CopyTo( this );
+}
+
+
+bool TiXmlDocument::LoadFile( TiXmlEncoding encoding )
+{
+ // See STL_STRING_BUG below.
+ //StringToBuffer buf( value );
+
+ return LoadFile( Value(), encoding );
+}
+
+
+bool TiXmlDocument::SaveFile() const
+{
+ // See STL_STRING_BUG below.
+// StringToBuffer buf( value );
+//
+// if ( buf.buffer && SaveFile( buf.buffer ) )
+// return true;
+//
+// return false;
+ return SaveFile( Value() );
+}
+
+bool TiXmlDocument::LoadFile( const char* _filename, TiXmlEncoding encoding )
+{
+ // There was a really terrifying little bug here. The code:
+ // value = filename
+ // in the STL case, cause the assignment method of the std::string to
+ // be called. What is strange, is that the std::string had the same
+ // address as it's c_str() method, and so bad things happen. Looks
+ // like a bug in the Microsoft STL implementation.
+ // Add an extra string to avoid the crash.
+ TIXML_STRING filename( _filename );
+ value = filename;
+
+ // reading in binary mode so that tinyxml can normalize the EOL
+ FILE* file = fopen( value.c_str (), "rb" );
+
+ if ( file )
+ {
+ bool result = LoadFile( file, encoding );
+ fclose( file );
+ return result;
+ }
+ else
+ {
+ SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
+ return false;
+ }
+}
+
+bool TiXmlDocument::LoadFile( FILE* file, TiXmlEncoding encoding )
+{
+ if ( !file )
+ {
+ SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
+ return false;
+ }
+
+ // Delete the existing data:
+ Clear();
+ location.Clear();
+
+ // Get the file size, so we can pre-allocate the string. HUGE speed impact.
+ long length = 0;
+ fseek( file, 0, SEEK_END );
+ length = ftell( file );
+ fseek( file, 0, SEEK_SET );
+
+ // Strange case, but good to handle up front.
+ if ( length == 0 )
+ {
+ SetError( TIXML_ERROR_DOCUMENT_EMPTY, 0, 0, TIXML_ENCODING_UNKNOWN );
+ return false;
+ }
+
+ // If we have a file, assume it is all one big XML file, and read it in.
+ // The document parser may decide the document ends sooner than the entire file, however.
+ TIXML_STRING data;
+ data.reserve( length );
+
+ // Subtle bug here. TinyXml did use fgets. But from the XML spec:
+ // 2.11 End-of-Line Handling
+ // <snip>
+ // <quote>
+ // ...the XML processor MUST behave as if it normalized all line breaks in external
+ // parsed entities (including the document entity) on input, before parsing, by translating
+ // both the two-character sequence #xD #xA and any #xD that is not followed by #xA to
+ // a single #xA character.
+ // </quote>
+ //
+ // It is not clear fgets does that, and certainly isn't clear it works cross platform.
+ // Generally, you expect fgets to translate from the convention of the OS to the c/unix
+ // convention, and not work generally.
+
+ /*
+ while( fgets( buf, sizeof(buf), file ) )
+ {
+ data += buf;
+ }
+ */
+
+ char* buf = new char[ length+1 ];
+ buf[0] = 0;
+
+ if ( fread( buf, length, 1, file ) != 1 ) {
+ delete [] buf;
+ SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
+ return false;
+ }
+
+ const char* lastPos = buf;
+ const char* p = buf;
+
+ buf[length] = 0;
+ while( *p ) {
+ assert( p < (buf+length) );
+ if ( *p == 0xa ) {
+ // Newline character. No special rules for this. Append all the characters
+ // since the last string, and include the newline.
+ data.append( lastPos, (p-lastPos+1) ); // append, include the newline
+ ++p; // move past the newline
+ lastPos = p; // and point to the new buffer (may be 0)
+ assert( p <= (buf+length) );
+ }
+ else if ( *p == 0xd ) {
+ // Carriage return. Append what we have so far, then
+ // handle moving forward in the buffer.
+ if ( (p-lastPos) > 0 ) {
+ data.append( lastPos, p-lastPos ); // do not add the CR
+ }
+ data += (char)0xa; // a proper newline
+
+ if ( *(p+1) == 0xa ) {
+ // Carriage return - new line sequence
+ p += 2;
+ lastPos = p;
+ assert( p <= (buf+length) );
+ }
+ else {
+ // it was followed by something else...that is presumably characters again.
+ ++p;
+ lastPos = p;
+ assert( p <= (buf+length) );
+ }
+ }
+ else {
+ ++p;
+ }
+ }
+ // Handle any left over characters.
+ if ( p-lastPos ) {
+ data.append( lastPos, p-lastPos );
+ }
+ delete [] buf;
+ buf = 0;
+
+ Parse( data.c_str(), 0, encoding );
+
+ if ( Error() )
+ return false;
+ else
+ return true;
+}
+
+
+bool TiXmlDocument::SaveFile( const char * filename ) const
+{
+ // The old c stuff lives on...
+ FILE* fp = fopen( filename, "w" );
+ if ( fp )
+ {
+ bool result = SaveFile( fp );
+ fclose( fp );
+ return result;
+ }
+ return false;
+}
+
+
+bool TiXmlDocument::SaveFile( FILE* fp ) const
+{
+ if ( useMicrosoftBOM )
+ {
+ const unsigned char TIXML_UTF_LEAD_0 = 0xefU;
+ const unsigned char TIXML_UTF_LEAD_1 = 0xbbU;
+ const unsigned char TIXML_UTF_LEAD_2 = 0xbfU;
+
+ fputc( TIXML_UTF_LEAD_0, fp );
+ fputc( TIXML_UTF_LEAD_1, fp );
+ fputc( TIXML_UTF_LEAD_2, fp );
+ }
+ Print( fp, 0 );
+ return (ferror(fp) == 0);
+}
+
+
+void TiXmlDocument::CopyTo( TiXmlDocument* target ) const
+{
+ TiXmlNode::CopyTo( target );
+
+ target->error = error;
+ target->errorDesc = errorDesc.c_str ();
+
+ TiXmlNode* node = 0;
+ for ( node = firstChild; node; node = node->NextSibling() )
+ {
+ target->LinkEndChild( node->Clone() );
+ }
+}
+
+
+TiXmlNode* TiXmlDocument::Clone() const
+{
+ TiXmlDocument* clone = new TiXmlDocument();
+ if ( !clone )
+ return 0;
+
+ CopyTo( clone );
+ return clone;
+}
+
+
+void TiXmlDocument::Print( FILE* cfile, int depth ) const
+{
+ assert( cfile );
+ for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() )
+ {
+ node->Print( cfile, depth );
+ fprintf( cfile, "\n" );
+ }
+}
+
+
+bool TiXmlDocument::Accept( TiXmlVisitor* visitor ) const
+{
+ if ( visitor->VisitEnter( *this ) )
+ {
+ for ( const TiXmlNode* node=FirstChild(); node; node=node->NextSibling() )
+ {
+ if ( !node->Accept( visitor ) )
+ break;
+ }
+ }
+ return visitor->VisitExit( *this );
+}
+
+
+const TiXmlAttribute* TiXmlAttribute::Next() const
+{
+ // We are using knowledge of the sentinel. The sentinel
+ // have a value or name.
+ if ( next->value.empty() && next->name.empty() )
+ return 0;
+ return next;
+}
+
+/*
+TiXmlAttribute* TiXmlAttribute::Next()
+{
+ // We are using knowledge of the sentinel. The sentinel
+ // have a value or name.
+ if ( next->value.empty() && next->name.empty() )
+ return 0;
+ return next;
+}
+*/
+
+const TiXmlAttribute* TiXmlAttribute::Previous() const
+{
+ // We are using knowledge of the sentinel. The sentinel
+ // have a value or name.
+ if ( prev->value.empty() && prev->name.empty() )
+ return 0;
+ return prev;
+}
+
+/*
+TiXmlAttribute* TiXmlAttribute::Previous()
+{
+ // We are using knowledge of the sentinel. The sentinel
+ // have a value or name.
+ if ( prev->value.empty() && prev->name.empty() )
+ return 0;
+ return prev;
+}
+*/
+
+void TiXmlAttribute::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const
+{
+ TIXML_STRING n, v;
+
+ PutString( name, &n );
+ PutString( value, &v );
+
+ if (value.find ('\"') == TIXML_STRING::npos) {
+ if ( cfile ) {
+ fprintf (cfile, "%s=\"%s\"", n.c_str(), v.c_str() );
+ }
+ if ( str ) {
+ (*str) += n; (*str) += "=\""; (*str) += v; (*str) += "\"";
+ }
+ }
+ else {
+ if ( cfile ) {
+ fprintf (cfile, "%s='%s'", n.c_str(), v.c_str() );
+ }
+ if ( str ) {
+ (*str) += n; (*str) += "='"; (*str) += v; (*str) += "'";
+ }
+ }
+}
+
+
+int TiXmlAttribute::QueryIntValue( int* ival ) const
+{
+ if ( sscanf( value.c_str(), "%d", ival ) == 1 )
+ return TIXML_SUCCESS;
+ return TIXML_WRONG_TYPE;
+}
+
+int TiXmlAttribute::QueryDoubleValue( double* dval ) const
+{
+ if ( sscanf( value.c_str(), "%lf", dval ) == 1 )
+ return TIXML_SUCCESS;
+ return TIXML_WRONG_TYPE;
+}
+
+void TiXmlAttribute::SetIntValue( int _value )
+{
+ char buf [64];
+ #if defined(TIXML_SNPRINTF)
+ TIXML_SNPRINTF(buf, sizeof(buf), "%d", _value);
+ #else
+ sprintf (buf, "%d", _value);
+ #endif
+ SetValue (buf);
+}
+
+void TiXmlAttribute::SetDoubleValue( double _value )
+{
+ char buf [256];
+ #if defined(TIXML_SNPRINTF)
+ TIXML_SNPRINTF( buf, sizeof(buf), "%f", _value);
+ #else
+ sprintf (buf, "%f", _value);
+ #endif
+ SetValue (buf);
+}
+
+int TiXmlAttribute::IntValue() const
+{
+ return atoi (value.c_str ());
+}
+
+double TiXmlAttribute::DoubleValue() const
+{
+ return atof (value.c_str ());
+}
+
+
+TiXmlComment::TiXmlComment( const TiXmlComment& copy ) : TiXmlNode( TiXmlNode::COMMENT )
+{
+ copy.CopyTo( this );
+}
+
+
+void TiXmlComment::operator=( const TiXmlComment& base )
+{
+ Clear();
+ base.CopyTo( this );
+}
+
+
+void TiXmlComment::Print( FILE* cfile, int depth ) const
+{
+ assert( cfile );
+ for ( int i=0; i<depth; i++ )
+ {
+ fprintf( cfile, " " );
+ }
+ fprintf( cfile, "<!--%s-->", value.c_str() );
+}
+
+
+void TiXmlComment::CopyTo( TiXmlComment* target ) const
+{
+ TiXmlNode::CopyTo( target );
+}
+
+
+bool TiXmlComment::Accept( TiXmlVisitor* visitor ) const
+{
+ return visitor->Visit( *this );
+}
+
+
+TiXmlNode* TiXmlComment::Clone() const
+{
+ TiXmlComment* clone = new TiXmlComment();
+
+ if ( !clone )
+ return 0;
+
+ CopyTo( clone );
+ return clone;
+}
+
+
+void TiXmlText::Print( FILE* cfile, int depth ) const
+{
+ assert( cfile );
+ if ( cdata )
+ {
+ int i;
+ fprintf( cfile, "\n" );
+ for ( i=0; i<depth; i++ ) {
+ fprintf( cfile, " " );
+ }
+ fprintf( cfile, "<![CDATA[%s]]>\n", value.c_str() ); // unformatted output
+ }
+ else
+ {
+ TIXML_STRING buffer;
+ PutString( value, &buffer );
+ fprintf( cfile, "%s", buffer.c_str() );
+ }
+}
+
+
+void TiXmlText::CopyTo( TiXmlText* target ) const
+{
+ TiXmlNode::CopyTo( target );
+ target->cdata = cdata;
+}
+
+
+bool TiXmlText::Accept( TiXmlVisitor* visitor ) const
+{
+ return visitor->Visit( *this );
+}
+
+
+TiXmlNode* TiXmlText::Clone() const
+{
+ TiXmlText* clone = 0;
+ clone = new TiXmlText( "" );
+
+ if ( !clone )
+ return 0;
+
+ CopyTo( clone );
+ return clone;
+}
+
+
+TiXmlDeclaration::TiXmlDeclaration( const char * _version,
+ const char * _encoding,
+ const char * _standalone )
+ : TiXmlNode( TiXmlNode::DECLARATION )
+{
+ version = _version;
+ encoding = _encoding;
+ standalone = _standalone;
+}
+
+
+TiXmlDeclaration::TiXmlDeclaration( const std::string& _version,
+ const std::string& _encoding,
+ const std::string& _standalone )
+ : TiXmlNode( TiXmlNode::DECLARATION )
+{
+ version = _version;
+ encoding = _encoding;
+ standalone = _standalone;
+}
+
+
+TiXmlDeclaration::TiXmlDeclaration( const TiXmlDeclaration& copy )
+ : TiXmlNode( TiXmlNode::DECLARATION )
+{
+ copy.CopyTo( this );
+}
+
+
+void TiXmlDeclaration::operator=( const TiXmlDeclaration& copy )
+{
+ Clear();
+ copy.CopyTo( this );
+}
+
+
+void TiXmlDeclaration::Print( FILE* cfile, int /*depth*/, TIXML_STRING* str ) const
+{
+ if ( cfile ) fprintf( cfile, "<?xml " );
+ if ( str ) (*str) += "<?xml ";
+
+ if ( !version.empty() ) {
+ if ( cfile ) fprintf (cfile, "version=\"%s\" ", version.c_str ());
+ if ( str ) { (*str) += "version=\""; (*str) += version; (*str) += "\" "; }
+ }
+ if ( !encoding.empty() ) {
+ if ( cfile ) fprintf (cfile, "encoding=\"%s\" ", encoding.c_str ());
+ if ( str ) { (*str) += "encoding=\""; (*str) += encoding; (*str) += "\" "; }
+ }
+ if ( !standalone.empty() ) {
+ if ( cfile ) fprintf (cfile, "standalone=\"%s\" ", standalone.c_str ());
+ if ( str ) { (*str) += "standalone=\""; (*str) += standalone; (*str) += "\" "; }
+ }
+ if ( cfile ) fprintf( cfile, "?>" );
+ if ( str ) (*str) += "?>";
+}
+
+
+void TiXmlDeclaration::CopyTo( TiXmlDeclaration* target ) const
+{
+ TiXmlNode::CopyTo( target );
+
+ target->version = version;
+ target->encoding = encoding;
+ target->standalone = standalone;
+}
+
+
+bool TiXmlDeclaration::Accept( TiXmlVisitor* visitor ) const
+{
+ return visitor->Visit( *this );
+}
+
+
+TiXmlNode* TiXmlDeclaration::Clone() const
+{
+ TiXmlDeclaration* clone = new TiXmlDeclaration();
+
+ if ( !clone )
+ return 0;
+
+ CopyTo( clone );
+ return clone;
+}
+
+
+void TiXmlUnknown::Print( FILE* cfile, int depth ) const
+{
+ for ( int i=0; i<depth; i++ )
+ fprintf( cfile, " " );
+ fprintf( cfile, "<%s>", value.c_str() );
+}
+
+
+void TiXmlUnknown::CopyTo( TiXmlUnknown* target ) const
+{
+ TiXmlNode::CopyTo( target );
+}
+
+
+bool TiXmlUnknown::Accept( TiXmlVisitor* visitor ) const
+{
+ return visitor->Visit( *this );
+}
+
+
+TiXmlNode* TiXmlUnknown::Clone() const
+{
+ TiXmlUnknown* clone = new TiXmlUnknown();
+
+ if ( !clone )
+ return 0;
+
+ CopyTo( clone );
+ return clone;
+}
+
+
+TiXmlAttributeSet::TiXmlAttributeSet()
+{
+ sentinel.next = &sentinel;
+ sentinel.prev = &sentinel;
+}
+
+
+TiXmlAttributeSet::~TiXmlAttributeSet()
+{
+ assert( sentinel.next == &sentinel );
+ assert( sentinel.prev == &sentinel );
+}
+
+
+void TiXmlAttributeSet::Add( TiXmlAttribute* addMe )
+{
+ assert( !Find( TIXML_STRING( addMe->Name() ) ) ); // Shouldn't be multiply adding to the set.
+
+ addMe->next = &sentinel;
+ addMe->prev = sentinel.prev;
+
+ sentinel.prev->next = addMe;
+ sentinel.prev = addMe;
+}
+
+void TiXmlAttributeSet::Remove( TiXmlAttribute* removeMe )
+{
+ TiXmlAttribute* node;
+
+ for( node = sentinel.next; node != &sentinel; node = node->next )
+ {
+ if ( node == removeMe )
+ {
+ node->prev->next = node->next;
+ node->next->prev = node->prev;
+ node->next = 0;
+ node->prev = 0;
+ return;
+ }
+ }
+ assert( 0 ); // we tried to remove a non-linked attribute.
+}
+
+
+const TiXmlAttribute* TiXmlAttributeSet::Find( const std::string& name ) const
+{
+ for( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next )
+ {
+ if ( node->name == name )
+ return node;
+ }
+ return 0;
+}
+
+/*
+TiXmlAttribute* TiXmlAttributeSet::Find( const std::string& name )
+{
+ for( TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next )
+ {
+ if ( node->name == name )
+ return node;
+ }
+ return 0;
+}
+*/
+
+
+const TiXmlAttribute* TiXmlAttributeSet::Find( const char* name ) const
+{
+ for( const TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next )
+ {
+ if ( strcmp( node->name.c_str(), name ) == 0 )
+ return node;
+ }
+ return 0;
+}
+
+/*
+TiXmlAttribute* TiXmlAttributeSet::Find( const char* name )
+{
+ for( TiXmlAttribute* node = sentinel.next; node != &sentinel; node = node->next )
+ {
+ if ( strcmp( node->name.c_str(), name ) == 0 )
+ return node;
+ }
+ return 0;
+}
+*/
+
+std::istream& operator>> (std::istream & in, TiXmlNode & base)
+{
+ TIXML_STRING tag;
+ tag.reserve( 8 * 1000 );
+ base.StreamIn( &in, &tag );
+
+ base.Parse( tag.c_str(), 0, TIXML_DEFAULT_ENCODING );
+ return in;
+}
+
+
+std::ostream& operator<< (std::ostream & out, const TiXmlNode & base)
+{
+ TiXmlPrinter printer;
+ printer.SetStreamPrinting();
+ base.Accept( &printer );
+ out << printer.Str();
+
+ return out;
+}
+
+
+std::string& operator<< (std::string& out, const TiXmlNode& base )
+{
+ TiXmlPrinter printer;
+ printer.SetStreamPrinting();
+ base.Accept( &printer );
+ out.append( printer.Str() );
+
+ return out;
+}
+
+
+TiXmlHandle TiXmlHandle::FirstChild() const
+{
+ if ( node )
+ {
+ TiXmlNode* child = node->FirstChild();
+ if ( child )
+ return TiXmlHandle( child );
+ }
+ return TiXmlHandle( 0 );
+}
+
+
+TiXmlHandle TiXmlHandle::FirstChild( const char * value ) const
+{
+ if ( node )
+ {
+ TiXmlNode* child = node->FirstChild( value );
+ if ( child )
+ return TiXmlHandle( child );
+ }
+ return TiXmlHandle( 0 );
+}
+
+
+TiXmlHandle TiXmlHandle::FirstChildElement() const
+{
+ if ( node )
+ {
+ TiXmlElement* child = node->FirstChildElement();
+ if ( child )
+ return TiXmlHandle( child );
+ }
+ return TiXmlHandle( 0 );
+}
+
+
+TiXmlHandle TiXmlHandle::FirstChildElement( const char * value ) const
+{
+ if ( node )
+ {
+ TiXmlElement* child = node->FirstChildElement( value );
+ if ( child )
+ return TiXmlHandle( child );
+ }
+ return TiXmlHandle( 0 );
+}
+
+
+TiXmlHandle TiXmlHandle::Child( int count ) const
+{
+ if ( node )
+ {
+ int i;
+ TiXmlNode* child = node->FirstChild();
+ for ( i=0;
+ child && i<count;
+ child = child->NextSibling(), ++i )
+ {
+ // nothing
+ }
+ if ( child )
+ return TiXmlHandle( child );
+ }
+ return TiXmlHandle( 0 );
+}
+
+
+TiXmlHandle TiXmlHandle::Child( const char* value, int count ) const
+{
+ if ( node )
+ {
+ int i;
+ TiXmlNode* child = node->FirstChild( value );
+ for ( i=0;
+ child && i<count;
+ child = child->NextSibling( value ), ++i )
+ {
+ // nothing
+ }
+ if ( child )
+ return TiXmlHandle( child );
+ }
+ return TiXmlHandle( 0 );
+}
+
+
+TiXmlHandle TiXmlHandle::ChildElement( int count ) const
+{
+ if ( node )
+ {
+ int i;
+ TiXmlElement* child = node->FirstChildElement();
+ for ( i=0;
+ child && i<count;
+ child = child->NextSiblingElement(), ++i )
+ {
+ // nothing
+ }
+ if ( child )
+ return TiXmlHandle( child );
+ }
+ return TiXmlHandle( 0 );
+}
+
+
+TiXmlHandle TiXmlHandle::ChildElement( const char* value, int count ) const
+{
+ if ( node )
+ {
+ int i;
+ TiXmlElement* child = node->FirstChildElement( value );
+ for ( i=0;
+ child && i<count;
+ child = child->NextSiblingElement( value ), ++i )
+ {
+ // nothing
+ }
+ if ( child )
+ return TiXmlHandle( child );
+ }
+ return TiXmlHandle( 0 );
+}
+
+
+bool TiXmlPrinter::VisitEnter( const TiXmlDocument& )
+{
+ return true;
+}
+
+bool TiXmlPrinter::VisitExit( const TiXmlDocument& )
+{
+ return true;
+}
+
+bool TiXmlPrinter::VisitEnter( const TiXmlElement& element, const TiXmlAttribute* firstAttribute )
+{
+ DoIndent();
+ buffer += "<";
+ buffer += element.Value();
+
+ for( const TiXmlAttribute* attrib = firstAttribute; attrib; attrib = attrib->Next() )
+ {
+ buffer += " ";
+ attrib->Print( 0, 0, &buffer );
+ }
+
+ if ( !element.FirstChild() )
+ {
+ buffer += " />";
+ DoLineBreak();
+ }
+ else
+ {
+ buffer += ">";
+ if ( element.FirstChild()->ToText()
+ && element.LastChild() == element.FirstChild()
+ && element.FirstChild()->ToText()->CDATA() == false )
+ {
+ simpleTextPrint = true;
+ // no DoLineBreak()!
+ }
+ else
+ {
+ DoLineBreak();
+ }
+ }
+ ++depth;
+ return true;
+}
+
+
+bool TiXmlPrinter::VisitExit( const TiXmlElement& element )
+{
+ --depth;
+ if ( !element.FirstChild() )
+ {
+ // nothing.
+ }
+ else
+ {
+ if ( simpleTextPrint )
+ {
+ simpleTextPrint = false;
+ }
+ else
+ {
+ DoIndent();
+ }
+ buffer += "</";
+ buffer += element.Value();
+ buffer += ">";
+ DoLineBreak();
+ }
+ return true;
+}
+
+
+bool TiXmlPrinter::Visit( const TiXmlText& text )
+{
+ if ( text.CDATA() )
+ {
+ DoIndent();
+ buffer += "<![CDATA[";
+ buffer += text.Value();
+ buffer += "]]>";
+ DoLineBreak();
+ }
+ else if ( simpleTextPrint )
+ {
+ buffer += text.Value();
+ }
+ else
+ {
+ DoIndent();
+ buffer += text.Value();
+ DoLineBreak();
+ }
+ return true;
+}
+
+
+bool TiXmlPrinter::Visit( const TiXmlDeclaration& declaration )
+{
+ DoIndent();
+ declaration.Print( 0, 0, &buffer );
+ DoLineBreak();
+ return true;
+}
+
+
+bool TiXmlPrinter::Visit( const TiXmlComment& comment )
+{
+ DoIndent();
+ buffer += "<!--";
+ buffer += comment.Value();
+ buffer += "-->";
+ DoLineBreak();
+ return true;
+}
+
+
+bool TiXmlPrinter::Visit( const TiXmlUnknown& unknown )
+{
+ DoIndent();
+ buffer += "<";
+ buffer += unknown.Value();
+ buffer += ">";
+ DoLineBreak();
+ return true;
+}
+
Index: tags/agile-1.2.0/src/Tools/AGILePaths.cc
===================================================================
--- tags/agile-1.2.0/src/Tools/AGILePaths.cc (revision 0)
+++ tags/agile-1.2.0/src/Tools/AGILePaths.cc (revision 755)
@@ -0,0 +1,80 @@
+#include "AGILe/AGILe.hh"
+#include "AGILe/Utils.hh"
+#include "binreloc.h"
+
+namespace AGILe {
+
+
+ const string getLibPath() {
+ BrInitError error;
+ br_init_lib(&error);
+ char* tmp = br_find_lib_dir(DEFAULTLIBDIR);
+ const string libdir(tmp);
+ free(tmp);
+ return libdir;
+ }
+
+
+ const string getDataPath() {
+ BrInitError error;
+ br_init_lib(&error);
+ char* tmp = br_find_data_dir(DEFAULTDATADIR);
+ const string sharedir(tmp);
+ free(tmp);
+ return sharedir;
+ }
+
+
+ const string getAGILeDataPath() {
+ return getDataPath() + "/AGILe";
+ }
+
+
+ const vector<string> getAnalysisLibPaths() {
+ vector<string> dirs;
+ char* env = 0;
+ env = getenv("RIVET_ANALYSIS_PATH");
+ if (env) {
+ // Use the Rivet analysis path variable if set...
+ dirs += split(env);
+ } else {
+ // ... otherwise fall back to the Rivet library install path
+ dirs += getLibPath();
+ }
+ return dirs;
+ }
+
+
+ const vector<string> getGenPaths() {
+ vector<string> dirs;
+ char* env = 0;
+ env = getenv("AGILE_GEN_PATH");
+ if (env) {
+ // Use the AGILe generator path variable if set...
+ dirs += split(env);
+ } else {
+ // Fall back to the Genser area on CERN AFS
+ /// @todo deprecate Use of $AGILE_USE_AFS variable
+ const char* envAUA = getenv("AGILE_USE_AFS");
+ if (!envAUA || toUpper(string(envAUA)) != "NO") {
+ dirs += "/afs/cern.ch/sw/lcg/external/MCGenerators";
+ }
+ }
+ return dirs;
+ }
+
+
+ /// @todo Add API method: setLCGPlatformTag which overrides environment. Requires global variable... hmm.
+ const string getLCGPlatformTag() {
+ // This non-standard env variable can be specified by the user.
+ const char* envlcg = getenv("LCG_PLATFORM");
+ if (envlcg) {
+ return string(envlcg);
+ } else {
+ // Also try a fallback of the LCG tag, computed at build time.
+ return LCGTAG;
+ }
+ }
+
+
+}
Index: tags/agile-1.2.0/src/Tools/Makefile.am
===================================================================
--- tags/agile-1.2.0/src/Tools/Makefile.am (revision 0)
+++ tags/agile-1.2.0/src/Tools/Makefile.am (revision 755)
@@ -0,0 +1,13 @@
+noinst_LTLIBRARIES = libAGILeTools.la
+
+dist_noinst_HEADERS = binreloc.h
+
+libAGILeTools_la_SOURCES = Logging.cc binreloc.c AGILePaths.cc \
+ TinyXML/tinyxml.cpp TinyXML/tinyxmlerror.cpp TinyXML/tinyxmlparser.cpp
+
+libAGILeTools_la_CPPFLAGS = $(AM_CPPFLAGS) \
+ -I$(top_srcdir)/include/TinyXML \
+ -DENABLE_BINRELOC \
+ -DDEFAULTDATADIR=\"$(datadir)\" \
+ -DDEFAULTLIBDIR=\"$(libdir)\" \
+ -DLCGTAG=\""$(LCG_TAG)"\"
Index: tags/agile-1.2.0/src/Tools/Logging.cc
===================================================================
--- tags/agile-1.2.0/src/Tools/Logging.cc (revision 0)
+++ tags/agile-1.2.0/src/Tools/Logging.cc (revision 755)
@@ -0,0 +1,197 @@
+#include <AGILe/AGILe.hh>
+#include <AGILe/Tools/Logging.hh>
+#include <ctime>
+#include <unistd.h>
+
+using namespace std;
+
+namespace AGILe {
+
+
+ Log::LogMap Log::existingLogs;
+ Log::LevelMap Log::defaultLevels;
+ Log::ColorCodes Log::colorCodes;
+ string Log::endColorCode;
+ bool Log::showTimestamp = false;
+ bool Log::showLogLevel = true;
+ bool Log::showLoggerName = true;
+ bool Log::useShellColors = true;
+
+
+ Log::Log(const string& name)
+ : _name(name), _level(INFO), _nostream(new ostream(0)) { }
+
+
+ Log::Log(const string& name, int level)
+ : _name(name), _level(level), _nostream(new ostream(0)) { }
+
+
+ void _updateLevels(const Log::LevelMap& defaultLevels, Log::LogMap& existingLogs) {
+ /// @todo Check ordering - "Foo" should come before "Foo.Bar"
+ for (Log::LevelMap::const_iterator lev = defaultLevels.begin(); lev != defaultLevels.end(); ++lev) {
+ for (Log::LogMap::iterator log = existingLogs.begin(); log != existingLogs.end(); ++log) {
+ if (log->first.find(lev->first) == 0) {
+ log->second->setLevel(lev->second);
+ }
+ }
+ }
+ }
+
+
+ void Log::setLevel(const string& name, int level) {
+ defaultLevels[name] = level;
+ _updateLevels(defaultLevels, existingLogs);
+ }
+
+
+ void Log::setLevels(LevelMap& logLevels) {
+ for (LevelMap::const_iterator lev = logLevels.begin(); lev != logLevels.end(); ++lev) {
+ defaultLevels[lev->first] = lev->second;
+ }
+ _updateLevels(defaultLevels, existingLogs);
+ }
+
+
+ Log& Log::getLog(const string& name) {
+ if (existingLogs.find(name) == existingLogs.end()) {
+ int level = INFO;
+ // Try running through all parent classes to find an existing level
+ string tmpname = name;
+ bool triedAllParents = false;
+ while (! triedAllParents) {
+ // Is there a default level?
+ if (defaultLevels.find(tmpname) != defaultLevels.end()) {
+ level = defaultLevels.find(tmpname)->second;
+ break;
+ }
+ // Is there already such a logger? (NB. tmpname != name)
+ if (existingLogs.find(tmpname) != existingLogs.end()) {
+ level = existingLogs.find(tmpname)->second->getLevel();
+ break;
+ }
+ // Crop the string back to the next parent level
+ size_t lastDot = tmpname.find_last_of(".");
+ if (lastDot != string::npos) {
+ tmpname = tmpname.substr(0, lastDot);
+ } else {
+ triedAllParents = true;
+ }
+ }
+ for (LevelMap::const_iterator l = defaultLevels.begin(); l != defaultLevels.end(); ++l) {
+ }
+ existingLogs[name] = new Log(name, level);
+ }
+ return *existingLogs[name];
+ }
+
+
+ string Log::getLevelName(int level) {
+ /// @todo Do the map::upper_limit thing to find nearest level...
+ switch(level) {
+ case TRACE:
+ return "TRACE";
+ case DEBUG:
+ return "DEBUG";
+ case INFO:
+ return "INFO";
+ case WARN:
+ return "WARN";
+ case ERROR:
+ return "ERROR";
+ default:
+ return "";
+ }
+ //throw runtime_error("Enum value was not a valid log level. How did that happen?");
+ }
+
+
+ string Log::getColorCode(int level) {
+ if (!Log::useShellColors) return "";
+ // If the codes haven't been initialized, do so now.
+ if (Log::colorCodes.empty()) {
+ // If stdout is a valid tty, try to use the appropriate codes.
+ if (isatty(1)) {
+ /// @todo Test for VT100 compliance?
+ Log::colorCodes[TRACE] = "\033[0;37m";
+ Log::colorCodes[DEBUG] = "\033[0;36m";
+ Log::colorCodes[INFO] = "\033[0;32m";
+ Log::colorCodes[WARN] = "\033[0;33m";
+ Log::colorCodes[ERROR] = "\033[0;31m";
+ Log::endColorCode = "\033[0m";
+ } else {
+ Log::colorCodes[TRACE] = "";
+ Log::colorCodes[DEBUG] = "";
+ Log::colorCodes[INFO] = "";
+ Log::colorCodes[WARN] = "";
+ Log::colorCodes[ERROR] = "";
+ }
+ }
+ // Return the appropriate code from the colour map.
+ /// @todo Do the map::upper_limit thing to find nearest level...
+ return colorCodes[level];
+ }
+
+
+ Log::Level Log::getLevelFromName(const string& level) {
+ if (level == "TRACE") return TRACE;
+ if (level == "DEBUG") return DEBUG;
+ if (level == "INFO") return INFO;
+ if (level == "WARN") return WARN;
+ if (level == "ERROR") return ERROR;
+ throw runtime_error("Couldn't create a log level from string '" + level + "'");
+ }
+
+
+ string Log::formatMessage(int level, const string& message) {
+ string out;
+ if (Log::useShellColors) {
+ out += getColorCode(level);
+ }
+
+ if (Log::showLoggerName) {
+ out += getName();
+ out += ": ";
+ }
+
+ if (Log::showLogLevel) {
+ out += Log::getLevelName(level);
+ out += " ";
+ }
+
+ if (Log::showTimestamp) {
+ time_t rawtime;
+ time(&rawtime);
+ char* timestr = ctime(&rawtime);
+ timestr[24] = ' ';
+ out += timestr;
+ out += " ";
+ }
+
+ if (Log::useShellColors) {
+ out += endColorCode;
+ }
+
+ out += " ";
+ out += message;
+
+ return out;
+ }
+
+
+ void Log::log(int level, const string& message) {
+ if (isActive(level)) {
+ cout << formatMessage(level, message) << endl;
+ }
+ }
+
+
+ ostream& operator<<(Log& log, int level) {
+ if (log.isActive(level)) {
+ cout << log.formatMessage(level, "");
+ return cout;
+ } else {
+ return *(log._nostream);
+ }
+ }
+
+}
Index: tags/agile-1.2.0/src/Tools/binreloc.c
===================================================================
--- tags/agile-1.2.0/src/Tools/binreloc.c (revision 0)
+++ tags/agile-1.2.0/src/Tools/binreloc.c (revision 755)
@@ -0,0 +1,793 @@
+/*
+ * BinReloc - a library for creating relocatable executables
+ * Written by: Hongli Lai <h.lai@chello.nl>
+ * http://autopackage.org/
+ *
+ * This source code is public domain. You can relicense this code
+ * under whatever license you want.
+ *
+ * See http://autopackage.org/docs/binreloc/ for
+ * more information and how to use this.
+ */
+
+#ifndef __BINRELOC_C__
+#define __BINRELOC_C__
+
+#ifdef ENABLE_BINRELOC
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <unistd.h>
+#endif /* ENABLE_BINRELOC */
+#include <stdio.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <string.h>
+#include "binreloc.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+
+/** @internal
+ * Find the canonical filename of the executable. Returns the filename
+ * (which must be freed) or NULL on error. If the parameter 'error' is
+ * not NULL, the error code will be stored there, if an error occured.
+ */
+static char *
+_br_find_exe (BrInitError *error)
+{
+#ifndef ENABLE_BINRELOC
+ if (error)
+ *error = BR_INIT_ERROR_DISABLED;
+ return NULL;
+#else
+ char *path, *path2, *line, *result;
+ size_t buf_size;
+ ssize_t size;
+ struct stat stat_buf;
+ FILE *f;
+
+ /* Read from /proc/self/exe (symlink) */
+ if (sizeof (path) > SSIZE_MAX)
+ buf_size = SSIZE_MAX - 1;
+ else
+ buf_size = PATH_MAX - 1;
+ path = (char *) malloc (buf_size);
+ if (path == NULL) {
+ /* Cannot allocate memory. */
+ if (error)
+ *error = BR_INIT_ERROR_NOMEM;
+ return NULL;
+ }
+ path2 = (char *) malloc (buf_size);
+ if (path2 == NULL) {
+ /* Cannot allocate memory. */
+ if (error)
+ *error = BR_INIT_ERROR_NOMEM;
+ free (path);
+ return NULL;
+ }
+
+ strncpy (path2, "/proc/self/exe", buf_size - 1);
+
+ while (1) {
+ int i;
+
+ size = readlink (path2, path, buf_size - 1);
+ if (size == -1) {
+ /* Error. */
+ free (path2);
+ break;
+ }
+
+ /* readlink() success. */
+ path[size] = '\0';
+
+ /* Check whether the symlink's target is also a symlink.
+ * We want to get the final target. */
+ i = stat (path, &stat_buf);
+ if (i == -1) {
+ /* Error. */
+ free (path2);
+ break;
+ }
+
+ /* stat() success. */
+ if (!S_ISLNK (stat_buf.st_mode)) {
+ /* path is not a symlink. Done. */
+ free (path2);
+ return path;
+ }
+
+ /* path is a symlink. Continue loop and resolve this. */
+ strncpy (path, path2, buf_size - 1);
+ }
+
+
+ /* readlink() or stat() failed; this can happen when the program is
+ * running in Valgrind 2.2. Read from /proc/self/maps as fallback. */
+
+ buf_size = PATH_MAX + 128;
+ line = (char *) realloc (path, buf_size);
+ if (line == NULL) {
+ /* Cannot allocate memory. */
+ free (path);
+ if (error)
+ *error = BR_INIT_ERROR_NOMEM;
+ return NULL;
+ }
+
+ f = fopen ("/proc/self/maps", "r");
+ if (f == NULL) {
+ free (line);
+ if (error)
+ *error = BR_INIT_ERROR_OPEN_MAPS;
+ return NULL;
+ }
+
+ /* The first entry should be the executable name. */
+ result = fgets (line, (int) buf_size, f);
+ if (result == NULL) {
+ fclose (f);
+ free (line);
+ if (error)
+ *error = BR_INIT_ERROR_READ_MAPS;
+ return NULL;
+ }
+
+ /* Get rid of newline character. */
+ buf_size = strlen (line);
+ if (buf_size <= 0) {
+ /* Huh? An empty string? */
+ fclose (f);
+ free (line);
+ if (error)
+ *error = BR_INIT_ERROR_INVALID_MAPS;
+ return NULL;
+ }
+ if (line[buf_size - 1] == 10)
+ line[buf_size - 1] = 0;
+
+ /* Extract the filename; it is always an absolute path. */
+ path = strchr (line, '/');
+
+ /* Sanity check. */
+ if (strstr (line, " r-xp ") == NULL || path == NULL) {
+ fclose (f);
+ free (line);
+ if (error)
+ *error = BR_INIT_ERROR_INVALID_MAPS;
+ return NULL;
+ }
+
+ char* oldpath = path;
+ path = strdup (oldpath);
+ free (oldpath);
+ free (line);
+ fclose (f);
+ return path;
+#endif /* ENABLE_BINRELOC */
+}
+
+
+/** @internal
+ * Find the canonical filename of the executable which owns symbol.
+ * Returns a filename which must be freed, or NULL on error.
+ */
+static char *
+_br_find_exe_for_symbol (const void *symbol, BrInitError *error)
+{
+#ifndef ENABLE_BINRELOC
+ if (error)
+ *error = BR_INIT_ERROR_DISABLED;
+ return (char *) NULL;
+#else
+ #define SIZE PATH_MAX + 100
+ FILE *f;
+ size_t address_string_len;
+ char *address_string, line[SIZE], *found;
+
+ if (symbol == NULL)
+ return (char *) NULL;
+
+ f = fopen ("/proc/self/maps", "r");
+ if (f == NULL)
+ return (char *) NULL;
+
+ address_string_len = 4;
+ address_string = (char *) malloc (address_string_len);
+ /* Handle OOM (Tracker issue #35) */
+ if (!address_string)
+ {
+ if (error)
+ *error = BR_INIT_ERROR_NOMEM;
+ return (char *) NULL;
+ }
+ found = (char *) NULL;
+
+ while (!feof (f)) {
+ char *start_addr, *end_addr, *end_addr_end, *file;
+ void *start_addr_p, *end_addr_p;
+ size_t len;
+
+ if (fgets (line, SIZE, f) == NULL)
+ break;
+
+ /* Sanity check. */
+ if (strstr (line, " r-xp ") == NULL || strchr (line, '/') == NULL)
+ continue;
+
+ /* Parse line. */
+ start_addr = line;
+ end_addr = strchr (line, '-');
+ file = strchr (line, '/');
+
+ /* More sanity check. */
+ if (!(file > end_addr && end_addr != NULL && end_addr[0] == '-'))
+ continue;
+
+ end_addr[0] = '\0';
+ end_addr++;
+ end_addr_end = strchr (end_addr, ' ');
+ if (end_addr_end == NULL)
+ continue;
+
+ end_addr_end[0] = '\0';
+ len = strlen (file);
+ if (len == 0)
+ continue;
+ if (file[len - 1] == '\n')
+ file[len - 1] = '\0';
+
+ /* Get rid of "(deleted)" from the filename. */
+ len = strlen (file);
+ if (len > 10 && strcmp (file + len - 10, " (deleted)") == 0)
+ file[len - 10] = '\0';
+
+ /* I don't know whether this can happen but better safe than sorry. */
+ len = strlen (start_addr);
+ if (len != strlen (end_addr))
+ continue;
+
+
+ /* Transform the addresses into a string in the form of 0xdeadbeef,
+ * then transform that into a pointer. */
+ if (address_string_len < len + 3) {
+ address_string_len = len + 3;
+ address_string = (char *) realloc (address_string, address_string_len);
+ /* Handle OOM (Tracker issue #35) */
+ if (!address_string)
+ {
+ if (error)
+ *error = BR_INIT_ERROR_NOMEM;
+ return (char *) NULL;
+ }
+ }
+
+ memcpy (address_string, "0x", 2);
+ memcpy (address_string + 2, start_addr, len);
+ address_string[2 + len] = '\0';
+ sscanf (address_string, "%p", &start_addr_p);
+
+ memcpy (address_string, "0x", 2);
+ memcpy (address_string + 2, end_addr, len);
+ address_string[2 + len] = '\0';
+ sscanf (address_string, "%p", &end_addr_p);
+
+
+ if (symbol >= start_addr_p && symbol < end_addr_p) {
+ found = file;
+ break;
+ }
+ }
+
+ free (address_string);
+ fclose (f);
+
+ if (found == NULL)
+ return (char *) NULL;
+ else
+ return strdup (found);
+#endif /* ENABLE_BINRELOC */
+}
+
+
+#ifndef BINRELOC_RUNNING_DOXYGEN
+ #undef NULL
+ #define NULL ((char *) 0) /* typecasted as char* for C++ type safeness */
+#endif
+
+static char *exe = (char *) NULL;
+
+
+/** Initialize the BinReloc library (for applications).
+ *
+ * This function must be called before using any other BinReloc functions.
+ * It attempts to locate the application's canonical filename.
+ *
+ * @note If you want to use BinReloc for a library, then you should call
+ * br_init_lib() instead.
+ * @note Initialization failure is not fatal. BinReloc functions will just
+ * fallback to the supplied default path.
+ *
+ * @param error If BinReloc failed to initialize, then the error code will
+ * be stored in this variable. Set to NULL if you want to
+ * ignore this. See #BrInitError for a list of error codes.
+ *
+ * @returns 1 on success, 0 if BinReloc failed to initialize.
+ */
+int
+br_init (BrInitError *error)
+{
+ exe = _br_find_exe (error);
+ return exe != NULL;
+}
+
+
+/** Initialize the BinReloc library (for libraries).
+ *
+ * This function must be called before using any other BinReloc functions.
+ * It attempts to locate the calling library's canonical filename.
+ *
+ * @note The BinReloc source code MUST be included in your library, or this
+ * function won't work correctly.
+ * @note Initialization failure is not fatal. BinReloc functions will just
+ * fallback to the supplied default path.
+ *
+ * @param error If BinReloc failed to initialize, then the error code will
+ * be stored in this variable. Set to NULL if you want to
+ * ignore this. See #BrInitError for a list of error codes.
+ *
+ * @returns 1 on success, 0 if a filename cannot be found.
+ */
+int
+br_init_lib (BrInitError *error)
+{
+ exe = _br_find_exe_for_symbol ((const void *) "", error);
+ return exe != NULL;
+}
+
+
+/** Find the canonical filename of the current application.
+ *
+ * @param default_exe A default filename which will be used as fallback.
+ * @returns A string containing the application's canonical filename,
+ * which must be freed when no longer necessary. If BinReloc is
+ * not initialized, or if br_init() failed, then a copy of
+ * default_exe will be returned. If default_exe is NULL, then
+ * NULL will be returned.
+ */
+char *
+br_find_exe (const char *default_exe)
+{
+ if (exe == (char *) NULL) {
+ /* BinReloc is not initialized. */
+ if (default_exe != (const char *) NULL)
+ return strdup (default_exe);
+ else
+ return (char *) NULL;
+ }
+ return strdup (exe);
+}
+
+
+/** Locate the directory in which the current application is installed.
+ *
+ * The prefix is generated by the following pseudo-code evaluation:
+ * \code
+ * dirname(exename)
+ * \endcode
+ *
+ * @param default_dir A default directory which will used as fallback.
+ * @return A string containing the directory, which must be freed when no
+ * longer necessary. If BinReloc is not initialized, or if the
+ * initialization function failed, then a copy of default_dir
+ * will be returned. If default_dir is NULL, then NULL will be
+ * returned.
+ */
+char *
+br_find_exe_dir (const char *default_dir)
+{
+ if (exe == NULL) {
+ /* BinReloc not initialized. */
+ if (default_dir != NULL)
+ return strdup (default_dir);
+ else
+ return NULL;
+ }
+
+ return br_dirname (exe);
+}
+
+
+/** Locate the prefix in which the current application is installed.
+ *
+ * The prefix is generated by the following pseudo-code evaluation:
+ * \code
+ * dirname(dirname(exename))
+ * \endcode
+ *
+ * @param default_prefix A default prefix which will used as fallback.
+ * @return A string containing the prefix, which must be freed when no
+ * longer necessary. If BinReloc is not initialized, or if
+ * the initialization function failed, then a copy of default_prefix
+ * will be returned. If default_prefix is NULL, then NULL will be returned.
+ */
+char *
+br_find_prefix (const char *default_prefix)
+{
+ char *dir1, *dir2;
+
+ if (exe == (char *) NULL) {
+ /* BinReloc not initialized. */
+ if (default_prefix != (const char *) NULL)
+ return strdup (default_prefix);
+ else
+ return (char *) NULL;
+ }
+
+ dir1 = br_dirname (exe);
+ dir2 = br_dirname (dir1);
+ free (dir1);
+ return dir2;
+}
+
+
+/** Locate the application's binary folder.
+ *
+ * The path is generated by the following pseudo-code evaluation:
+ * \code
+ * prefix + "/bin"
+ * \endcode
+ *
+ * @param default_bin_dir A default path which will used as fallback.
+ * @return A string containing the bin folder's path, which must be freed when
+ * no longer necessary. If BinReloc is not initialized, or if
+ * the initialization function failed, then a copy of default_bin_dir will
+ * be returned. If default_bin_dir is NULL, then NULL will be returned.
+ */
+char *
+br_find_bin_dir (const char *default_bin_dir)
+{
+ char *prefix, *dir;
+
+ prefix = br_find_prefix ((const char *) NULL);
+ if (prefix == (char *) NULL) {
+ /* BinReloc not initialized. */
+ if (default_bin_dir != (const char *) NULL)
+ return strdup (default_bin_dir);
+ else
+ return (char *) NULL;
+ }
+
+ dir = br_build_path (prefix, "bin");
+ free (prefix);
+ return dir;
+}
+
+
+/** Locate the application's superuser binary folder.
+ *
+ * The path is generated by the following pseudo-code evaluation:
+ * \code
+ * prefix + "/sbin"
+ * \endcode
+ *
+ * @param default_sbin_dir A default path which will used as fallback.
+ * @return A string containing the sbin folder's path, which must be freed when
+ * no longer necessary. If BinReloc is not initialized, or if the
+ * initialization function failed, then a copy of default_sbin_dir will
+ * be returned. If default_bin_dir is NULL, then NULL will be returned.
+ */
+char *
+br_find_sbin_dir (const char *default_sbin_dir)
+{
+ char *prefix, *dir;
+
+ prefix = br_find_prefix ((const char *) NULL);
+ if (prefix == (char *) NULL) {
+ /* BinReloc not initialized. */
+ if (default_sbin_dir != (const char *) NULL)
+ return strdup (default_sbin_dir);
+ else
+ return (char *) NULL;
+ }
+
+ dir = br_build_path (prefix, "sbin");
+ free (prefix);
+ return dir;
+}
+
+
+/** Locate the application's data folder.
+ *
+ * The path is generated by the following pseudo-code evaluation:
+ * \code
+ * prefix + "/share"
+ * \endcode
+ *
+ * @param default_data_dir A default path which will used as fallback.
+ * @return A string containing the data folder's path, which must be freed when
+ * no longer necessary. If BinReloc is not initialized, or if the
+ * initialization function failed, then a copy of default_data_dir
+ * will be returned. If default_data_dir is NULL, then NULL will be
+ * returned.
+ */
+char *
+br_find_data_dir (const char *default_data_dir)
+{
+ char *prefix, *dir;
+
+ prefix = br_find_prefix ((const char *) NULL);
+ if (prefix == (char *) NULL) {
+ /* BinReloc not initialized. */
+ if (default_data_dir != (const char *) NULL)
+ return strdup (default_data_dir);
+ else
+ return (char *) NULL;
+ }
+
+ dir = br_build_path (prefix, "share");
+ free (prefix);
+ return dir;
+}
+
+
+/** Locate the application's localization folder.
+ *
+ * The path is generated by the following pseudo-code evaluation:
+ * \code
+ * prefix + "/share/locale"
+ * \endcode
+ *
+ * @param default_locale_dir A default path which will used as fallback.
+ * @return A string containing the localization folder's path, which must be freed when
+ * no longer necessary. If BinReloc is not initialized, or if the
+ * initialization function failed, then a copy of default_locale_dir will be returned.
+ * If default_locale_dir is NULL, then NULL will be returned.
+ */
+char *
+br_find_locale_dir (const char *default_locale_dir)
+{
+ char *data_dir, *dir;
+
+ data_dir = br_find_data_dir ((const char *) NULL);
+ if (data_dir == (char *) NULL) {
+ /* BinReloc not initialized. */
+ if (default_locale_dir != (const char *) NULL)
+ return strdup (default_locale_dir);
+ else
+ return (char *) NULL;
+ }
+
+ dir = br_build_path (data_dir, "locale");
+ free (data_dir);
+ return dir;
+}
+
+
+/** Locate the application's library folder.
+ *
+ * The path is generated by the following pseudo-code evaluation:
+ * \code
+ * prefix + "/lib"
+ * \endcode
+ *
+ * @param default_lib_dir A default path which will used as fallback.
+ * @return A string containing the library folder's path, which must be freed when
+ * no longer necessary. If BinReloc is not initialized, or if the initialization
+ * function failed, then a copy of default_lib_dir will be returned.
+ * If default_lib_dir is NULL, then NULL will be returned.
+ */
+char *
+br_find_lib_dir (const char *default_lib_dir)
+{
+ char *prefix, *dir;
+
+ prefix = br_find_prefix ((const char *) NULL);
+ if (prefix == (char *) NULL) {
+ /* BinReloc not initialized. */
+ if (default_lib_dir != (const char *) NULL)
+ return strdup (default_lib_dir);
+ else
+ return (char *) NULL;
+ }
+
+ dir = br_build_path (prefix, "lib");
+ free (prefix);
+ return dir;
+}
+
+
+/** Locate the application's libexec folder.
+ *
+ * The path is generated by the following pseudo-code evaluation:
+ * \code
+ * prefix + "/libexec"
+ * \endcode
+ *
+ * @param default_libexec_dir A default path which will used as fallback.
+ * @return A string containing the libexec folder's path, which must be freed when
+ * no longer necessary. If BinReloc is not initialized, or if the initialization
+ * function failed, then a copy of default_libexec_dir will be returned.
+ * If default_libexec_dir is NULL, then NULL will be returned.
+ */
+char *
+br_find_libexec_dir (const char *default_libexec_dir)
+{
+ char *prefix, *dir;
+
+ prefix = br_find_prefix ((const char *) NULL);
+ if (prefix == (char *) NULL) {
+ /* BinReloc not initialized. */
+ if (default_libexec_dir != (const char *) NULL)
+ return strdup (default_libexec_dir);
+ else
+ return (char *) NULL;
+ }
+
+ dir = br_build_path (prefix, "libexec");
+ free (prefix);
+ return dir;
+}
+
+
+/** Locate the application's configuration files folder.
+ *
+ * The path is generated by the following pseudo-code evaluation:
+ * \code
+ * prefix + "/etc"
+ * \endcode
+ *
+ * @param default_etc_dir A default path which will used as fallback.
+ * @return A string containing the etc folder's path, which must be freed when
+ * no longer necessary. If BinReloc is not initialized, or if the initialization
+ * function failed, then a copy of default_etc_dir will be returned.
+ * If default_etc_dir is NULL, then NULL will be returned.
+ */
+char *
+br_find_etc_dir (const char *default_etc_dir)
+{
+ char *prefix, *dir;
+
+ prefix = br_find_prefix ((const char *) NULL);
+ if (prefix == (char *) NULL) {
+ /* BinReloc not initialized. */
+ if (default_etc_dir != (const char *) NULL)
+ return strdup (default_etc_dir);
+ else
+ return (char *) NULL;
+ }
+
+ dir = br_build_path (prefix, "etc");
+ free (prefix);
+ return dir;
+}
+
+
+/***********************
+ * Utility functions
+ ***********************/
+
+/** Concatenate str1 and str2 to a newly allocated string.
+ *
+ * @param str1 A string.
+ * @param str2 Another string.
+ * @returns A newly-allocated string. This string should be freed when no longer needed.
+ */
+char *
+br_strcat (const char *str1, const char *str2)
+{
+ char *result;
+ size_t len1, len2;
+
+ if (str1 == NULL)
+ str1 = "";
+ if (str2 == NULL)
+ str2 = "";
+
+ len1 = strlen (str1);
+ len2 = strlen (str2);
+
+ result = (char *) malloc (len1 + len2 + 1);
+ /* Handle OOM (Tracker issue #35) */
+ if (result)
+ {
+ memcpy (result, str1, len1);
+ memcpy (result + len1, str2, len2);
+ result[len1 + len2] = '\0';
+ }
+ return result;
+}
+
+
+char *
+br_build_path (const char *dir, const char *file)
+{
+ char *dir2, *result;
+ size_t len;
+ int must_free = 0;
+
+ len = strlen (dir);
+ if (len > 0 && dir[len - 1] != '/') {
+ dir2 = br_strcat (dir, "/");
+ must_free = 1;
+ } else
+ dir2 = (char *) dir;
+
+ result = br_strcat (dir2, file);
+ if (must_free)
+ free (dir2);
+ return result;
+}
+
+
+/* Emulates glibc's strndup() */
+static char *
+br_strndup (const char *str, size_t size)
+{
+ char *result = (char *) NULL;
+ size_t len;
+
+ if (str == (const char *) NULL)
+ return (char *) NULL;
+
+ len = strlen (str);
+ if (len == 0)
+ return strdup ("");
+ if (size > len)
+ size = len;
+
+ result = (char *) malloc (len + 1);
+ /* Handle OOM (Tracker issue #35) */
+ if (result)
+ {
+ memcpy (result, str, size);
+ result[size] = '\0';
+ }
+ return result;
+}
+
+
+/** Extracts the directory component of a path.
+ *
+ * Similar to g_dirname() or the dirname commandline application.
+ *
+ * Example:
+ * \code
+ * br_dirname ("/usr/local/foobar"); --> Returns: "/usr/local"
+ * \endcode
+ *
+ * @param path A path.
+ * @returns A directory name. This string should be freed when no longer needed.
+ */
+char *
+br_dirname (const char *path)
+{
+ char *end, *result;
+
+ if (path == (const char *) NULL)
+ return (char *) NULL;
+
+ end = strrchr (path, '/');
+ if (end == (const char *) NULL)
+ return strdup (".");
+
+ while (end > path && *end == '/')
+ end--;
+ result = br_strndup (path, end - path + 1);
+ if (result[0] == 0) {
+ free (result);
+ return strdup ("/");
+ } else
+ return result;
+}
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __BINRELOC_C__ */
Index: tags/agile-1.2.0/src/Tools/binreloc.h
===================================================================
--- tags/agile-1.2.0/src/Tools/binreloc.h (revision 0)
+++ tags/agile-1.2.0/src/Tools/binreloc.h (revision 755)
@@ -0,0 +1,81 @@
+/*
+ * BinReloc - a library for creating relocatable executables
+ * Written by: Hongli Lai <h.lai@chello.nl>
+ * http://autopackage.org/
+ *
+ * This source code is public domain. You can relicense this code
+ * under whatever license you want.
+ *
+ * See http://autopackage.org/docs/binreloc/ for
+ * more information and how to use this.
+ */
+
+#ifndef __BINRELOC_H__
+#define __BINRELOC_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/** These error codes can be returned by br_init(), br_init_lib(), gbr_init() or gbr_init_lib(). */
+typedef enum {
+ /** Cannot allocate memory. */
+ BR_INIT_ERROR_NOMEM,
+ /** Unable to open /proc/self/maps; see errno for details. */
+ BR_INIT_ERROR_OPEN_MAPS,
+ /** Unable to read from /proc/self/maps; see errno for details. */
+ BR_INIT_ERROR_READ_MAPS,
+ /** The file format of /proc/self/maps is invalid; kernel bug? */
+ BR_INIT_ERROR_INVALID_MAPS,
+ /** BinReloc is disabled (the ENABLE_BINRELOC macro is not defined). */
+ BR_INIT_ERROR_DISABLED
+} BrInitError;
+
+
+#ifndef BINRELOC_RUNNING_DOXYGEN
+ /* Mangle symbol names to avoid symbol
+ * collisions with other ELF objects.
+ */
+ #define br_init VOlH37516025583052_br_init
+ #define br_init_lib VOlH37516025583052_br_init_lib
+ #define br_find_exe VOlH37516025583052_br_find_exe
+ #define br_find_exe_dir VOlH37516025583052_br_find_exe_dir
+ #define br_find_prefix VOlH37516025583052_br_find_prefix
+ #define br_find_bin_dir VOlH37516025583052_br_find_bin_dir
+ #define br_find_sbin_dir VOlH37516025583052_br_find_sbin_dir
+ #define br_find_data_dir VOlH37516025583052_br_find_data_dir
+ #define br_find_locale_dir VOlH37516025583052_br_find_locale_dir
+ #define br_find_lib_dir VOlH37516025583052_br_find_lib_dir
+ #define br_find_libexec_dir VOlH37516025583052_br_find_libexec_dir
+ #define br_find_etc_dir VOlH37516025583052_br_find_etc_dir
+ #define br_strcat VOlH37516025583052_br_strcat
+ #define br_build_path VOlH37516025583052_br_build_path
+ #define br_dirname VOlH37516025583052_br_dirname
+#endif
+
+int br_init (BrInitError *error);
+int br_init_lib (BrInitError *error);
+
+char *br_find_exe (const char *default_exe);
+char *br_find_exe_dir (const char *default_dir);
+char *br_find_prefix (const char *default_prefix);
+char *br_find_bin_dir (const char *default_bin_dir);
+char *br_find_sbin_dir (const char *default_sbin_dir);
+char *br_find_data_dir (const char *default_data_dir);
+char *br_find_locale_dir (const char *default_locale_dir);
+char *br_find_lib_dir (const char *default_lib_dir);
+char *br_find_libexec_dir (const char *default_libexec_dir);
+char *br_find_etc_dir (const char *default_etc_dir);
+
+/* Utility functions */
+char *br_strcat (const char *str1, const char *str2);
+char *br_build_path (const char *dir, const char *file);
+char *br_dirname (const char *path);
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __BINRELOC_H__ */
Index: tags/agile-1.2.0/src/Tools
===================================================================
--- tags/agile-1.2.0/src/Tools (revision 754)
+++ tags/agile-1.2.0/src/Tools (revision 755)
Property changes on: tags/agile-1.2.0/src/Tools
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,5 ##
+.deps
+.libs
+Makefile.in
+Makefile
+*.loT
Index: tags/agile-1.2.0/src/Cascade/Cascade.cc
===================================================================
--- tags/agile-1.2.0/src/Cascade/Cascade.cc (revision 0)
+++ tags/agile-1.2.0/src/Cascade/Cascade.cc (revision 755)
@@ -0,0 +1,185 @@
+// -*- C++ -*-
+#include "AGILe/Cascade/Cascade.hh"
+#include "AGILe/Cascade/CascadeWrapper2.hh"
+#include "AGILe/Utils.hh"
+#include "AGILe/HepMCTools.hh"
+
+#include "HepMC/HEPEVT_Wrapper.h"
+
+
+//-----------------------------------------------------------------------------
+// Implementation file for Cascade helper class.
+//
+// Authors: Doug Gingrich
+// Andy Buckley
+// Holger Schulz
+//-----------------------------------------------------------------------------
+
+
+namespace AGILe {
+
+
+ // Standard constructor
+ Cascade::Cascade() {
+ HepMC::HEPEVT_Wrapper::set_max_number_entries(4000);
+ HepMC::HEPEVT_Wrapper::set_sizeof_real(8);
+
+ // Start counting events at 1.
+ _nevt = 1;
+ }
+
+ /// Set up default params etc.
+ void Cascade::initialize() {
+ Generator::initialize();
+ //Cascade::setParam("LEPI", "2212");
+ //Cascade::setParam("HADI", "2212");
+ //int ISEED = 213123;
+ //int N1 = 0;
+ //int N2 = 0;
+ //call_rm48in(ISEED, N1, N2);
+
+ // Initialise Cascade parameters
+ getLog() << Log::INFO << "Initialise Cascade parameters (CASINI)..." << endl;
+ call_casini();
+ getLog() << Log::INFO << "CASINI is done..." << endl;
+
+ // Read steering file
+ getLog() << Log::INFO << "Now calling Steer..." << endl;
+ call_steer();
+ getLog() << Log::INFO << "Steer is done..." << endl;
+
+ // Change standard parameters of Cascade
+ getLog() << Log::INFO << "Change standard Cascade parameters (CASCHA)..." << endl;
+ call_cascha();
+ getLog() << Log::INFO << "CASCHA is done..." << endl;
+
+ // Change standard parameters of Pythia
+ getLog() << Log::INFO << "Change standard Pythia parameters (PYTCHA)..." << endl;
+ call_pytcha();
+ getLog() << Log::INFO << "PYTCHA is done..." << endl;
+ //Cascade::setParam("IFPS", 3);
+
+ // Switch on QCD processes by default
+ //getLog() << Log::INFO << "Setup basic processes..." << endl;
+ //Cascade::setParam("IPRO", 18);
+ //Cascade::setParam("IDIR", 0); // Don't do DIS but diffractive stuff by default
+ //Cascade::setParam("INTER", 2); // Switch to charged current interaction
+ ////Cascade::setParam("IDIR", 0); // Don't do DIS but diffractive stuff by default
+ ////Cascade::setParam("NFLAV", 1); // Set number of flaovurs used in structure functions
+ ////Cascade::setParam("NFLQCDC", 1); // Set number of flaovurs used in structure functions
+
+ // Perform internal Cascade remnant treatment
+ Cascade::setParam("ILHA", 0);
+
+ // Set time
+ getLog() << Log::INFO << "Calling PTIME..." << endl;
+ const char* name = "cascade";
+ int j = 1;
+ int k = 0;
+ call_ptime(name, j, k);
+
+ // Run cascade
+ getLog() << Log::INFO << "Now performing basic cross-section integration (CASCADE)..." << endl;
+ call_cascade();
+ getLog() << Log::INFO << "CASCADE is done..." << endl;
+
+ // Summary of integration result
+ call_caend(1);
+
+ _initialized = true;
+ }
+
+ void Cascade::setGenSpecificInitialState(PdgCode p1, double e1, PdgCode p2, double e2) {
+ getLog() << Log::INFO << "Setting initial state..." << endl;
+ Cascade::setParam("KBE1", p1);
+ Cascade::setParam("KBE2", p2);
+ Cascade::setParam("PBE1", e1);
+ Cascade::setParam("PBE2", e2);
+ }
+
+ // Run the generator for one event
+ void Cascade::makeEvent(HepMC::GenEvent& evt) {
+ Generator::makeEvent(evt);
+ getLog() << Log::DEBUG << "Fill event Nr: " << _nevt << endl;
+ call_event();
+ getLog() << Log::DEBUG << "Call pyhepc " << endl;
+ call_pyhepc(1);
+
+ // fill the event using HepMC
+ Cascade::fillEvent(evt);
+ evt.set_event_number(_nevt);
+ // Increment an event counter (Cascade does not count for itself (?)).
+ _nevt++;
+ }
+
+ // Fill a HepMC event
+ void Cascade::fillEvent(HepMC::GenEvent& evt) {
+ _hepevt.fill_next_event(&evt);
+ fixHepMCUnitsFromGeVmm(evt);
+ #ifdef HEPMC_HAS_CROSS_SECTION
+ const double xsecval = getCrossSection();
+ const double xsecerr = FC_CAEFFIC.SD;
+ getLog() << Log::DEBUG << "Writing cross-section = " << xsecval << " +- " << xsecerr << endl;
+ HepMC::GenCrossSection xsec;
+ xsec.set_cross_section(xsecval, xsecerr);
+ evt.set_cross_section(xsec);
+ #endif
+ }
+
+ const double Cascade::getCrossSection(){
+ _crossSection = FC_CAEFFIC.AVGI * 1000.0;
+ return _crossSection;
+ }
+
+ // Set string parameters
+ bool Cascade::setParam(const string& name, const string& value) {
+ Generator::setParam(name, value);
+
+ ////// Set double-valued params
+ if (name == "PBE1") {
+ getLog() << Log::INFO << "Setting ... (PBE1) = " << value << endl;
+ FC_CABEAM.PBEAM[0] = -1*asDouble(value);
+ }
+ else if (name == "PBE2") {
+ getLog() << Log::INFO << "Setting ... (PBE2) = " << value << endl;
+ FC_CABEAM.PBEAM[1] = asDouble(value);
+ }
+
+ //// Set int-valued params
+ else if (name == "IFPS") {
+ getLog() << Log::INFO << "Setting ... (IFPS) = " << value << endl;
+ FC_CAINPU.IFPS = asInt(value);
+ }
+ else if (name == "ILHA") {
+ getLog() << Log::INFO << "Setting ... (ILHA) = " << value << endl;
+ FC_CAHERUP.Ilha = asInt(value);
+ }
+ else if (name == "KBE1") {
+ getLog() << Log::INFO << "Setting ... (KBE1) = " << value << endl;
+ FC_CABEAM.KBEAM[0] = asInt(value);
+ }
+ else if (name == "KBE2") {
+ getLog() << Log::INFO << "Setting ... (KBE2) = " << value << endl;
+ FC_CABEAM.KBEAM[1] = asInt(value);
+ }
+
+ else {
+ getLog() << Log::ERROR << "Cascade doesn't have a parameter called " << name << endl;
+ //return FAILURE;
+ }
+ return SUCCESS;
+ }
+
+ // Tidy up after ourselves
+ void Cascade::finalize() {
+ getLog() << Log::INFO << "Finalising..." << endl;
+ // Print out stats from run
+ call_caend(20);
+ }
+
+}
+
+extern "C" {
+ AGILe::Generator* create() { return new AGILe::Cascade(); }
+ void destroy(AGILe::Generator* gen) { delete gen; }
+}
Index: tags/agile-1.2.0/src/Cascade/CascadeWrapper.cc
===================================================================
--- tags/agile-1.2.0/src/Cascade/CascadeWrapper.cc (revision 0)
+++ tags/agile-1.2.0/src/Cascade/CascadeWrapper.cc (revision 755)
@@ -0,0 +1,66 @@
+// -*- C++ -*-
+
+#include "AGILe/Cascade/CascadeWrapper2.hh"
+#include <cstring>
+
+// Define methods to hide the subtle syntax necessary to call fortran from C++
+
+void call_casini() {
+ casini_();
+}
+
+void call_ptime(const char *name, int j, int k) {
+ ptime_(name, &j, &k);
+}
+
+void call_steer() {
+ steer_();
+}
+
+void call_cascade() {
+ cascade_();
+}
+
+void call_cascha() {
+ cascha_();
+}
+
+void call_pytcha() {
+ pytcha_();
+}
+
+void call_pyinit( const char* frame, const char* beam, const char* target, double win ) {
+ pyinit_( frame, beam, target, &win, strlen(frame), strlen(beam), strlen(target) );
+}
+
+void call_pygive( const char* chin ) {
+ pygive_( chin, strlen(chin) );
+}
+
+void call_aricha() {
+ aricha_();
+}
+
+void call_arinit(const char *name) {
+ arinit_(name);
+}
+
+void call_caend(int i) {
+ caend_(&i);
+}
+
+void call_event() {
+ event_();
+}
+
+void call_caupevnt() {
+ caupevnt_();
+}
+
+// Pythia routines
+void call_pyhepc( int mode ){
+ pyhepc_( &mode );
+}
+//void call_rm48in(int ISEED, int N1, int N2) {
+ //rm48in(&ISEED, &N1, &N2);
+//}
Index: tags/agile-1.2.0/src/Cascade/Makefile.am
===================================================================
--- tags/agile-1.2.0/src/Cascade/Makefile.am (revision 0)
+++ tags/agile-1.2.0/src/Cascade/Makefile.am (revision 755)
@@ -0,0 +1,3 @@
+lib_LTLIBRARIES = libAGILeCascade.la
+
+libAGILeCascade_la_SOURCES = Cascade.cc CascadeWrapper.cc
Index: tags/agile-1.2.0/src/Cascade
===================================================================
--- tags/agile-1.2.0/src/Cascade (revision 754)
+++ tags/agile-1.2.0/src/Cascade (revision 755)
Property changes on: tags/agile-1.2.0/src/Cascade
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,4 ##
+Makefile
+Makefile.in
+.deps
+.libs
Index: tags/agile-1.2.0/src/FPythia/initpydata.f
===================================================================
--- tags/agile-1.2.0/src/FPythia/initpydata.f (revision 0)
+++ tags/agile-1.2.0/src/FPythia/initpydata.f (revision 755)
@@ -0,0 +1,9 @@
+c
+c Matt.Dobbs@Cern.CH, December 1999
+c EXTERNAL statement links PYDATA on most machines.
+c (Often necessary for the initialization of Pythia)
+c
+ subroutine initpydata
+ EXTERNAL PYDATA
+ return
+ end
Index: tags/agile-1.2.0/src/FPythia/pyevwt.f
===================================================================
--- tags/agile-1.2.0/src/FPythia/pyevwt.f (revision 0)
+++ tags/agile-1.2.0/src/FPythia/pyevwt.f (revision 755)
@@ -0,0 +1,21 @@
+
+ subroutine pyevwt(wtxs)
+
+ implicit none
+ double precision vint(400), paru(200), parj(200)
+ double precision wtxs, pt2
+ integer mint(400), mstu(200), mstj(200)
+ COMMON/PYINT1/MINT,VINT
+ COMMON/PYDAT1/MSTU,PARU,MSTJ,PARJ
+
+c write(MSTU(11), *), 'called custom pyevwt'
+
+ if(mint(1).eq.11 .or. mint(1).eq.12) then
+ pt2 = vint(48)
+ wtxs = pt2**3
+ else
+ wtxs=1.0
+ endif
+
+ return
+ end
Index: tags/agile-1.2.0/src/FPythia/FPythia.cc
===================================================================
--- tags/agile-1.2.0/src/FPythia/FPythia.cc (revision 0)
+++ tags/agile-1.2.0/src/FPythia/FPythia.cc (revision 755)
@@ -0,0 +1,251 @@
+// -*- C++ -*-
+#include "AGILe/FPythia/FPythia.hh"
+#include "AGILe/FPythia/FPythiaWrapper62.hh"
+#include "AGILe/Utils.hh"
+#include "AGILe/HepMCTools.hh"
+
+#include "HepMC/HEPEVT_Wrapper.h"
+
+namespace AGILe {
+
+ // Author: Andy Buckley
+
+
+ /// Standard constructor
+ FPythia::FPythia() {
+ /// Pythia uses HEPEVT with 4000/10000 entries and 8-byte floats
+ FC_PYJETS.n = 0; //< Ensure dummyness of the next call
+ call_pyhepc(1);
+ HepMC::HEPEVT_Wrapper::set_max_number_entries(FC_PYDAT1.mstu[8-1]);
+ //HepMC::HEPEVT_Wrapper::set_max_number_entries(10000);
+ HepMC::HEPEVT_Wrapper::set_sizeof_real(8);
+
+ // Start counting events at 1.
+ _nevt = 1;
+
+ // Initialize Pythia PYDATA block data as external
+ FC_INITPYDATA();
+
+ // Write the full shower structure
+ setParam("MSTP(125)", 2);
+
+ // Tell Pythia not to write multiple copies of particles in event record.
+ setParam("MSTP(128)", 2);
+
+ // Set up particle names map
+ /// @todo Also deal with gamma/e- etc. for resolved photoproduction...
+ _particleNames[ELECTRON] = "e-";
+ _particleNames[POSITRON] = "e+";
+ _particleNames[PROTON] = "p+";
+ _particleNames[ANTIPROTON] = "pbar-";
+ _particleNames[NEUTRON] = "n0";
+ _particleNames[ANTINEUTRON] = "nbar0";
+ _particleNames[PHOTON] = "gamma";
+ _particleNames[MUON] = "mu-";
+ _particleNames[ANTIMUON] = "mu+";
+ // TAU, ANTITAU
+ _particleNames[NU_E] = "nu_e";
+ _particleNames[NU_EBAR] = "nu_ebar";
+ _particleNames[NU_MU] = "nu_mu";
+ _particleNames[NU_MUBAR] = "nu_mubar";
+ _particleNames[NU_TAU] = "nu_tau";
+ _particleNames[NU_TAUBAR] = "nu_taubar";
+ _particleNames[PIPLUS] = "pi+";
+ _particleNames[PIMINUS] = "pi-";
+ // PIZERO
+ // PHOTOELECTRON, PHOTOPOSITRON,
+ // PHOTOMUON, PHOTOANTIMUON,
+ // PHOTOTAU, PHOTOANTITAU,
+ /// For Pythia, other "normal" particles are:
+ /// * gamma/e-, gamma/e+, gamma/mu-, gamma/mu+, gamma/tau-, gamma/tau+, pi0
+ /// Also, with crappy PDF parameterisations and other defects:
+ /// * K+, K-, KS0, KL0, Lambda0, Sigma-, Sigma0, Sigma+, Xi-, Xi0, Omega
+ /// And, not useable at the moment:
+ /// * pomeron, reggeon
+ }
+
+
+ void FPythia::setGenSpecificInitialState(PdgCode p1, double e1, PdgCode p2, double e2) {
+ getLog() << Log::INFO << "Setting initial state..." << endl;
+ // For Pythia, we have to hold on to this state until initialize() is called.
+ _particleName1 = _particleNames[p1];
+ _particleName2 = _particleNames[p2];
+ /// @todo Get momenta and energies unconfused.
+ _e1 = e1;
+ _e2 = e2;
+ }
+
+
+ /// Set up default params etc.
+ void FPythia::initialize() {
+ Generator::initialize();
+ // Call pythia initialization with stored parameters as set by setGenSpecificInitialState()
+ if (FC_PYPARS.mstp[142] != 1) {
+ if (fuzzyEquals(_e1, _e2)) {
+ call_pyinit("CMS", _particleName1.c_str(), _particleName2.c_str(), _e1+_e2);
+ } else {
+ stringstream p13cmd, p23cmd;
+ p13cmd << "P(1,3) = " << _e1;
+ p23cmd << "P(2,3) = " << -_e2;
+ call_pygive("P(1,1) = 0.0");
+ call_pygive("P(1,2) = 0.0");
+ call_pygive(p13cmd.str().c_str());
+ call_pygive("P(2,1) = 0.0");
+ call_pygive("P(2,2) = 0.0");
+ call_pygive(p23cmd.str().c_str());
+ call_pyinit("3MOM", _particleName1.c_str(), _particleName2.c_str(), 0.0);
+ }
+ } else {
+ // User process, parameters taken from LHAPDF initialisation file.
+ call_pyinit("USER"," "," ", 0.0);
+ }
+ _initialized = true;
+ }
+
+
+ // Set a parameter with a string value
+ bool FPythia::setParam(const string& name, const string& value) {
+ Generator::setParam(name, value);
+ const string pygive_input(toUpper(name) + "=" + value);
+ call_pygive(pygive_input.c_str());
+ return SUCCESS;
+ }
+
+
+ // Run the generator for one event
+ void FPythia::makeEvent(HepMC::GenEvent& evt) {
+ Generator::makeEvent(evt);
+ /// @todo Allow control of choice of underlying event and shower evolutions via "meta-params".
+ // Generate one event.
+ call_pyevnt();
+ // Generate one event with new UE and shower.
+ //call_pyevnw();
+ // Convert common PYJETS into common HEPEVT.
+ call_pyhepc(1);
+ // Increment an event counter (Pythia does not count for itself).
+ _nevt++;
+ // fill the event using HepMC
+ fillEvent(evt);
+ evt.set_event_number(_nevt);
+ }
+
+
+ // Fill a HepMC event
+ void FPythia::fillEvent(HepMC::GenEvent& evt) {
+ _hepevt.fill_next_event(&evt);
+ fixHepMCUnitsFromGeVmm(evt);
+
+ evt.weights().clear();
+
+ if(FC_PYPARS.mstp[141]!=0){
+ evt.weights().push_back(FC_PYPARS.pari[9]);
+ }else{
+ evt.weights().push_back(1.0);
+ }
+
+ #ifdef HEPMC_HAS_CROSS_SECTION
+ HepMC::GenCrossSection xsec;
+ const double xsecval = getCrossSection();
+ const double xsecerr = getCrossSection() / std::sqrt(FC_PYPARS.msti[4]);
+ getLog() << Log::DEBUG << "Writing cross-section = " << xsecval << " +- " << xsecerr << endl;
+ xsec.set_cross_section(xsecval, xsecerr);
+ evt.set_cross_section(xsec);
+ #endif
+ }
+
+
+ string FPythia::getPDFSet(PdgCode pid) {
+ switch(pid) {
+ case PROTON:
+ case ANTIPROTON:
+ if (FC_PYPARS.mstp[51] == 1) {
+ return "PYINTERNAL";
+ } else if(FC_PYPARS.mstp[51] == 2) {
+ return "PYLHAPDF";
+ }
+ break;
+
+ case ELECTRON:
+ case POSITRON:
+ if (FC_PYPARS.mstp[55] == 1) {
+ return "PYINTERNAL";
+ } else if(FC_PYPARS.mstp[55] == 2) {
+ return "PYLHAPDF";
+ }
+ break;
+ default:
+ break;
+ }
+ throw runtime_error("Unknown particle for PDF Set");
+ }
+
+
+ int FPythia::getPDFMember(PdgCode pid) {
+ switch(pid) {
+ case PROTON:
+ case ANTIPROTON:
+ return FC_PYPARS.mstp[50];
+ break;
+ case ELECTRON:
+ case POSITRON:
+ return FC_PYPARS.mstp[54];
+ break;
+ default:
+ break;
+ }
+ throw runtime_error("Unknown particle for PDF Set");
+ }
+
+
+ string FPythia::getPDFScheme(PdgCode pid) const {
+ switch(pid){
+ case PROTON:
+ case ANTIPROTON:
+ if (FC_PYPARS.mstp[51]==1) {
+ return "PYINTERNAL";
+ } else if(FC_PYPARS.mstp[51]==2) {
+ return "LHAPDF";
+ }
+ break;
+ case ELECTRON:
+ case POSITRON:
+ if (FC_PYPARS.mstp[55]==1) {
+ return "PYINTERNAL";
+ } else if(FC_PYPARS.mstp[55]==2) {
+ return "LHAPDF";
+ }
+ break;
+ default:
+ break;
+ }
+ throw runtime_error("Unknown particle for PDF Set");
+ }
+
+
+ const double FPythia::getCrossSection(){
+ // _crossSection = FC_PYINT5.xsec[2][0] * 1e09;
+ _crossSection = FC_PYPARS.pari[0] * 1e09;
+ return _crossSection;
+ }
+
+ const string FPythia::getVersion(){
+ stringstream s;
+ s << FC_PYPARS.mstp[180] << "." << FC_PYPARS.mstp[181];
+ return s.str();
+ }
+
+ // Tidy up after ourselves
+ void FPythia::finalize() {
+ getLog() << Log::INFO << "Finalising..." << endl;
+ // Print out stats from run
+ call_pystat(1);
+ }
+
+
+}
+
+
+extern "C" {
+ AGILe::Generator* create() { return new AGILe::FPythia(); }
+ void destroy(AGILe::Generator* gen) { delete gen; }
+}
Index: tags/agile-1.2.0/src/FPythia/FPythiaWrapper.cc
===================================================================
--- tags/agile-1.2.0/src/FPythia/FPythiaWrapper.cc (revision 0)
+++ tags/agile-1.2.0/src/FPythia/FPythiaWrapper.cc (revision 755)
@@ -0,0 +1,29 @@
+// -*- C++ -*-
+
+#include "AGILe/FPythia/FPythiaWrapper.hh"
+#include <cstring>
+
+// Define methods to hide the subtle syntax necessary to call fortran from C++
+void call_pyhepc( int mode ){
+ pyhepc_( &mode );
+}
+
+void call_pyinit( const char* frame, const char* beam, const char* target, double win ) {
+ pyinit_( frame, beam, target, &win, strlen(frame), strlen(beam), strlen(target) );
+}
+
+void call_pygive( const char* chin ) {
+ pygive_( chin, strlen(chin) );
+}
+
+void call_pylist( int mode ) {
+ pylist_( &mode );
+}
+
+void call_pystat( int mode ) {
+ pystat_( &mode );
+}
+
+void call_pyevnt() {
+ pyevnt_();
+}
Index: tags/agile-1.2.0/src/FPythia/Makefile.am
===================================================================
--- tags/agile-1.2.0/src/FPythia/Makefile.am (revision 0)
+++ tags/agile-1.2.0/src/FPythia/Makefile.am (revision 755)
@@ -0,0 +1,10 @@
+lib_LTLIBRARIES = libAGILeFPythia.la libAGILeFPythia_pyevwt.la
+
+libAGILeFPythia_la_SOURCES = FPythia.cc FPythiaWrapper.cc initpydata.f
+libAGILeFPythia_la_LDFLAGS = $(FORTRANLDFLAGS) $(DLOPENFLAGS) $(VERSIONFLAGS)
+libAGILeFPythia_la_LIBADD = $(FORTRANLIBADD)
+
+libAGILeFPythia_pyevwt_la_SOURCES = pyevwt.f
+libAGILeFPythia_pyevwt_la_LDFLAGS = $(FORTRANLDFLAGS) $(DLOPENFLAGS) $(VERSIONFLAGS)
+libAGILeFPythia_pyevwt_la_LIBADD = $(FORTRANLIBADD)
+
Index: tags/agile-1.2.0/src/FPythia
===================================================================
--- tags/agile-1.2.0/src/FPythia (revision 754)
+++ tags/agile-1.2.0/src/FPythia (revision 755)
Property changes on: tags/agile-1.2.0/src/FPythia
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,4 ##
+.deps
+.libs
+Makefile.in
+Makefile
Index: tags/agile-1.2.0/src/AlpGen/Makefile.am
===================================================================
--- tags/agile-1.2.0/src/AlpGen/Makefile.am (revision 0)
+++ tags/agile-1.2.0/src/AlpGen/Makefile.am (revision 755)
@@ -0,0 +1,21 @@
+lib_LTLIBRARIES = libAGILeAlpGen.la libAGILeAlpGenFPythia.la libAGILeAlpGenFHerwig.la libAGILeAlpGenFHerwigJimmy.la
+
+## AlpGen
+libAGILeAlpGen_la_SOURCES = AlpGen.cc
+libAGILeAlpGen_la_LDFLAGS = $(FORTRANLDFLAGS) $(DLOPENFLAGS) $(VERSIONFLAGS)
+libAGILeAlpGen_la_LIBADD = $(FORTRANLIBADD)
+
+## AlpGenFHerwig
+libAGILeAlpGenFHerwig_la_SOURCES = AlpGenFHerwig.cc
+libAGILeAlpGenFHerwig_la_LDFLAGS = $(FORTRANLDFLAGS) $(DLOPENFLAGS) $(VERSIONFLAGS)
+libAGILeAlpGenFHerwig_la_LIBADD = $(FORTRANLIBADD) $(top_builddir)/src/FHerwig/libAGILeFHerwig.la
+
+## AlpGenFHerwigJimmy
+libAGILeAlpGenFHerwigJimmy_la_SOURCES = AlpGenFHerwigJimmy.cc
+libAGILeAlpGenFHerwigJimmy_la_LDFLAGS = $(FORTRANLDFLAGS) $(DLOPENFLAGS) $(VERSIONFLAGS)
+libAGILeAlpGenFHerwigJimmy_la_LIBADD = $(FORTRANLIBADD) $(top_builddir)/src/FHerwig/libAGILeFHerwigJimmy.la
+
+## AlpGenFPythia
+libAGILeAlpGenFPythia_la_SOURCES = AlpGenFPythia.cc
+libAGILeAlpGenFPythia_la_LDFLAGS = $(FORTRANLDFLAGS) $(DLOPENFLAGS) $(VERSIONFLAGS)
+libAGILeAlpGenFPythia_la_LIBADD = $(FORTRANLIBADD) $(top_builddir)/src/FPythia/libAGILeFPythia.la
Index: tags/agile-1.2.0/src/AlpGen/AlpGen.cc
===================================================================
--- tags/agile-1.2.0/src/AlpGen/AlpGen.cc (revision 0)
+++ tags/agile-1.2.0/src/AlpGen/AlpGen.cc (revision 755)
@@ -0,0 +1,58 @@
+#include "AGILe/AlpGen/AlpGen.hh"
+#include "AGILe/AlpGen/AlpGenWrapper.hh"
+#include "AGILe/Utils.hh"
+//#include "HepMC/HEPEVT_Wrapper.h"
+
+
+//-----------------------------------------------------------------------------
+// Implementation file for AlpGen base class
+// This is the file-reading interface only. It needs to be used in conjunction
+// with FHerwig or FPythia. This class is only to provide access to the parameter
+// settings.
+//
+// Author: Andy Buckley
+//-----------------------------------------------------------------------------
+
+
+namespace AGILe {
+
+
+ // Set string parameters
+ bool AlpGen::setParam(const string& name, const string& value) {
+ Generator::setParam(name, value);
+
+ // Strings
+ if (name == "ALPGENFILE") {
+ getLog() << Log::INFO << "Setting ALPGENFILE = " << value << endl;
+ size_t nch = (value.size() < 100) ? value.size() : 99;
+ for (size_t i = 0; i < 100; i++) {
+ if (i < nch) {
+ FC_AHIO.FILENAME[i] = value.data()[i];
+ } else {
+ FC_AHIO.FILENAME[i] = ' ';
+ }
+ }
+ }
+
+ // Integers
+ if (name == "IEXC") {
+ getLog() << Log::INFO << "Setting ALPGEN IEXC = " << value << endl;
+ FC_AHOPTS.IEXC = asInt(value);
+ }
+
+ // Doubles
+ else if (name == "ETACLMAX") {
+ getLog() << Log::INFO << "Setting ETACLMAX = " << value << endl;
+ FC_AHOPTS.ETACLMAX = asDouble(value);
+ }
+
+ // Fallback
+ else {
+ //getLog() << Log::ERROR << "AlpGen doesn't have a parameter called " << name << endl;
+ return FAILURE;
+ }
+ return SUCCESS;
+ }
+
+
+}
Index: tags/agile-1.2.0/src/AlpGen/AlpGenFHerwigJimmy.cc
===================================================================
--- tags/agile-1.2.0/src/AlpGen/AlpGenFHerwigJimmy.cc (revision 0)
+++ tags/agile-1.2.0/src/AlpGen/AlpGenFHerwigJimmy.cc (revision 755)
@@ -0,0 +1,84 @@
+// -*- C++ -*-
+#include "AGILe/AlpGen/AlpGenFHerwigJimmy.hh"
+#include "AGILe/AlpGen/AlpGenWrapper.hh"
+#include "AGILe/FHerwig/FHerwigWrapper65.hh"
+#include "AGILe/Utils.hh"
+#include "HepMC/HEPEVT_Wrapper.h"
+
+
+//-----------------------------------------------------------------------------
+// Implementation file for class : AlpGenFHerwigJimmy
+// This is the file-reading interface wrapper only. It contains an instance of
+// FHerwigJimmy which does most of the work. This class is only to provide access to
+// the parameter
+// settings.
+//
+// Authors: Jon Butterworth
+// Andy Buckley
+//-----------------------------------------------------------------------------
+
+
+namespace AGILe {
+
+
+ // Standard constructor
+ AlpGenFHerwigJimmy::AlpGenFHerwigJimmy() {
+ // Set flag to read from LHA event file
+ FC_HWPROC.IPROC = -100;
+
+ // Set the ALPGEN filename to "zhjj" by default
+ FC_AHIO.FILENAME[0] = 'z';
+ FC_AHIO.FILENAME[1] = 'h';
+ FC_AHIO.FILENAME[2] = 'j';
+ FC_AHIO.FILENAME[3] = 'j';
+ }
+
+
+ // Set string parameters
+ bool AlpGenFHerwigJimmy::setParam(const string& name, const string& value) {
+ // Try AlpGen param handling first
+ bool ok = _alpgen.setParam(name, value);
+ if (ok) return SUCCESS;
+ // Fall back to Herwig+Jimmy param handling
+ ok = FHerwigJimmy::setParam(name, value);
+ if (ok) return SUCCESS;
+ // Fail
+ getLog() << Log::ERROR << "AlpGenFHerwigJimmy doesn't have a parameter called " << name << endl;
+ return FAILURE;
+ }
+
+
+ // Call event generation with veto routine for MLM matching
+ void AlpGenFHerwigJimmy::makeEvent(HepMC::GenEvent& evt) {
+ Generator::makeEvent(evt);
+ FC_HWUINE(); // Initialize event
+ FC_HWEPRO(); // Generate hard subprocess
+ // Call the matching routine
+ int imatch = 0;
+ FC_UPVETO(&imatch);
+ if (imatch != 0) {
+ getLog() << Log::DEBUG << "Event killed by UPVETO" << endl;
+ FC_HWUFNE();
+ return;
+ }
+ FC_HWBGEN(); // Generate parton cascade
+ FC_HWDHOB(); // Do heavy quark decays
+ FC_HWCFOR(); // Do cluster formation
+ FC_HWCDEC(); // Do cluster decays
+ FC_HWDHAD(); // Do unstable particle decays
+ FC_HWDHVY(); // Do heavy flavor decays
+ FC_HWMEVT(); // Add soft underlying event
+ FC_HWUFNE(); // Finish event
+ fillEvent(evt);
+ return;
+ }
+
+
+}
+
+
+// Class factory
+extern "C" {
+ AGILe::Generator* create() { return new AGILe::AlpGenFHerwigJimmy(); }
+ void destroy(AGILe::Generator* gen) { delete gen; }
+}
Index: tags/agile-1.2.0/src/AlpGen/AlpGenFPythia.cc
===================================================================
--- tags/agile-1.2.0/src/AlpGen/AlpGenFPythia.cc (revision 0)
+++ tags/agile-1.2.0/src/AlpGen/AlpGenFPythia.cc (revision 755)
@@ -0,0 +1,43 @@
+#include "AGILe/AlpGen/AlpGenFPythia.hh"
+#include "AGILe/AlpGen/AlpGenWrapper.hh"
+#include "AGILe/Utils.hh"
+#include "HepMC/HEPEVT_Wrapper.h"
+
+namespace AGILe {
+
+
+ // Standard constructor
+ AlpGenFPythia::AlpGenFPythia() {
+
+ // Set flag to read from LHA event file
+ FPythia::setParam("MSTP(143)", 1);
+
+ // Set the ALPGEN filename to "zhjj" by default
+ FC_AHIO.FILENAME[0] = 'z';
+ FC_AHIO.FILENAME[1] = 'h';
+ FC_AHIO.FILENAME[2] = 'j';
+ FC_AHIO.FILENAME[3] = 'j';
+ }
+
+
+ // Set string parameters
+ bool AlpGenFPythia::setParam(const string& name, const string& value) {
+ // Try AlpGen param handling first
+ bool ok = _alpgen.setParam(name, value);
+ if (ok) return SUCCESS;
+ // Fall back to Pythia param handling
+ ok = FPythia::setParam(name, value);
+ if (ok) return SUCCESS;
+ // Fail
+ getLog() << Log::ERROR << "AlpGenFPythia doesn't have a parameter called " << name << endl;
+ return FAILURE;
+ }
+
+}
+
+
+// Class factory
+extern "C" {
+ AGILe::Generator* create() { return new AGILe::AlpGenFPythia(); }
+ void destroy(AGILe::Generator* gen) { delete gen; }
+}
Index: tags/agile-1.2.0/src/AlpGen/AlpGenFHerwig.cc
===================================================================
--- tags/agile-1.2.0/src/AlpGen/AlpGenFHerwig.cc (revision 0)
+++ tags/agile-1.2.0/src/AlpGen/AlpGenFHerwig.cc (revision 755)
@@ -0,0 +1,84 @@
+// -*- C++ -*-
+#include "AGILe/AlpGen/AlpGenFHerwig.hh"
+#include "AGILe/AlpGen/AlpGenWrapper.hh"
+#include "AGILe/FHerwig/FHerwigWrapper65.hh"
+#include "AGILe/Utils.hh"
+#include "HepMC/HEPEVT_Wrapper.h"
+
+
+//-----------------------------------------------------------------------------
+// Implementation file for class : AlpGenFHerwig
+// This is the file-reading interface wrapper only. It contains an instance of
+// FHerwig which does most of the work. This class is only to provide access to
+// the parameter
+// settings.
+//
+// Authors: Jon Butterworth
+// Andy Buckley
+//-----------------------------------------------------------------------------
+
+
+namespace AGILe {
+
+
+ // Standard constructor
+ AlpGenFHerwig::AlpGenFHerwig() {
+ // Set flag to read from LHA event file
+ FC_HWPROC.IPROC = -100;
+
+ // Set the ALPGEN filename to "zhjj" by default
+ FC_AHIO.FILENAME[0] = 'z';
+ FC_AHIO.FILENAME[1] = 'h';
+ FC_AHIO.FILENAME[2] = 'j';
+ FC_AHIO.FILENAME[3] = 'j';
+ }
+
+
+ // Set string parameters
+ bool AlpGenFHerwig::setParam(const string& name, const string& value) {
+ // Try AlpGen param handling first
+ bool ok = _alpgen.setParam(name, value);
+ if (ok) return SUCCESS;
+ // Fall back to Herwig param handling
+ ok = FHerwig::setParam(name, value);
+ if (ok) return SUCCESS;
+ // Fail
+ getLog() << Log::ERROR << "AlpGenFHerwig doesn't have a parameter called " << name << endl;
+ return FAILURE;
+ }
+
+
+ // Call event generation with veto routine for MLM matching
+ void AlpGenFHerwig::makeEvent(HepMC::GenEvent& evt) {
+ Generator::makeEvent(evt);
+ FC_HWUINE(); // Initialize event
+ FC_HWEPRO(); // Generate hard subprocess
+ // Call the matching routine
+ int imatch = 0;
+ FC_UPVETO(&imatch);
+ if (imatch != 0) {
+ getLog() << Log::DEBUG << "Event killed by UPVETO" << endl;
+ FC_HWUFNE();
+ return;
+ }
+ FC_HWBGEN(); // Generate parton cascade
+ FC_HWDHOB(); // Do heavy quark decays
+ FC_HWCFOR(); // Do cluster formation
+ FC_HWCDEC(); // Do cluster decays
+ FC_HWDHAD(); // Do unstable particle decays
+ FC_HWDHVY(); // Do heavy flavor decays
+ FC_HWMEVT(); // Add soft underlying event
+ FC_HWUFNE(); // Finish event
+ fillEvent(evt);
+ return;
+ }
+
+
+}
+
+
+// Class factory
+extern "C" {
+ AGILe::Generator* create() { return new AGILe::AlpGenFHerwig(); }
+ void destroy(AGILe::Generator* gen) { delete gen; }
+}
Index: tags/agile-1.2.0/src/AlpGen
===================================================================
--- tags/agile-1.2.0/src/AlpGen (revision 754)
+++ tags/agile-1.2.0/src/AlpGen (revision 755)
Property changes on: tags/agile-1.2.0/src/AlpGen
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,4 ##
+.deps
+.libs
+Makefile.in
+Makefile
Index: tags/agile-1.2.0/src/IO/Makefile.am
===================================================================
--- tags/agile-1.2.0/src/IO/Makefile.am (revision 0)
+++ tags/agile-1.2.0/src/IO/Makefile.am (revision 755)
@@ -0,0 +1,2 @@
+noinst_LTLIBRARIES = libAGILeIO.la
+libAGILeIO_la_SOURCES = AGILeIO.cc
Index: tags/agile-1.2.0/src/IO/AGILeIO.cc
===================================================================
--- tags/agile-1.2.0/src/IO/AGILeIO.cc (revision 0)
+++ tags/agile-1.2.0/src/IO/AGILeIO.cc (revision 755)
@@ -0,0 +1,129 @@
+// -*- C++ -*-
+
+#include "AGILe/AGILe.hh"
+#include "AGILe/GeneratorState.hh"
+
+#include "TinyXML/tinyxml.h"
+
+namespace AGILe{
+
+ ostream &operator<<(ostream &os, const GeneratorState &state){
+
+ TiXmlDocument doc;
+
+ TiXmlElement hepml("hepml");
+
+ doc.InsertEndChild(hepml);
+
+ TiXmlElement* docRoot = doc.RootElement();
+
+ TiXmlElement collision("collision");
+
+ vector<TiXmlElement> pdfElements;
+
+ vector<Beam> beams = state.getBeams();
+
+ bool gotBeams = false;
+
+ for(vector<Beam>::iterator beamIt = beams.begin();
+ beamIt != beams.end(); ++beamIt){
+ TiXmlElement beamElement("particle");
+ beamElement.SetAttribute("name", beamIt->name);
+ beamElement.SetAttribute("id", beamIt->position);
+
+ TiXmlElement momentumElement("momentum");
+ momentumElement.SetAttribute("unit", "GeV");
+
+ stringstream s;
+ s<<beamIt->energy;
+ TiXmlText val(s.str());
+ momentumElement.InsertEndChild(val);
+ beamElement.InsertEndChild(momentumElement);
+ collision.InsertEndChild(beamElement);
+ gotBeams = true;
+
+ TiXmlElement pdfEl("pdf");
+ PDF pdf = state.getPDF(beamIt->name);
+ pdfEl.SetAttribute("set", pdf.set);
+ pdfEl.SetAttribute("member", pdf.member);
+ pdfEl.SetAttribute("scheme", pdf.scheme);
+ TiXmlElement pdfParticle("particle");
+ pdfParticle.SetAttribute("name", pdf.particleId);
+ pdfEl.InsertEndChild(pdfParticle);
+ pdfElements.push_back(pdfEl);
+ }
+
+ TiXmlElement reaction("reaction");
+
+ if(gotBeams) reaction.InsertEndChild(collision);
+
+ docRoot->InsertEndChild(reaction);
+
+ TiXmlElement runseries("runseries");
+
+ TiXmlElement run("run");
+
+ TiXmlElement seedElements("randomSeed");
+
+ vector<int> seeds = state.getSeeds();
+
+ int seedIndex = 1;
+
+ bool gotSeeds = false;
+
+ for(vector<int>::iterator seedIt = seeds.begin();
+ seedIt!=seeds.end(); ++seedIt){
+ TiXmlElement seed("seed");
+ seed.SetAttribute("index", seedIndex);
+ stringstream s;
+ s<<*seedIt;
+ TiXmlText val(s.str());
+ seed.InsertEndChild(val);
+ seedElements.InsertEndChild(seed);
+ ++seedIndex;
+ gotSeeds = true;
+ }
+
+ if(gotSeeds) run.InsertEndChild(seedElements);
+
+ TiXmlElement normalisation("normalisation");
+ TiXmlElement crossSection("crossSection");
+ crossSection.SetAttribute("unit", "pb^-1");
+ stringstream s;
+ s<<state.getCrossSection();
+ TiXmlText csText(s.str());
+ crossSection.InsertEndChild(csText);
+ normalisation.InsertEndChild(crossSection);
+ s.str("");
+ s<<state.getNEvents();
+ TiXmlElement nEvents("numberOfEvents");
+ TiXmlText nText(s.str());
+ nEvents.InsertEndChild(nText);
+ normalisation.InsertEndChild(nEvents);
+ TiXmlElement lumi("luminosity");
+ run.InsertEndChild(normalisation);
+
+ TiXmlElement genSettings("generatorSettings");
+
+ TiXmlElement gen("generator");
+ gen.SetAttribute("name",state.name());
+ gen.SetAttribute("version", state.version());
+ genSettings.InsertEndChild(gen);
+
+ for(vector<TiXmlElement>::iterator pdfIt = pdfElements.begin();
+ pdfIt!=pdfElements.end(); ++pdfIt){
+ genSettings.InsertEndChild(*pdfIt);
+ }
+
+ run.InsertEndChild(genSettings);
+ runseries.InsertEndChild(run);
+
+ docRoot->InsertEndChild(runseries);
+
+ os<<doc;
+ os<<endl;
+
+ return os;
+ }
+
+}
Index: tags/agile-1.2.0/src/IO
===================================================================
--- tags/agile-1.2.0/src/IO (revision 754)
+++ tags/agile-1.2.0/src/IO (revision 755)
Property changes on: tags/agile-1.2.0/src/IO
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,3 ##
+Makefile.in
+.deps
+Makefile
Index: tags/agile-1.2.0/src/Charybdis/CharybdisFHerwig.cc
===================================================================
--- tags/agile-1.2.0/src/Charybdis/CharybdisFHerwig.cc (revision 0)
+++ tags/agile-1.2.0/src/Charybdis/CharybdisFHerwig.cc (revision 755)
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+#include "AGILe/Charybdis/CharybdisFHerwig.hh"
+#include "AGILe/FHerwig/FHerwig.hh"
+#include "AGILe/FHerwig/FHerwigWrapper65.hh"
+#include "AGILe/Utils.hh"
+//#include "HepMC/HEPEVT_Wrapper.h"
+
+
+//-----------------------------------------------------------------------------
+// Implementation file for class : CharybdisFHerwig
+// This is the file-reading interface wrapper only. It contains an instance of
+// FHerwig which does most of the work. This class is only to provide access to
+// the parameter settings.
+//
+// Authors: Doug Gingrich
+// Andy Buckley
+//-----------------------------------------------------------------------------
+
+
+namespace AGILe {
+
+ // Standard constructor
+ CharybdisFHerwig::CharybdisFHerwig() {
+ // Set flag to read from LHA event file
+ FC_HWPROC.IPROC = -100;
+ // PDF defaults
+ FC_HEPRUP.PDFGUP[0] = -1;
+ FC_HEPRUP.PDFGUP[1] = -1;
+ FC_HEPRUP.PDFSUP[0] = -1;
+ FC_HEPRUP.PDFSUP[1] = -1;
+ }
+
+
+ // Set string parameters
+ bool CharybdisFHerwig::setParam(const string& name, const string& value) {
+ // Try Charybdis param handling first
+ bool ok = _charybdis.setParam(name, value);
+ if (ok) return SUCCESS;
+ // Fall back to Herwig param handling
+ ok = FHerwig::setParam(name, value);
+ if (ok) return SUCCESS;
+ // Fail
+ getLog() << Log::ERROR << "CharybdisFHerwig doesn't have a parameter called " << name << endl;
+ return FAILURE;
+ }
+
+
+}
+
+
+// Class factory
+extern "C" {
+ AGILe::Generator* create() { return new AGILe::CharybdisFHerwig(); }
+ void destroy(AGILe::Generator* gen) { delete gen; }
+}
Index: tags/agile-1.2.0/src/Charybdis/Makefile.am
===================================================================
--- tags/agile-1.2.0/src/Charybdis/Makefile.am (revision 0)
+++ tags/agile-1.2.0/src/Charybdis/Makefile.am (revision 755)
@@ -0,0 +1,23 @@
+lib_LTLIBRARIES = \
+ libAGILeCharybdis.la \
+ libAGILeCharybdisFPythia.la \
+ libAGILeCharybdisFHerwig.la \
+ libAGILeCharybdisFHerwigJimmy.la
+
+## General Charybdis support library
+libAGILeCharybdis_la_SOURCES = Charybdis.cc
+
+## CharybdisFHerwig
+libAGILeCharybdisFHerwig_la_SOURCES = CharybdisFHerwig.cc
+libAGILeCharybdisFHerwig_la_LDFLAGS = $(FORTRANLDFLAGS) $(DLOPENFLAGS) $(VERSIONFLAGS)
+libAGILeCharybdisFHerwig_la_LIBADD = $(FORTRANLIBADD) $(top_builddir)/src/FHerwig/libAGILeFHerwig.la
+
+## CharybdisFHerwigJimmy
+libAGILeCharybdisFHerwigJimmy_la_SOURCES = CharybdisFHerwigJimmy.cc
+libAGILeCharybdisFHerwigJimmy_la_LDFLAGS = $(FORTRANLDFLAGS) $(DLOPENFLAGS) $(VERSIONFLAGS)
+libAGILeCharybdisFHerwigJimmy_la_LIBADD = $(FORTRANLIBADD) $(top_builddir)/src/FHerwig/libAGILeFHerwigJimmy.la
+
+## CharybdisFPythia
+libAGILeCharybdisFPythia_la_SOURCES = CharybdisFPythia.cc
+libAGILeCharybdisFPythia_la_LDFLAGS = $(FORTRANLDFLAGS) $(DLOPENFLAGS) $(VERSIONFLAGS)
+libAGILeCharybdisFPythia_la_LIBADD = $(FORTRANLIBADD) $(top_builddir)/src/FPythia/libAGILeFPythia.la
Index: tags/agile-1.2.0/src/Charybdis/Charybdis.cc
===================================================================
--- tags/agile-1.2.0/src/Charybdis/Charybdis.cc (revision 0)
+++ tags/agile-1.2.0/src/Charybdis/Charybdis.cc (revision 755)
@@ -0,0 +1,95 @@
+// -*- C++ -*-
+#include "AGILe/Charybdis/CharybdisFHerwig.hh"
+#include "AGILe/Charybdis/CharybdisWrapper.hh"
+#include "AGILe/FHerwig/FHerwig.hh"
+#include "AGILe/FHerwig/FHerwigWrapper65.hh"
+#include "AGILe/Utils.hh"
+#include "HepMC/HEPEVT_Wrapper.h"
+
+
+//-----------------------------------------------------------------------------
+// Implementation file for Charybdis helper class.
+// This is a single location for handling of Charybdis parameters between
+// several "host" generators cf. the AlpGen class.
+//
+// Authors: Doug Gingrich
+// Andy Buckley
+//-----------------------------------------------------------------------------
+
+
+namespace AGILe {
+
+ // Set string parameters
+ bool CharybdisFHerwig::setParam(const string& name, const string& value) {
+ Generator::setParam(name, value);
+
+ // Set double-valued params
+ if (name == "MPLNCK") {
+ getLog() << Log::INFO << "Setting ... (MPLNCK) = " << value << endl;
+ FC_BHPARM.MPLNCK = asDouble(value);
+ } else if (name == "MINMSS") {
+ getLog() << Log::INFO << "Setting ... (MINMSS) = " << value << endl;
+ FC_BHPARM.MINMSS = asDouble(value);
+ } else if (name == "MAXMSS") {
+ getLog() << Log::INFO << "Setting ... (MAXMSS) = " << value << endl;
+ FC_BHPARM.MAXMSS = asDouble(value);
+ } else if (name == "THWMAX") {
+ getLog() << Log::INFO << "Setting ... (THWMAX) = " << value << endl;
+ FC_BH1003.THWMAX = asDouble(value);
+ } else if (name == "RMMINM") {
+ getLog() << Log::INFO << "Setting ... (RMMINM) = " << value << endl;
+ FC_BH1003.RMMINM = asDouble(value);
+
+ // Set int-valued params
+ } else if (name == "PDFGUP") {
+ getLog() << Log::INFO << "Setting Charybdis PDFGUP = " << value << endl;
+ FC_HEPRUP.PDFGUP[0] = asInt(value);
+ FC_HEPRUP.PDFGUP[1] = asInt(value);
+ } else if (name == "PDFSUP") {
+ getLog() << Log::INFO << "Setting Charybdis = " << value << endl;
+ FC_HEPRUP.PDFSUP[0] = asInt(value);
+ FC_HEPRUP.PDFSUP[1] = asInt(value);
+ } else if (name == "MSSDEF") {
+ getLog() << Log::INFO << "Setting ... (MSSDEF) = " << value << endl;
+ FC_BHPARM.MSSDEF = asInt(value);
+ } else if (name == "NBODY") {
+ getLog() << Log::INFO << "Setting ... (NBODY) = " << value << endl;
+ FC_BHPARM.NBODY = asInt(value);
+ } else if (name == "IBHPRN") {
+ getLog() << Log::INFO << "Setting ... (IBHPRN) = " << value << endl;
+ FC_BHPARM.IBHPRN = asInt(value);
+ } else if (name == "MSSDEC") {
+ getLog() << Log::INFO << "Setting ... (MSSDEC) = " << value << endl;
+ FC_BHPARM.MSSDEC = asInt(value);
+ } else if (name == "TOTDIM") {
+ getLog() << Log::INFO << "Setting ... (TOTDIM) = " << value << endl;
+ FC_BLACKH.TOTDIM = asInt(value);
+
+ // Set bool-valued params
+ } else if (name == "TIMVAR") {
+ getLog() << Log::INFO << "Setting ... (TIMVAR) = " << value << endl;
+ FC_BHPARM.TIMVAR = asInt(value);
+ } else if (name == "GTSCA") {
+ getLog() << Log::INFO << "Setting ... (GTSCA) = " << value << endl;
+ FC_BHPARM.GTSCA = asInt(value);
+ } else if (name == "GRYBDY") {
+ getLog() << Log::INFO << "Setting ... (GRYBDY) = " << value << endl;
+ FC_BHPARM.GRYBDY = asInt(value);
+ } else if (name == "KINCUT") {
+ getLog() << Log::INFO << "Setting ... (KINCUT) = " << value << endl;
+ FC_BHPARM.KINCUT = asInt(value);
+ } else if (name == "YRCSEC") {
+ getLog() << Log::INFO << "Setting ... (YRCSEC) = " << value << endl;
+ FC_BH1003.YRCSEC = asInt(value);
+ } else if (name == "RMBOIL") {
+ getLog() << Log::INFO << "Setting ... (RMBOIL) = " << value << endl;
+ FC_BH1003.RMBOIL = asInt(value);
+ } else {
+ //getLog() << Log::ERROR << "Charybdis doesn't have a parameter called " << name << endl;
+ return FAILURE;
+ }
+ return SUCCESS;
+ }
+
+
+}
Index: tags/agile-1.2.0/src/Charybdis/CharybdisFHerwigJimmy.cc
===================================================================
--- tags/agile-1.2.0/src/Charybdis/CharybdisFHerwigJimmy.cc (revision 0)
+++ tags/agile-1.2.0/src/Charybdis/CharybdisFHerwigJimmy.cc (revision 755)
@@ -0,0 +1,55 @@
+// -*- C++ -*-
+#include "AGILe/Charybdis/CharybdisFHerwigJimmy.hh"
+#include "AGILe/FHerwig/FHerwigJimmy.hh"
+#include "AGILe/FHerwig/FHerwigWrapper65.hh"
+#include "AGILe/Utils.hh"
+//#include "HepMC/HEPEVT_Wrapper.h"
+
+//-----------------------------------------------------------------------------
+// Implementation file for class : CharybdisFHerwigJimmy
+//
+// This is the file-reading interface wrapper only. It uses the FHerwigJimmy and
+// Charybdis classes to do most of the work. This class is only to provide
+// access to the parameter settings.
+//
+// Authors: Doug Gingrich
+// Andy Buckley
+//-----------------------------------------------------------------------------
+
+namespace AGILe {
+
+
+ // Standard constructor
+ CharybdisFHerwigJimmy::CharybdisFHerwigJimmy() {
+ // Set flag to read from LHA event file
+ FC_HWPROC.IPROC = -100;
+ // PDF defaults
+ FC_HEPRUP.PDFGUP[0] = -1;
+ FC_HEPRUP.PDFGUP[1] = -1;
+ FC_HEPRUP.PDFSUP[0] = -1;
+ FC_HEPRUP.PDFSUP[1] = -1;
+ }
+
+
+ // Set string parameters
+ bool CharybdisFHerwigJimmy::setParam(const string& name, const string& value) {
+ // Try Charybdis param handling first
+ bool ok = _charybdis.setParam(name, value);
+ if (ok) return SUCCESS;
+ // Fall back to Herwig+Jimmy param handling
+ ok = FHerwigJimmy::setParam(name, value);
+ if (ok) return SUCCESS;
+ // Fail
+ getLog() << Log::ERROR << "CharybdisFHerwigJimmy doesn't have a parameter called " << name << endl;
+ return FAILURE;
+ }
+
+
+}
+
+
+// Class factory
+extern "C" {
+ AGILe::Generator* create() { return new AGILe::CharybdisFHerwigJimmy(); }
+ void destroy(AGILe::Generator* gen) { delete gen; }
+}
Index: tags/agile-1.2.0/src/Charybdis/CharybdisFPythia.cc
===================================================================
--- tags/agile-1.2.0/src/Charybdis/CharybdisFPythia.cc (revision 0)
+++ tags/agile-1.2.0/src/Charybdis/CharybdisFPythia.cc (revision 755)
@@ -0,0 +1,56 @@
+// -*- C++ -*-
+#include "AGILe/Charybdis/CharybdisFPythia.hh"
+#include "AGILe/FPythia/FPythia.hh"
+#include "AGILe/FPythia/FPythiaWrapper62.hh"
+#include "AGILe/Utils.hh"
+
+//-----------------------------------------------------------------------------
+// Implementation file for class : CharybdisFPythia
+// This is the file-reading interface only. It needs to be used in conjunction
+// with FPythia. This class is only to provide access to the parameter
+// settings.
+//
+// Authors: Doug Gingrich
+// Andy Buckley
+//-----------------------------------------------------------------------------
+
+
+namespace AGILe {
+
+
+ // Constructor
+ CharybdisFPythia::CharybdisFPythia() {
+ FC_HEPRUP.IDBMUP[0] = 2212;
+ FC_HEPRUP.IDBMUP[1] = 2212;
+ FC_HEPRUP.EBMUP[0] = 7000.0;
+ FC_HEPRUP.EBMUP[1] = 7000.0;
+ FC_HEPRUP.PDFGUP[0] = -1;
+ FC_HEPRUP.PDFGUP[1] = -1;
+ FC_HEPRUP.PDFSUP[0] = -1;
+ FC_HEPRUP.PDFSUP[1] = -1;
+ FC_PYPARS.mstp[142] = 1;
+ }
+
+
+ // Set parameters
+ bool CharybdisFPythia::setParam(const string& name, const string& value) {
+ // Try Charybdis param handling first
+ bool ok = _charybdis.setParam(name, value);
+ if (ok) return SUCCESS;
+ // Fall back to Herwig param handling
+ ok = FPythia::setParam(name, value);
+ if (ok) return SUCCESS;
+ // Fail
+ getLog() << Log::ERROR << "CharybdisFPythia doesn't have a parameter called " << name << endl;
+ return FAILURE;
+ }
+
+
+}
+
+
+// Class factory
+extern "C" {
+ AGILe::Generator* create() { return new AGILe::CharybdisFPythia(); }
+ void destroy(AGILe::Generator* gen) { delete gen; }
+}
Index: tags/agile-1.2.0/src/Charybdis
===================================================================
--- tags/agile-1.2.0/src/Charybdis (revision 754)
+++ tags/agile-1.2.0/src/Charybdis (revision 755)
Property changes on: tags/agile-1.2.0/src/Charybdis
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,4 ##
+.deps
+.libs
+Makefile.in
+Makefile
Index: tags/agile-1.2.0/src/Core/Run.cc
===================================================================
--- tags/agile-1.2.0/src/Core/Run.cc (revision 0)
+++ tags/agile-1.2.0/src/Core/Run.cc (revision 755)
@@ -0,0 +1,159 @@
+#include "AGILe/Run.hh"
+
+using namespace std;
+
+namespace AGILe {
+
+
+ Run::Run(Generator& gen)
+ : _gen(&gen), _filter(false)//, _ostr(0), _io(0)
+ {
+ //
+ }
+
+
+ // Make a generator run with a particular gen and I/O target
+ Run::Run(Generator& gen, const string& evtfile)
+ : _gen(&gen), _filter(false)
+ {
+ if (evtfile.size() > 0) {
+ if (evtfile == "-") {
+ _io.reset(new HepMC::IO_GenEvent(std::cout));
+ } else {
+ // Ignore the HepMC::IO_GenEvent(filename, ios) constructor, since only available from HepMC >= 2.4
+ _ostr.reset(new std::fstream(evtfile.c_str(), std::ios::out));
+ _io.reset(new HepMC::IO_GenEvent(*_ostr));
+ }
+ }
+ }
+
+
+ // Destructor
+ Run::~Run() { }
+
+
+ // Set filtering flag
+ void Run::doFilter(bool filt) {
+ _filter = filt;
+ }
+
+
+
+ void filterEvent(HepMC::GenEvent* ge) {
+ // We treat beam particles a bit specially
+ const std::pair<HepMC::GenParticle*, HepMC::GenParticle*> beams = ge->beam_particles();
+
+ // Make list of non-physical particle entries
+ std::vector<HepMC::GenParticle*> unphys_particles;
+ for (HepMC::GenEvent::particle_const_iterator pi = ge->particles_begin();
+ pi != ge->particles_end(); ++pi) {
+ // Beam particles might not have status = 4, but we want them anyway
+ if (beams.first == *pi || beams.second == *pi) continue;
+ // Filter by status
+ const int status = (*pi)->status();
+ if (status != 1 && status != 2 && status != 4) {
+ unphys_particles.push_back(*pi);
+ }
+ }
+
+ // Remove each unphysical particle from the list
+ while (unphys_particles.size()) {
+ HepMC::GenParticle* gp = unphys_particles.back();
+
+ // Get start and end vertices
+ HepMC::GenVertex* vstart = gp->production_vertex();
+ HepMC::GenVertex* vend = gp->end_vertex();
+
+ if (vend == vstart) {
+ // Deal with loops
+ vstart->remove_particle(gp);
+ } else {
+
+ // Connect decay particles from end vertex to start vertex
+ /// @todo Have to build a list, since the GV::add_particle_out method modifies the end vertex!
+ if (vend && vend->particles_out_size()) {
+ std::vector<HepMC::GenParticle*> end_particles;
+ for (HepMC::GenVertex::particles_out_const_iterator gpe = vend->particles_out_const_begin();
+ gpe != vend->particles_out_const_end(); ++gpe) {
+ end_particles.push_back(*gpe);
+ }
+ // Reset production vertices of child particles to bypass unphysical particle
+ for (std::vector<HepMC::GenParticle*>::const_iterator gpe = end_particles.begin();
+ gpe != end_particles.end(); ++gpe) {
+ //std::cout << vstart << ", " << vend << std::endl;
+ if (vstart) vstart->add_particle_out(*gpe);
+ }
+ } else {
+ // If null end_vertex... stable unphysical particle?
+ }
+
+ // Delete unphysical particle and its orphaned end vertex
+ delete vend;
+ if (vstart) {
+ delete vstart->remove_particle(gp);
+ }// else {
+ /// @todo Why does this cause an error?
+ // delete gp;
+ //}
+ }
+
+ // Remove deleted particle from list
+ unphys_particles.pop_back();
+ //std::cout << unphys_particles.size() << std::endl;
+ }
+
+ // Delete any orphaned vertices
+ std::vector<HepMC::GenVertex*> orphaned_vtxs;
+ for (HepMC::GenEvent::vertex_const_iterator vi = ge->vertices_begin();
+ vi != ge->vertices_end(); ++vi) {
+ if ((*vi)->particles_in_size() == 0 && (*vi)->particles_out_size() == 0) {
+ orphaned_vtxs.push_back(*vi);
+ }
+ }
+ while (orphaned_vtxs.size()) {
+ delete orphaned_vtxs.back();
+ orphaned_vtxs.pop_back();
+ }
+ }
+
+
+
+ // Generate an event and send it to the writer if it exists
+ bool Run::makeEvent() {
+ // Make and fill event
+ _gen->makeEvent(_evt);
+
+ // Filter unphysical bits of event (reduces storage/transport size, and ensures physicality)
+ if (_filter) {
+ filterEvent(&_evt);
+ }
+
+ // Do I/O streaming if required
+ if (_io) {
+ _io->write_event(&_evt);
+ if (_io->rdstate() != 0) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+
+ // Return an event summary string
+ string Run::eventSummary() const {
+ std::ostringstream ss;
+ int Nfs = 0;
+ for (HepMC::GenEvent::particle_const_iterator pi = _evt.particles_begin();
+ pi != _evt.particles_end(); ++pi) {
+ if ((*pi)->status() == 1) Nfs += 1;
+ }
+ ss << "HepMC::GenEvent { "
+ << _evt.particles_size() << " particles "
+ << "(" << Nfs << " in FS), "
+ << _evt.vertices_size() << " vertices }";
+ return ss.str();
+ }
+
+
+}
Index: tags/agile-1.2.0/src/Core/Makefile.am
===================================================================
--- tags/agile-1.2.0/src/Core/Makefile.am (revision 0)
+++ tags/agile-1.2.0/src/Core/Makefile.am (revision 755)
@@ -0,0 +1,3 @@
+noinst_LTLIBRARIES = libAGILeCore.la
+libAGILeCore_la_SOURCES = Loader.cc Run.cc
+libAGILeCore_la_LDFLAGS = $(DLOPENFLAGS) $(VERSIONFLAGS)
Index: tags/agile-1.2.0/src/Core/Loader.cc
===================================================================
--- tags/agile-1.2.0/src/Core/Loader.cc (revision 0)
+++ tags/agile-1.2.0/src/Core/Loader.cc (revision 755)
@@ -0,0 +1,483 @@
+#include "AGILe/AGILe.hh"
+#include "AGILe/Generator.hh"
+#include "AGILe/Tools/AGILePaths.hh"
+#include <dlfcn.h>
+#include <unistd.h>
+
+namespace AGILe {
+
+
+ namespace Loader {
+
+
+ Log& getLog() {
+ return AGILe::Log::getLog("AGILe.Loader");
+ }
+
+
+ // Struct for holding library names and versions
+ struct GenLibInfo {
+ GenLibInfo(string libname, string pkgname="", string pkgversion="") {
+ this->libname = libname;
+ this->pkgname = pkgname;
+ this->pkgversion = pkgversion;
+ }
+ string libname, pkgname, pkgversion;
+ };
+
+
+ // Static library handles
+ vector<void*> handles;
+ void* agilehandle = 0;
+
+ // Libraries required for each known generator.
+ typedef map<string, vector<GenLibInfo> > GenLibs;
+
+ // Generator version is kept globally for use by the
+ // Generator::setVersion(...) function.
+ string version;
+
+
+ // Initialise the dynamic loader
+ void initialize() {
+ // Nothing to do with raw dlopen
+ }
+
+
+
+ // Make the proper system library name
+ string sysLibName(string libname) {
+ // Put lib suffix on the end if needed
+ if (libname.find(SYSDSO) == string::npos) libname += SYSDSO;
+ return libname;
+ }
+
+
+
+ vector<string> getPlatforms(const GenLibInfo& info) {
+ vector<string> platforms;
+ if (!info.pkgname.empty()) {
+ // If we're not trying to load an AGILe interface...
+ platforms += getLCGPlatformTag();
+ }
+ // Also try with no platform tag
+ platforms += "";
+
+ return platforms;
+ }
+
+
+
+ vector<string> getLibSearchDirs(const GenLibInfo& info) {
+ vector<string> dirs;
+ if (info.pkgname.empty()) {
+ // If we're trying to load an AGILe interface...
+
+ /// @todo Is this needed? Can't dlopen do this automatically for non-gen libs?
+
+ // Use the AGILe library install path
+ dirs.push_back(getLibPath());
+
+ // Use the current dir, too.
+ dirs.push_back(".");
+
+ // and some default system locations
+ dirs += "/usr/lib", "/usr/lib64", "/usr/lib32";
+ dirs += "/usr/local/lib", "/usr/local/lib64", "/usr/local/lib32";
+
+ // And then the user's (non-system) library path
+ const char* envld = getenv("LD_LIBRARY_PATH");
+ if (envld) dirs += split(envld);
+
+ } else {
+ // If we're loading a real generator library...
+ dirs += getGenPaths();
+ }
+
+ return dirs;
+ }
+
+
+
+ string findGenLib(const GenLibInfo& info,
+ const vector<string> searchdirs,
+ const vector<string> platforms)
+ {
+ // Get platform-specific filename
+ string libname = sysLibName(info.libname);
+
+ // Try to find lib file here
+ foreach (const string& d, searchdirs) {
+ foreach (const string& p, platforms) {
+ vector<string> versionsuffixes;
+ versionsuffixes += ".3", ".2", "";
+ foreach (string& vsuffix, versionsuffixes) {
+ string libpath = d + "/" + info.pkgname;
+ if (!info.pkgversion.empty()) {
+ libpath += "/" + info.pkgversion + vsuffix;
+ }
+ if (!p.empty()) {
+ libpath += "/" + p;
+ }
+ if (!info.pkgname.empty()) {
+ libpath += "/lib";
+ }
+ libpath += "/" + libname;
+ // Remove duplicate slashes from path
+ while (libpath.find("//") != string::npos) {
+ libpath.replace(libpath.find("//"), 2, "/");
+ }
+ // Return path if present
+ getLog() << Log::TRACE << "Testing for " << libpath << endl;
+ if (access(libpath.c_str(), R_OK) == 0) {
+ getLog() << Log::TRACE << "Found " << libpath << endl;
+ return libpath;
+ }
+ }
+ }
+ }
+ // Fall back to non-Genser structure
+ foreach (const string& d, searchdirs) {
+ const string libdir = d + "/lib";
+ vector<string> libnames;
+ libnames += libname,(info.libname+info.pkgversion+SYSDSO);
+ foreach (string& ln, libnames) {
+ string libpath = libdir + "/" + ln;
+ // Remove duplicate slashes from path
+ while (libpath.find("//") != string::npos) {
+ libpath.replace(libpath.find("//"), 2, "/");
+ }
+ // Return path if present
+ getLog() << Log::TRACE << "Testing for " << libpath << endl;
+ if (access(libpath.c_str(), R_OK) == 0) {
+ getLog() << Log::TRACE << "Found " << libpath << endl;
+ return libpath;
+ }
+ }
+ }
+ return "";
+ }
+
+
+
+ string findGenLib(const GenLibInfo& info) {
+ // Build up lists of search directories and platforms
+ vector<string> platforms = getPlatforms(info);
+ vector<string> dirs = getLibSearchDirs(info);
+
+ return findGenLib(info, dirs, platforms);
+ }
+
+
+
+ void* loadGenLib(const string& libpath, int dlmode=(RTLD_LAZY|RTLD_GLOBAL)) {
+ getLog() << Log::TRACE << "Trying to load " << libpath << endl;
+ void* lib = dlopen(libpath.c_str(), dlmode);
+ if (lib) {
+ getLog() << Log::TRACE << "Successfully loaded " << libpath << " (" << lib << ")" << endl;
+ // If this is an AGILe interface, set the global handle
+ if (libpath.find("libAGILe") != string::npos) {
+ getLog() << Log::TRACE << "Setting AGILe module handle for " << libpath
+ << " (" << lib << ")" << endl;
+ agilehandle = lib;
+ }
+ } else {
+ getLog() << Log::TRACE << "Failed to load " << libpath << endl;
+ }
+ return lib;
+ }
+
+
+ void* loadGenLib(const GenLibInfo& info, int dlmode=(RTLD_LAZY|RTLD_GLOBAL)) {
+ const string libpath = findGenLib(info);
+ if (libpath != "") {
+ return loadGenLib(libpath, dlmode);
+ }
+ return 0;
+ }
+
+
+ GenLibs _getAllGenLibInfo() {
+ vector<string> lhapdf_versions, hw6_versions, py6_versions, alpgen_versions, rapgap_versions, cascade_versions;
+ lhapdf_versions += "HEAD","5.8.3","5.8.2","5.8.1","5.8.0","5.7.0","5.6.0","5.5.1","5.5.0",
+ "5.4.1","5.4.0","5.3.1","5.3.0";
+ hw6_versions += "HEAD","6.510";
+ py6_versions += "HEAD","206","326","403","404","406","408","411","412",
+ "413","414","415","416","417","418","419","419.ac","420","421","422","423";
+ alpgen_versions += "2.1.3d";
+ rapgap_versions += "32";
+ cascade_versions += "2.0.1";
+
+ GenLibs gens;
+
+ // Is LHAPDF available?
+ bool haveLHAPDF = false;
+ GenLibInfo lhapdfLibInfo("DUMMY");
+ foreach (const string& v, lhapdf_versions) {
+ lhapdfLibInfo = GenLibInfo("libLHAPDF", "lhapdf", v);
+ haveLHAPDF = ! findGenLib(lhapdfLibInfo).empty();
+ if (haveLHAPDF) break;
+ }
+ // Try to fall back to non-Genser packaging
+ if (!haveLHAPDF) {
+ lhapdfLibInfo = GenLibInfo("libLHAPDF");
+ haveLHAPDF = ! findGenLib(lhapdfLibInfo).empty();
+ }
+ // Announce the result
+ if (haveLHAPDF) {
+ Log::getLog("AGILe.Loader") << Log::DEBUG << "LHAPDF is available" << endl;
+ } else {
+ Log::getLog("AGILe.Loader") << Log::WARN << "LHAPDF is not available" << endl;
+ }
+
+
+ // Fortran Herwig + variants
+ foreach (const string& v, hw6_versions) {
+ vector<GenLibInfo> baselibs, reqlibs;
+ baselibs += GenLibInfo("libherwig", "herwig", v);
+ if (haveLHAPDF) {
+ baselibs += lhapdfLibInfo;
+ } else {
+ baselibs += GenLibInfo("libherwig_pdfdummy", "herwig", v);
+ }
+ baselibs += GenLibInfo("libHepMCfio");
+ baselibs += GenLibInfo("libAGILeFHerwig");
+ const GenLibInfo libinfo_herwigdummy("libherwig_dummy", "herwig", v);
+ const GenLibInfo libinfo_jimmy("libjimmy", "jimmy", "4.31");
+ const GenLibInfo libinfo_charybher("libcharybdis-h", "charybdis", "1.003hp");
+ ////
+ // Standard Herwig
+ reqlibs = baselibs;
+ reqlibs += libinfo_herwigdummy;
+ gens["Herwig:" + v] = reqlibs;
+ //
+ // Herwig+Jimmy
+ reqlibs = baselibs;
+ reqlibs += libinfo_herwigdummy;
+ reqlibs += libinfo_jimmy;
+ reqlibs += GenLibInfo("libAGILeFHerwigJimmy");
+ gens["HerwigJimmy:" + v] = reqlibs;
+ //
+ // Herwig(+Jimmy)+AlpGen
+ foreach (const string& alpgen_version, alpgen_versions) {
+ // Herwig+AlpGen
+ reqlibs = baselibs;
+ reqlibs += GenLibInfo("libalpgen", "alpgen", alpgen_version);
+ reqlibs += GenLibInfo("libalpsho", "alpgen", alpgen_version);
+ reqlibs += GenLibInfo("libatoher", "alpgen", alpgen_version);
+ reqlibs += GenLibInfo("libAGILeAlpGen");
+ reqlibs += GenLibInfo("libAGILeAlpGenFHerwig");
+ gens["AlpGenHerwig:" + v + ":" + alpgen_version] = reqlibs;
+ // Herwig+Jimmy+AlpGen
+ reqlibs = baselibs;
+ reqlibs += GenLibInfo("libalpgen", "alpgen", alpgen_version);
+ reqlibs += GenLibInfo("libalpsho", "alpgen", alpgen_version);
+ reqlibs += GenLibInfo("libatoher", "alpgen", alpgen_version);
+ reqlibs += libinfo_jimmy;
+ reqlibs += GenLibInfo("libAGILeAlpGen");
+ reqlibs += GenLibInfo("libAGILeFHerwigJimmy");
+ reqlibs += GenLibInfo("libAGILeAlpGenFHerwigJimmy");
+ gens["AlpGenHerwigJimmy:" + v + ":" + alpgen_version] = reqlibs;
+ }
+ //
+ // Herwig+Charybdis
+ reqlibs = baselibs;
+ reqlibs += libinfo_charybher;
+ reqlibs += GenLibInfo("libAGILeCharybdis");
+ reqlibs += GenLibInfo("libAGILeCharybdisFHerwig");
+ gens["CharybdisHerwig:" + v] = reqlibs;
+ //
+ // Herwig+Jimmy+Charybdis
+ reqlibs = baselibs;
+ reqlibs += libinfo_charybher;
+ reqlibs += libinfo_jimmy;
+ reqlibs += GenLibInfo("libAGILeCharybdis");
+ reqlibs += GenLibInfo("libAGILeFHerwigJimmy");
+ reqlibs += GenLibInfo("libAGILeCharybdisFHerwigJimmy");
+ gens["CharybdisHerwigJimmy:" + v] = reqlibs;
+ }
+
+
+ // Fortran Pythia + variants
+ foreach (const string& v, py6_versions) {
+ vector<GenLibInfo> baselibs, reqlibs;
+ baselibs += GenLibInfo("libpythia6", "pythia6", v);
+ if (haveLHAPDF) {
+ baselibs += lhapdfLibInfo;
+ } else {
+ baselibs += GenLibInfo("libpythia6_pdfdummy", "pythia6", v);
+ }
+ baselibs += GenLibInfo("libHepMCfio");
+ //
+ // Standard Pythia
+ reqlibs = baselibs;
+ reqlibs += GenLibInfo("libAGILeFPythia_pyevwt");
+ reqlibs += GenLibInfo("libpythia6_dummy", "pythia6", v);
+ reqlibs += GenLibInfo("libAGILeFPythia");
+ gens["Pythia6:" + v] = reqlibs;
+ //
+ // Pythia+AlpGen
+ foreach (const string& alpgen_version, alpgen_versions) {
+ reqlibs = baselibs;
+ reqlibs += GenLibInfo("libalpgen", "alpgen", alpgen_version);
+ reqlibs += GenLibInfo("libalpsho", "alpgen", alpgen_version);
+ reqlibs += GenLibInfo("libatopyt", "alpgen", alpgen_version);
+ reqlibs += GenLibInfo("libpythia6_dummy", "pythia6", v);
+ reqlibs += GenLibInfo("libAGILeAlpGen");
+ reqlibs += GenLibInfo("libAGILeAlpGenFPythia");
+ gens["AlpGenPythia6:" + v + ":" + alpgen_version] = reqlibs;
+ }
+ //
+ // Pythia+Charybdis
+ reqlibs = baselibs;
+ reqlibs += GenLibInfo("libcharybdis", "charybdis", "1.003hp");
+ reqlibs += GenLibInfo("libpythia6_dummy", "pythia6", v);
+ reqlibs += GenLibInfo("libAGILeCharybdis");
+ reqlibs += GenLibInfo("libAGILeCharybdisFPythia");
+ gens["CharybdisPythia6:" + v] = reqlibs;
+ //
+ // Pythia+Rapgap
+ foreach (const string& vr, rapgap_versions) {
+ reqlibs.clear();
+ reqlibs += GenLibInfo("libpythia6", "pythia6", v);
+ //reqlibs += GenLibInfo("libpythia6_dummies", "pythia6", v);
+ reqlibs += GenLibInfo("librapgap", "Rapgap", vr);
+ reqlibs += GenLibInfo("libHepMCfio"); // This order is important
+ if (haveLHAPDF) {
+ reqlibs += lhapdfLibInfo;
+ } else {
+ reqlibs += GenLibInfo("libpythia6_pdfdummy", "pythia6", v);
+ }
+ reqlibs += GenLibInfo("libAGILeRapgap");
+ gens["RapgapPythia6:" + v + ":" + vr] = reqlibs;
+ }
+ // Pythia+Cascade
+ foreach (const string& vc, cascade_versions) {
+ vector<GenLibInfo> baselibs, reqlibs;
+ baselibs.push_back(GenLibInfo("libpythia6", "pythia6", v));
+ baselibs.push_back(GenLibInfo("libcascade2", "cascade", vc));
+ baselibs.push_back(GenLibInfo("libHepMCfio")); // This order is important
+ if (haveLHAPDF) {
+ reqlibs += lhapdfLibInfo;
+ } else {
+ reqlibs += GenLibInfo("libpythia6_pdfdummy", "pythia6", v);
+ }
+
+ reqlibs = baselibs;
+ reqlibs.push_back(GenLibInfo("libAGILeCascade"));
+ gens["CascadePythia6:" + v + ":" + vc] = reqlibs;
+ }
+ }
+
+ return gens;
+ }
+
+
+ // Find which generators are present by testing the files.
+ vector<string> getAvailableGens() {
+ GenLibs genlibs = _getAllGenLibInfo();
+ vector<string> availableGens;
+ for (GenLibs::const_iterator g = genlibs.begin(); g != genlibs.end(); ++g) {
+ getLog() << Log::TRACE << "Trying to find libs for " << g->first << endl;
+ // All listed libraries must be available for each generator to be considered useable.
+ bool ok = true;
+ for (vector<GenLibInfo>::const_iterator l = g->second.begin(); l != g->second.end(); ++l) {
+ const string libpath = findGenLib(*l);
+ if (libpath != "") {
+ getLog() << Log::TRACE << "Found " << l->libname << " at " << libpath << endl;
+ } else {
+ getLog() << Log::TRACE << "Didn't find "
+ << l->pkgname << ":" << l->pkgversion << ":" << l->libname << endl;
+ ok = false;
+ break;
+ }
+ }
+ // If all libs were present, add this gen to the "available" list.
+ if (ok) {
+ getLog() << Log::TRACE << "Found all libs for " << g->first << endl;
+ availableGens.push_back(g->first);
+ }
+ }
+ return availableGens;
+ }
+
+
+ void loadGenLibs(const string& genname) {
+ const string fioName = "libHepMCfio";
+ string agileName = "";
+ string pdflibName = "";
+
+ // Get version string from colon separated version string if given.
+ string name = genname;
+ version = "";
+ const size_t colonpos = genname.rfind(":");
+ if (colonpos != string::npos) {
+ const size_t versionlength = genname.length() - colonpos - 1;
+ name = genname.substr(0, colonpos);
+ version = genname.substr(colonpos+1, versionlength);
+ }
+
+ GenLibs genlibs = _getAllGenLibInfo();
+ if (genlibs.find(genname) == genlibs.end()) {
+ throw runtime_error("Trying to load an unknown generator combination: " + genname);
+ } else {
+ const vector<GenLibInfo> libs = genlibs[genname];
+ for (vector<GenLibInfo>::const_iterator l = libs.begin(); l != libs.end(); ++l) {
+ handles.push_back(loadGenLib(*l));
+ }
+ }
+
+
+ // Check and reset dlopen errors
+ for (vector<void*>::const_iterator h = handles.begin(); h != handles.end(); ++h) {
+ if (*h == 0) {
+ throw runtime_error((string("Failed to load libraries: ") + dlerror()).c_str());
+ }
+ }
+ dlerror();
+ }
+
+
+ template <typename Fn>
+ inline Fn evil_cast(void* ptr) {
+ return reinterpret_cast<Fn>(reinterpret_cast<size_t>(ptr));
+ }
+
+
+ Generator* createGen() {
+ // Load the factory and create an instance of the class
+ void* makeGen = dlsym(agilehandle, "create");
+ if (char* err = dlerror()) {
+ throw runtime_error((string("Can't load creation factory: ") + err).c_str());
+ }
+
+ // Make the generator object.
+ Generator* gen = evil_cast<Creator>(makeGen)();
+
+ // Set the generator version for e.g. HepML dumps of generator state.
+ gen->setVersion(version);
+
+ return gen;
+ }
+
+
+ void destroyGen(Generator* gen) {
+ //Destroyer* destroy_gen = (Destroyer*) dlsym(agilemod, "destroy");
+ //if (dlerror()) {
+ // throw runtime_error("Can't load destruction factory");
+ //}
+ //destroy_gen(gen);
+ delete gen;
+ }
+
+
+ // Close the libraries
+ void finalize() {
+ for (vector<void*>::reverse_iterator h = handles.rbegin(); h != handles.rend(); ++h) {
+ if (*h != 0) dlclose(*h);
+ }
+ }
+
+
+ }
+}
Index: tags/agile-1.2.0/src/Core
===================================================================
--- tags/agile-1.2.0/src/Core (revision 754)
+++ tags/agile-1.2.0/src/Core (revision 755)
Property changes on: tags/agile-1.2.0/src/Core
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,3 ##
+Makefile.in
+.deps
+Makefile
Index: tags/agile-1.2.0/src/Makefile.am
===================================================================
--- tags/agile-1.2.0/src/Makefile.am (revision 0)
+++ tags/agile-1.2.0/src/Makefile.am (revision 755)
@@ -0,0 +1,12 @@
+SUBDIRS = Core Tools IO
+SUBDIRS += FPythia FHerwig AlpGen Charybdis Rapgap Cascade
+SUBDIRS += .
+
+## Top-level AGILe library
+lib_LTLIBRARIES = libAGILe.la
+libAGILe_la_SOURCES =
+libAGILe_la_LIBADD = \
+ Core/libAGILeCore.la \
+ Tools/libAGILeTools.la \
+ IO/libAGILeIO.la \
+ -L$(HEPMCLIBPATH) -l$(HEPMCLIBNAME)
Index: tags/agile-1.2.0/src/Rapgap/Makefile.am
===================================================================
--- tags/agile-1.2.0/src/Rapgap/Makefile.am (revision 0)
+++ tags/agile-1.2.0/src/Rapgap/Makefile.am (revision 755)
@@ -0,0 +1,7 @@
+lib_LTLIBRARIES = \
+ libAGILeRapgap.la
+
+## General Rapgap support library
+libAGILeRapgap_la_SOURCES = Rapgap.cc RapgapWrapper.cc# initpydata.f
+#libAGILeRapgap_la_LDFLAGS = $(FORTRANLDFLAGS) $(DLOPENFLAGS) $(VERSIONFLAGS)
+#libAGILeRapgap_la_LIBADD = $(FORTRANLIBADD)
Index: tags/agile-1.2.0/src/Rapgap/Rapgap.cc
===================================================================
--- tags/agile-1.2.0/src/Rapgap/Rapgap.cc (revision 0)
+++ tags/agile-1.2.0/src/Rapgap/Rapgap.cc (revision 755)
@@ -0,0 +1,231 @@
+// -*- C++ -*-
+#include "AGILe/Rapgap/Rapgap.hh"
+#include "AGILe/Rapgap/RapgapWrapper32.hh"
+//#include "AGILe/FPythia/FPythia.hh"
+#include "AGILe/FPythia/FPythiaWrapper.hh"
+#include "AGILe/Utils.hh"
+#include "AGILe/HepMCTools.hh"
+
+#include "HepMC/HEPEVT_Wrapper.h"
+
+
+//-----------------------------------------------------------------------------
+// Implementation file for Rapgap helper class.
+//
+// Authors: Doug Gingrich
+// Andy Buckley
+// Holger Schulz
+//-----------------------------------------------------------------------------
+
+
+namespace AGILe {
+
+
+ // Standard constructor
+ Rapgap::Rapgap() {
+ HepMC::HEPEVT_Wrapper::set_sizeof_real(8);
+
+ _particleNames[ELECTRON] = "e-";
+ _particleNames[POSITRON] = "e+";
+ _particleNames[PROTON] = "p+";
+ _particleNames[ANTIPROTON] = "pbar-";
+ _particleNames[NEUTRON] = "n0";
+ _particleNames[ANTINEUTRON] = "nbar0";
+ _particleNames[PHOTON] = "gamma";
+ _particleNames[MUON] = "mu-";
+ _particleNames[ANTIMUON] = "mu+";
+ // TAU, ANTITAU
+ _particleNames[NU_E] = "nu_e";
+ _particleNames[NU_EBAR] = "nu_ebar";
+ _particleNames[NU_MU] = "nu_mu";
+ _particleNames[NU_MUBAR] = "nu_mubar";
+ _particleNames[NU_TAU] = "nu_tau";
+ _particleNames[NU_TAUBAR] = "nu_taubar";
+ _particleNames[PIPLUS] = "pi+";
+ _particleNames[PIMINUS] = "pi-";
+
+ // Start counting events at 1.
+ _nevt = 1;
+ }
+
+ /// Set up default params etc.
+ void Rapgap::initialize() {
+ Generator::initialize();
+ //Rapgap::setParam("LEPI", "2212");
+ //Rapgap::setParam("HADI", "2212");
+ //int ISEED = 213123;
+ //int N1 = 0;
+ //int N2 = 0;
+ //call_rm48in(ISEED, N1, N2);
+ //call_rapgap();
+ // Initialise Rapgap parameters
+ getLog() << Log::INFO << "Now calling GRAINI..." << endl;
+ call_graini();
+ getLog() << Log::INFO << "GRAINI is done..." << endl;
+
+ // Switch on QCD processes by default
+ getLog() << Log::INFO << "Setup basic processes..." << endl;
+ //Rapgap::setParam("IPRO", 18);
+ //Rapgap::setParam("IDIR", 0); // Don't do DIS but diffractive stuff by default
+ //Rapgap::setParam("INTER", 2); // Switch to charged current interaction
+ ////Rapgap::setParam("IDIR", 0); // Don't do DIS but diffractive stuff by default
+ ////Rapgap::setParam("NFLAV", 1); // Set number of flaovurs used in structure functions
+ ////Rapgap::setParam("NFLQCDC", 1); // Set number of flaovurs used in structure functions
+
+ getLog() << Log::INFO << "Now calling Steer..." << endl;
+ call_steer();
+ //getLog() << Log::INFO << "Steer is done..." << endl;
+
+ getLog() << Log::INFO << "Change standard RAPGAP parameters..." << endl;
+ call_rapcha();
+ //getLog() << Log::INFO << "Change standard HERACLES parameters..." << endl;
+ call_hercha();
+ //getLog() << Log::INFO << "Change standard PYTHIA parameters..." << endl;
+ call_pytcha();
+
+ //getLog() << Log::INFO << "Change standard ARIADNE parameters..." << endl;
+ //call_aricha();
+ //getLog() << Log::INFO << "Init ARIADNE..." << endl;
+ //const char* NAME = "RAPGAP";
+ //call_arinit(NAME);
+
+ getLog() << Log::INFO << "Calling PTIME..." << endl;
+ const char* name = "rapgap";
+ int j = 1;
+ int k = 0;
+ call_ptime(name, j, k);
+
+ getLog() << Log::INFO << "Now perfroming basic cross-section integration..." << endl;
+ call_rapgap();
+ getLog() << Log::INFO << "RAPGAP is done..." << endl;
+ call_raend(1);
+ _initialized = true;
+ }
+
+ void Rapgap::setGenSpecificInitialState(PdgCode p1, double e1, PdgCode p2, double e2) {
+ getLog() << Log::INFO << "Setting initial state..." << endl;
+ // For Pythia, we have to hold on to this state until initialize() is called.
+ //_particleName1 = _particleNames[p1];
+ //_particleName2 = _particleNames[p2];
+ /// @todo Get momenta and energies unconfused.
+ //Rapgap::setParam("KBE1", _particleNames[ParticleName(p1)]);
+ //Rapgap::setParam("KBE2", _particleNames[ParticleName(p2)]);
+ Rapgap::setParam("KBE1", p1);
+ Rapgap::setParam("KBE2", p2);
+ Rapgap::setParam("PBE1", e1);
+ Rapgap::setParam("PBE2", e2);
+ //Rapgap::setParam("PLEP", e1);
+ //Rapgap::setParam("PPIN", e2);
+ //Rapgap::setParam("LEPI", p1);
+ //Rapgap::setParam("HADI", p2);
+ }
+
+ // Run the generator for one event
+ void Rapgap::makeEvent(HepMC::GenEvent& evt) {
+ Generator::makeEvent(evt);
+ call_event();
+ call_pyhepc(1);
+ // fill the event using HepMC
+ Rapgap::fillEvent(evt);
+ evt.set_event_number(_nevt);
+ // Increment an event counter (Pythia does not count for itself).
+ _nevt++;
+ }
+
+ // Fill a HepMC event
+ void Rapgap::fillEvent(HepMC::GenEvent& evt) {
+ _hepevt.fill_next_event(&evt);
+ fixHepMCUnitsFromGeVmm(evt);
+ #ifdef HEPMC_HAS_CROSS_SECTION
+ const double xsecval = getCrossSection();
+ const double xsecerr = FC_EFFIC.SD;
+ getLog() << Log::DEBUG << "Writing cross-section = " << xsecval << " +- " << xsecerr << endl;
+ HepMC::GenCrossSection xsec;
+ xsec.set_cross_section(xsecval, xsecerr);
+ evt.set_cross_section(xsec);
+ #endif
+ }
+
+ const double Rapgap::getCrossSection(){
+ _crossSection = FC_EFFIC.AVGI * 1000.0;
+ return _crossSection;
+ }
+
+ // Set string parameters
+ bool Rapgap::setParam(const string& name, const string& value) {
+ Generator::setParam(name, value);
+
+ //// Set double-valued params
+ if (name == "PPIN") {
+ getLog() << Log::INFO << "Setting ... (PPIN) = " << value << endl;
+ FC_INPU.PIN = -1*asDouble(value);
+ } else if (name == "PLEP") {
+ getLog() << Log::INFO << "Setting ... (PLEP) = " << value << endl;
+ FC_INPU.PLEPIN = asDouble(value);
+ }
+ else if (name == "PBE1") {
+ getLog() << Log::INFO << "Setting ... (PBE1) = " << value << endl;
+ //FC_BEAM.PBEAM[0] = -1*asDouble(value);
+ FC_BEAM.PBE1 = -1*asDouble(value);
+ }
+ else if (name == "PBE2") {
+ getLog() << Log::INFO << "Setting ... (PBE2) = " << value << endl;
+ FC_BEAM.PBEAM[1] = asDouble(value);
+ }
+ else if (name == "PT2CUT") {
+ getLog() << Log::INFO << "Setting ... (PT2CUT) = " << value << endl;
+ FC_PTCUT.PT2CUT[1] = asDouble(value);
+ }
+
+ //// Set int-valued params
+ else if (name == "KBE1") {
+ getLog() << Log::INFO << "Setting ... (KBE1) = " << value << endl;
+ FC_BEAM.KBEAM[0] = -1*asInt(value);
+ }
+ else if (name == "KBE2") {
+ getLog() << Log::INFO << "Setting ... (KBE2) = " << value << endl;
+ FC_BEAM.KBEAM[1] = asInt(value);
+ }
+ else if (name == "HADI") {
+ getLog() << Log::INFO << "Setting ... (HADI) = " << value << endl;
+ FC_INPU.HADI = asInt(value);
+ } else if (name == "LEPI") {
+ getLog() << Log::INFO << "Setting ... (LEPI) = " << value << endl;
+ FC_INPU.LEPI = asInt(value);
+ } else if (name == "IPRO") {
+ getLog() << Log::INFO << "Setting ... (IPRO) = " << value << endl;
+ FC_RAPA.IPRO = asInt(value);
+ } else if (name == "IDIR") {
+ getLog() << Log::INFO << "Setting ... (IDIR) = " << value << endl;
+ FC_DISDIF.IDIR = asInt(value);
+ } else if (name == "NFLAV") {
+ getLog() << Log::INFO << "Setting ... (NFLAV) = " << value << endl;
+ FC_LUCO.NFLAV = asInt(value);
+ } else if (name == "NFLQCDC") {
+ getLog() << Log::INFO << "Setting ... (NFLQCDC) = " << value << endl;
+ FC_LUCO.NFLQCDC = asInt(value);
+ } else if (name == "INTER") {
+ getLog() << Log::INFO << "Setting ... (INTER) = " << value << endl;
+ FC_INPU.INTER = asInt(value);
+ }
+
+ else {
+ getLog() << Log::ERROR << "Rapgap doesn't have a parameter called " << name << endl;
+ //return FAILURE;
+ }
+ return SUCCESS;
+ }
+
+ // Tidy up after ourselves
+ void Rapgap::finalize() {
+ getLog() << Log::INFO << "Finalising..." << endl;
+ // Print out stats from run
+ call_raend(20);
+ }
+
+}
+
+extern "C" {
+ AGILe::Generator* create() { return new AGILe::Rapgap(); }
+ void destroy(AGILe::Generator* gen) { delete gen; }
+}
Index: tags/agile-1.2.0/src/Rapgap/RapgapWrapper.cc
===================================================================
--- tags/agile-1.2.0/src/Rapgap/RapgapWrapper.cc (revision 0)
+++ tags/agile-1.2.0/src/Rapgap/RapgapWrapper.cc (revision 755)
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+
+#include "AGILe/Rapgap/RapgapWrapper.hh"
+#include <cstring>
+
+// Define methods to hide the subtle syntax necessary to call fortran from C++
+
+void call_graini() {
+ graini_();
+}
+
+void call_ptime(const char *name, int j, int k) {
+ ptime_(name, &j, &k);
+}
+
+void call_steer() {
+ steer_();
+}
+
+void call_rapgap() {
+ rapgap_();
+}
+
+void call_rapcha() {
+ rapcha_();
+}
+
+void call_hercha() {
+ hercha_();
+}
+
+void call_pytcha() {
+ pytcha_();
+}
+
+void call_aricha() {
+ aricha_();
+}
+
+void call_arinit(const char *name) {
+ arinit_(name);
+}
+
+void call_raend(int i) {
+ raend_(&i);
+}
+
+void call_event() {
+ event_();
+}
+
+// Pythia routines
+void call_pyhepc( int mode ){
+ pyhepc_( &mode );
+}
+//void call_rm48in(int ISEED, int N1, int N2) {
+ //rm48in(&ISEED, &N1, &N2);
+//}
Index: tags/agile-1.2.0/src/Rapgap
===================================================================
--- tags/agile-1.2.0/src/Rapgap (revision 754)
+++ tags/agile-1.2.0/src/Rapgap (revision 755)
Property changes on: tags/agile-1.2.0/src/Rapgap
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,3 ##
+Makefile.in
+.deps
+Makefile
Index: tags/agile-1.2.0/src/FHerwig/FHerwigDummyRoutines.f
===================================================================
--- tags/agile-1.2.0/src/FHerwig/FHerwigDummyRoutines.f (revision 0)
+++ tags/agile-1.2.0/src/FHerwig/FHerwigDummyRoutines.f (revision 755)
@@ -0,0 +1,9 @@
+ SUBROUTINE HWAEND
+ RETURN
+ END
+
+ SUBROUTINE TIMEL(TRES)
+ REAL TRES
+ TRES=1E10
+ RETURN
+ END
Index: tags/agile-1.2.0/src/FHerwig/FHerwigJimmy.cc
===================================================================
--- tags/agile-1.2.0/src/FHerwig/FHerwigJimmy.cc (revision 0)
+++ tags/agile-1.2.0/src/FHerwig/FHerwigJimmy.cc (revision 755)
@@ -0,0 +1,149 @@
+// -*- C++ -*-
+#include "AGILe/FHerwig/FHerwigJimmy.hh"
+#include "AGILe/FHerwig/FHerwig.hh"
+#include "AGILe/FHerwig/FHerwigWrapper65.hh"
+#include "AGILe/FHerwig/JimmyWrapper.hh"
+#include "AGILe/Utils.hh"
+
+
+namespace AGILe {
+
+ // Standard constructor
+ FHerwigJimmy::FHerwigJimmy() {
+ // NB. FHerwig constructor gets automatically called first.
+ FC_JMPARM.JMBUG = 0;
+ // Initialise Jimmy common blocks.
+ FC_JIMMIN();
+ }
+
+
+ // Run generator initialization
+ void FHerwigJimmy::initialize() {
+ FHerwig::initialize();
+
+ // Initialise Jimmy.
+ if (FC_JMPARM.MSFLAG == 1) {
+ FC_JMINIT();
+ }
+
+ _initialized = true;
+ }
+
+
+ // Set parameters.
+ bool FHerwigJimmy::setParam(const string& name, const string& value) {
+ Generator::setParam(name, value);
+
+ // Integers.
+ if (name == "JMUEO") {
+ getLog() << Log::INFO << "Setting JMUEO = " << asInt(value) << endl;
+ FC_JMPARM.JMUEO = asInt(value);
+ } else if (name == "JMBUG") {
+ getLog() << Log::INFO << "Setting JMBUG = " << asInt(value) << endl;
+ FC_JMPARM.JMBUG = asInt(value);
+ } else if (name == "MSFLAG") {
+ getLog() << Log::INFO << "Setting MSFLAG = " << asInt(value) << endl;
+ FC_JMPARM.MSFLAG = asInt(value);
+ }
+
+ // Doubles.
+ else if (name == "PTJIM") {
+ getLog() << Log::INFO << "Setting minimum PT for secondary scatters (PTJIM) = " << asDouble(value) << endl;
+ FC_JMPARM.PTJIM = asDouble(value);
+ } else if (name == "PHAD") {
+ getLog() << Log::INFO << "Setting hadronic photon inverse probability (PHAD) = " << asDouble(value) << endl;
+ FC_JMPARM.PHAD = asDouble(value);
+ } else if (name == "PRRAD") {
+ getLog() << Log::INFO << "Setting 1/(Proton radius)2 (PRRAD) = " << asDouble(value) << endl;
+ FC_JMPARM.JMRAD[72] = asDouble(value);
+ FC_JMPARM.JMRAD[74] = asDouble(value);
+ FC_JMPARM.JMRAD[90] = asDouble(value);
+ FC_JMPARM.JMRAD[92] = asDouble(value);
+ } else if (name == "PHRAD") {
+ getLog() << Log::INFO << "Setting 1/(Photon radius)2 (PRRAD) = " << asDouble(value) << endl;
+ FC_JMPARM.JMRAD[58] = asDouble(value);
+ FC_JMPARM.JMRAD[120] = asDouble(value);
+ FC_JMPARM.JMRAD[126] = asDouble(value);
+ }
+
+ // Boolean (as int).
+ else if (name == "ANOMOFF") {
+ getLog() << Log::INFO << "Setting MI in anomalous photon events (ANOMOFF) = " << asInt(value) << endl;
+ FC_JMPARM.ANOMOFF = asInt(value);
+ }
+
+ // Fall back to FHerwig.
+ else if (FHerwig::setParam(name, value) != SUCCESS) {
+ getLog() << Log::ERROR << "HerwigJimmy doesn't have a parameter called " << name << endl;
+ return FAILURE;
+ }
+ return SUCCESS;
+ }
+
+
+ // Run the generator for one event
+ /// @todo Make sub-process execution conditional.
+ void FHerwigJimmy::makeEvent(HepMC::GenEvent& evt) {
+ while (true) {
+ Generator::makeEvent(evt);
+ int counter(0);
+ // Repeat the first stages of event generation until multiple
+ // scattering succeeds (or isn't run at all).
+ while (true) {
+ counter += 1;
+
+ FC_HWUINE(); // Initialize event
+ FC_HWEPRO(); // Generate hard subprocess
+ FC_HWBGEN(); // Generate parton cascade
+
+ // Call the multiple scattering routine with the abort flag.
+ // If abort is returned with value 1 (true), then abandon the
+ // event. This implementation makes sure that the event generation
+ // continues if multiple scattering is disabled (MSFLAG != 1)
+ int abort(0);
+ if (FC_JMPARM.MSFLAG == 1) FC_HWMSCT(&abort);
+ // If MS is okay or disabled, escape the loop and
+ // continue with the decays and hadronisation.
+ if (abort == 0) {
+ getLog() << Log::DEBUG << "Num attempts to make MPI = " << counter << endl;
+ break;
+ }
+
+ // Check for too many attempts to make MPI scatters
+ if (counter > 100) {
+ throw runtime_error("Too many attempts to make MPI in HerwigJimmy");
+ }
+ }
+ FC_HWDHOB(); // Do heavy quark decays
+ if(_doHadronise){
+ FC_HWCFOR(); // Do cluster formation
+ FC_HWCDEC(); // Do cluster decays
+ FC_HWDHAD(); // Do unstable particle decays
+ FC_HWDHVY(); // Do heavy flavor decays
+ }
+ FC_HWMEVT(); // Add soft underlying event
+ FC_HWUFNE(); // Finish event
+ if (FC_HWEVNT.IERROR == 0) break;
+ }
+ clearEvent(evt);
+ fillEvent(evt);
+ }
+
+
+ /// Tidy up, print out run stats, etc.
+ void FHerwigJimmy::finalize() {
+ FHerwig::finalize();
+ if (FC_JMPARM.MSFLAG == 1) {
+ FC_JMEFIN();
+ }
+ }
+
+
+}
+
+
+// Class factory
+extern "C" {
+ AGILe::Generator* create() { return new AGILe::FHerwigJimmy(); }
+ void destroy(AGILe::Generator* gen) { delete gen; }
+}
Index: tags/agile-1.2.0/src/FHerwig/Makefile.am
===================================================================
--- tags/agile-1.2.0/src/FHerwig/Makefile.am (revision 0)
+++ tags/agile-1.2.0/src/FHerwig/Makefile.am (revision 755)
@@ -0,0 +1,11 @@
+lib_LTLIBRARIES = libAGILeFHerwig.la libAGILeFHerwigJimmy.la
+
+## FHerwig
+libAGILeFHerwig_la_SOURCES = FHerwig.cc FHerwigDummyRoutines.f
+libAGILeFHerwig_la_LDFLAGS = $(FORTRANLDFLAGS) $(DLOPENFLAGS) $(VERSIONFLAGS)
+libAGILeFHerwig_la_LIBADD = $(FORTRANLIBADD)
+
+## FHerwigJimmy
+libAGILeFHerwigJimmy_la_SOURCES = FHerwigJimmy.cc
+libAGILeFHerwigJimmy_la_LDFLAGS = $(FORTRANLDFLAGS) $(DLOPENFLAGS) $(VERSIONFLAGS)
+libAGILeFHerwigJimmy_la_LIBADD = $(FORTRANLIBADD) libAGILeFHerwig.la
Index: tags/agile-1.2.0/src/FHerwig/FHerwig.cc
===================================================================
--- tags/agile-1.2.0/src/FHerwig/FHerwig.cc (revision 0)
+++ tags/agile-1.2.0/src/FHerwig/FHerwig.cc (revision 755)
@@ -0,0 +1,597 @@
+// -*- C++ -*-
+#include "AGILe/FHerwig/FHerwig.hh"
+#include "AGILe/FHerwig/FHerwigWrapper65.hh"
+#include "AGILe/Utils.hh"
+#include "AGILe/HepMCTools.hh"
+
+
+namespace AGILe {
+
+ // Standard constructor
+ FHerwig::FHerwig() : _doHadronise(true), _unitWeight(true){
+ /// Herwig 6.5 uses HEPEVT with 4000/10000 entries and 8-byte floats
+ HepMC::HEPEVT_Wrapper::set_max_number_entries(FC_HWGETHEPEVTSIZE());
+ HepMC::HEPEVT_Wrapper::set_sizeof_real(8);
+
+ // Set up particle names map: note that they must be 8 characters long
+ _particleNames[ELECTRON] = "E- ";
+ _particleNames[POSITRON] = "E+ ";
+ _particleNames[PROTON] = "P ";
+ _particleNames[ANTIPROTON] = "PBAR ";
+ _particleNames[NEUTRON] = "N ";
+ _particleNames[ANTINEUTRON] = "NBAR ";
+ _particleNames[PHOTON] = "GAMMA ";
+ _particleNames[MUON] = "MU- ";
+ _particleNames[ANTIMUON] = "MU+ ";
+ // TAU, ANTITAU
+ _particleNames[NU_E] = "NU_E ";
+ _particleNames[NU_EBAR] = "NU_EBAR ";
+ _particleNames[NU_MU] = "NU_MU ";
+ _particleNames[NU_MUBAR] = "NU_MUBAR";
+ _particleNames[NU_TAU] = "NU_TAU ";
+ _particleNames[NU_TAUBAR] = "NU_TAUBR";
+ _particleNames[PIPLUS] = "PI+ ";
+ _particleNames[PIMINUS] = "PI- ";
+ // PIZERO
+ // PHOTOELECTRON, PHOTOPOSITRON,
+ // PHOTOMUON, PHOTOANTIMUON,
+ // PHOTOTAU, PHOTOANTITAU,
+
+ // Initialize and set default parameters (no echoing)
+ FC_HWIGIN(); // Print banner and initialise common blocks
+ FC_HWPROC.IPROC = 1500; // Use QCD 2->2 as the default process
+ FC_HWPROC.MAXEV = 10000000; // Maximum number of events (irrelevant!)
+ FC_HWEVNT.MAXER = 10000000; // Maximum number of allowed errors
+ FC_HWPRAM.PRNDEF = 0; // Enable/disable ASCII output
+ FC_HWEVNT.MAXPR = 0; // Number of events to print
+ FC_HWPRAM.IPRINT = 1; // Type of info to print
+
+ // Start counting events at 1.
+ _nevt = 1;
+ }
+
+
+ // Set up initial state from supplied params
+ void FHerwig::setGenSpecificInitialState(int p1, double e1, int p2, double e2) {
+ getLog() << Log::INFO << "Setting initial state..." << endl;
+ // Herwig's initial state particles specification must be 8 chars long
+ for ( unsigned int i = 0; i < 8; ++i ) {
+ FC_HWBMCH.PART1[i] = _particleNames[ParticleName(p1)].c_str()[i];
+ FC_HWBMCH.PART2[i] = _particleNames[ParticleName(p2)].c_str()[i];
+ }
+ // Set momenta / energies
+ setParam("PBEAM1", e1); /// @todo Get momenta and energies unconfused?
+ setParam("PBEAM2", e2); /// @todo Store a list of particle masses for this?
+ // NB. Beam ordering is significant (segfault if "wrong") for HERA initial state
+ }
+
+
+ // Run generator initialization
+ void FHerwig::initialize() {
+ Generator::initialize();
+ // Compute parameter-dependent constants
+ FC_HWUINC();
+ // Initialise elementary process
+ FC_HWEINI();
+ _initialized = true;
+ }
+
+
+ // Set random number seed
+ void FHerwig::setSeed(const int value) {
+ Generator::setSeed(value);
+ FC_HWEVNT.NRN[0] = value;
+ const int nextSeed = value + SEED_OFFSET;
+ FC_HWEVNT.NRN[1] = nextSeed;
+ Generator::setSeed(nextSeed);
+ }
+
+
+ // Set parameters.
+ bool FHerwig::setParam(const string& name, const string& value) {
+ Generator::setParam(name, value);
+
+ // Strings
+ //std::cout << "****" << name << "****" << std::endl;
+ if (name.find("AUTPDF") != string::npos) {
+ if (name == "AUTPDF(1)" || name == "AUTPDF") {
+ getLog() << Log::INFO << "Setting AUTPDF(1) = " << value << endl;
+ int nch = (value.size() < AUTPDF_LENGTH) ? value.size() : AUTPDF_LENGTH-1;
+ for(int i = 0; i < AUTPDF_LENGTH; i++) {
+ if(i < nch) {
+ FC_HWPRCH.AUTPDF[0][i] = value.data()[i];
+ } else {
+ FC_HWPRCH.AUTPDF[0][i] = ' ';
+ }
+ }
+ }
+ if (name == "AUTPDF(2)" || name == "AUTPDF") {
+ getLog() << Log::INFO << "Setting AUTPDF(2) = " << value << endl;
+ int nch = (value.size() < AUTPDF_LENGTH) ? value.size() : AUTPDF_LENGTH-1;
+ for(int i = 0; i < AUTPDF_LENGTH; i++) {
+ if(i < nch) {
+ FC_HWPRCH.AUTPDF[1][i] = value.data()[i];
+ } else {
+ FC_HWPRCH.AUTPDF[1][i] = ' ';
+ }
+ }
+ }
+ } else //...
+
+ // Integers
+ if (name == "IPROC") {
+ // 1610 = gg -> H -> WW; 1706 = qq -> ttbar; 2510 = ttH -> ttWW, ...
+ getLog() << Log::INFO << "Setting process code (IPROC) = " << asInt(value) << endl;
+ FC_HWPROC.IPROC = asInt(value);
+ //} else if (name == "MAXEV") {
+ //getLog() << Log::INFO << "Setting maximum number of events (MAXEV) = " << asInt(value) << endl;
+ //FC_HWPROC.MAXEV = asInt(value);
+ } else if (name == "MAXPR") {
+ getLog() << Log::INFO << "Setting max event printouts (MAXPR) = " << asInt(value) << endl;
+ FC_HWEVNT.MAXPR = asInt(value);
+ } else if (name == "IPRINT") {
+ getLog() << Log::INFO << "Setting printout info code (IPRINT) = " << asInt(value) << endl;
+ FC_HWPRAM.IPRINT = asInt(value);
+ } else if (name == "CLDIR1") {
+ getLog() << Log::INFO << "Setting smearing of perturbative quark pT in light cluster fission (CLDIR(1)) = " << asInt(value) << endl;
+ FC_HWPRAM.CLDIR[0] = asInt(value);
+ } else if (name == "CLDIR2") {
+ getLog() << Log::INFO << "Setting smearing of perturbative quark pT in b cluster fission (CLDIR(2)) = " << asInt(value) << endl;
+ FC_HWPRAM.CLDIR[1] = asInt(value);
+ } else if (name == "IOPREM") {
+ getLog() << Log::INFO << "Setting model for treatment of remnant clusters (IOPREM) = " << asInt(value) << endl;
+ FC_HWPRAM.IOPREM = asInt(value);
+ } else if (name == "ISPAC") {
+ getLog() << Log::INFO << "Setting ISR forced branching IR behaviour (ISPAC) = " << asInt(value) << endl;
+ FC_HWPRAM.ISPAC = asInt(value);
+ } else if (name == "NFLAV") {
+ getLog() << Log::INFO << "Setting number of flavours (NFLAV) = " << asInt(value) << endl;
+ FC_HWPRAM.NFLAV = asInt(value);
+ } else if (name == "NSTRU") {
+ getLog() << Log::INFO << "Setting internal PDF ID... are you sure? (NSTRU) = " << asInt(value) << endl;
+ FC_HWPRAM.NSTRU = asInt(value);
+ } else if (name == "MODPDF") {
+ getLog() << Log::INFO << "Setting PDFLIB IDs for both beams (MODPDF(1&2)) = " << asInt(value) << endl;
+ FC_HWPRAM.MODPDF[0] = asInt(value);
+ FC_HWPRAM.MODPDF[1] = asInt(value);
+ } else if (name == "MODPDF(1)") {
+ getLog() << Log::INFO << "Setting PDFLIB ID for beam 1 (MODPDF(1)) = " << asInt(value) << endl;
+ FC_HWPRAM.MODPDF[0] = asInt(value);
+ } else if (name == "MODPDF(2)") {
+ getLog() << Log::INFO << "Setting PDFLIB ID for beam 2 (MODPDF(2)) = " << asInt(value) << endl;
+ FC_HWPRAM.MODPDF[1] = asInt(value);
+ } else if (name == "IFLMAX") {
+ getLog() << Log::INFO << "Setting max quark flavour in photoproduction (IFLMAX) = " << asInt(value) << endl;
+ FC_HWHARD.IFLMAX = asInt(value);
+ } else if (name == "LRSUD") {
+ getLog() << Log::INFO << "Setting unit for reading Sudakov table (LRSUD) = " << asInt(value) << endl;
+ FC_HWPRAM.LRSUD = asInt(value);
+ } else if (name == "LWSUD") {
+ getLog() << Log::INFO << "Setting unit for writing Sudakov table (LWSUD) = " << asInt(value) << endl;
+ FC_HWPRAM.LWSUD = asInt(value);
+ // } else if (name == "MODBOS") {
+ // getLog() << Log::INFO << "Setting MODBOS = " << asInt(value) << endl;
+ // FC_HWBOSC.MODBOS[0] = asInt(value);
+ } //...
+
+ // Doubles
+ else if (name == "PBEAM1") {
+ getLog() << Log::INFO << "Setting beam 1 momentum (PBEAM1) = " << asDouble(value) << endl;
+ FC_HWPROC.PBEAM1 = asDouble(value);
+ } else if (name == "PBEAM2") {
+ getLog() << Log::INFO << "Setting beam 2 momentum (PBEAM2) = " << asDouble(value) << endl;
+ FC_HWPROC.PBEAM2 = asDouble(value);
+ } else if (name == "EBEAM1") {
+ getLog() << Log::INFO << "Setting beam 1 energy (EBEAM1) = " << asDouble(value) << endl;
+ FC_HWPROC.EBEAM1 = asDouble(value);
+ } else if (name == "EBEAM2") {
+ getLog() << Log::INFO << "Setting beam 2 energy (EBEAM2) = " << asDouble(value) << endl;
+ FC_HWPROC.EBEAM2 = asDouble(value);
+ } else if (name == "ALPHEM") {
+ getLog() << Log::INFO << "Setting alpha_EM (ALPHEM) = " << asDouble(value) << endl;
+ FC_HWPRAM.ALPHEM = asDouble(value);
+ } else if (name == "PTMIN") {
+ getLog() << Log::INFO << "Setting minimum hard pt (PTMIN) = " << asDouble(value) << endl;
+ FC_HWHARD.PTMIN = asDouble(value);
+ } else if (name == "PTMAX") {
+ getLog() << Log::INFO << "Setting maximum hard pt (PTMAX) = " << asDouble(value) << endl;
+ FC_HWHARD.PTMAX = asDouble(value);
+ } else if (name == "PTPOW") {
+ getLog() << Log::INFO << "Setting power for reweight (PTPOW) = " << asDouble(value) << endl;
+ FC_HWHARD.PTPOW = asDouble(value);
+ } else if (name == "Q2WWMN") {
+ getLog() << Log::INFO << "Setting minimum Q2 in equivalent photon approximation (Q2WWMN) = " << asDouble(value) << endl;
+ FC_HWHARD.Q2WWMN = asDouble(value);
+ } else if (name == "Q2WWMX") {
+ getLog() << Log::INFO << "Setting maximum Q2 in equivalent photon approximation (Q2WWMX) = " << asDouble(value) << endl;
+ FC_HWHARD.Q2WWMX = asDouble(value);
+ } else if (name == "YWWMIN") {
+ getLog() << Log::INFO << "Setting minimum photon light-cone fraction in equivalent photon approximation (YWWMIN) = " << asDouble(value) << endl;
+ FC_HWHARD.YWWMIN = asDouble(value);
+ } else if (name == "YWWMAX") {
+ getLog() << Log::INFO << "Setting maximum photon light-cone fraction in equivalent photon approximation (YWWMAX) = " << asDouble(value) << endl;
+ FC_HWHARD.YWWMAX = asDouble(value);
+ } else if ( name =="WHMIN") {
+ getLog() << Log::INFO << "Setting min hadronic mass in photon-induced (DIS) processes (WHMIN) = " << asDouble(value)<<endl;
+ FC_HWHARD.WHMIN = asDouble(value);
+ } else if ( name =="EMMIN") {
+ getLog() << Log::INFO << "Setting minimum DY boson mass (EMMIN) = "<< asDouble(value) << endl;
+ FC_HWHARD.EMMIN = asDouble(value);
+ } else if ( name =="EMMAX") {
+ getLog() << Log::INFO << "Setting maximum DY boson mass (EMMIN) = "<< asDouble(value) << endl;
+ FC_HWHARD.EMMAX = asDouble(value);
+ } else if ( name =="EMPOW") {
+ getLog() << Log::INFO << "Setting power for EM reweighting (EMPOW) = "<< asDouble(value) << endl;
+ FC_HWHARD.EMPOW = asDouble(value);
+ } else if ( name =="EMSCA") {
+ getLog() << Log::INFO << "Setting ??? for EM (EMSCA) = "<< asDouble(value) << endl;
+ FC_HWHARD.EMSCA = asDouble(value);
+ } else if (name == "PRECO") {
+ getLog() << Log::INFO << "Setting probability of cluster colour reassignment (PRECO) = " << asDouble(value) << endl;
+ FC_HWUCLU.PRECO = asDouble(value);
+ } else if (name == "PDFX0") {
+ getLog() << Log::INFO << "Setting maximum x for saturation effects (PDFX0) = " << asDouble(value) << endl;
+ FC_HW6506.PDFX0 = asDouble(value);
+ } else if (name == "PDFPOW") {
+ getLog() << Log::INFO << "Setting suppression of PDFs below x0 (PDFPOW) = " << asDouble(value) << endl;
+ FC_HW6506.PDFPOW = asDouble(value);
+ } else if (name == "BTCLM") {
+ getLog() << Log::INFO << "Setting remnant cluster mass param adjustment (BTCLM) = " << asDouble(value) << endl;
+ FC_HWPRAM.BTCLM = asDouble(value);
+ } else if (name == "CLMAX") {
+ getLog() << Log::INFO << "Setting cluster mass offset (CLMAX) = " << asDouble(value) << endl;
+ FC_HWPRAM.CLMAX = asDouble(value);
+ } else if (name == "CLPOW") {
+ getLog() << Log::INFO << "Setting exponent of cluster fission (CLPOW) = " << asDouble(value) << endl;
+ FC_HWPRAM.CLPOW = asDouble(value);
+ } else if (name == "CLSMR1") {
+ getLog() << Log::INFO << "Setting Gaussian quark pT smearing width for light clusters (CLSMR(1)) = " << asDouble(value) << endl;
+ FC_HWPRAM.CLSMR[0] = asDouble(value);
+ } else if (name == "CLSMR2") {
+ getLog() << Log::INFO << "Setting Gaussian quark pT smearing width for b clusters (CLSMR(2)) = " << asDouble(value) << endl;
+ FC_HWPRAM.CLSMR[1] = asDouble(value);
+ } else if (name == "PRSOF") {
+ getLog() << Log::INFO << "Setting probablility of soft scatters (PRSOF) = " << asDouble(value) << endl;
+ FC_HWPRAM.PRSOF = asDouble(value);
+ } else if (name == "PSPLT1") {
+ getLog() << Log::INFO << "Setting cluster mass spectrum exponent for light clusters (PSPLT(1)) = " << asDouble(value) << endl;
+ FC_HWPRAM.PSPLT[0] = asDouble(value);
+ } else if (name == "PSPLT2") {
+ getLog() << Log::INFO << "Setting cluster mass spectrum exponent for b clusters (PSPLT(2)) = " << asDouble(value) << endl;
+ FC_HWPRAM.PSPLT[1] = asDouble(value);
+ }
+ // Following params are useful for MPI/ISR tunes:
+ else if (name == "PTRMS") {
+ getLog() << Log::INFO << "Setting intrinsic kT (PTRMS) = " << asDouble(value) << endl;
+ FC_HWPRAM.PTRMS = asDouble(value);
+ } else if (name == "QCDLAM") {
+ getLog() << Log::INFO << "Setting Lambda_QCD for alpha_s running (QCDLAM) = " << asDouble(value) << endl;
+ FC_HWPRAM.QCDLAM = asDouble(value);
+ } else if (name == "QSPAC") {
+ getLog() << Log::INFO << "Setting Q cutoff for spacelike (ISR) shower (QSPAC) = " << asDouble(value) << endl;
+ FC_HWPRAM.QSPAC = asDouble(value);
+ } else if (name == "VGCUT") {
+ getLog() << Log::INFO << "Setting gluon virtuality cutoff in parton showers (VGCUT) = " << asDouble(value) << endl;
+ FC_HWPRAM.VGCUT = asDouble(value);
+ } else if (name == "VQCUT") {
+ getLog() << Log::INFO << "Setting quark virtuality cutoff in parton showers (VQCUT) = " << asDouble(value) << endl;
+ FC_HWPRAM.VQCUT = asDouble(value);
+ } else if (name == "ZMXISR") {
+ getLog() << Log::INFO << "Setting max. momentum fraction for photon ISR (ZMXISR) = " << asDouble(value) << endl;
+ FC_HWHARD.ZMXISR = asDouble(value);
+ }
+ // End MPI/ISR tune params
+ else if (name == "VPCUT") {
+ getLog() << Log::INFO << "Setting photon virtuality cutoff (VPCUT) = " << asDouble(value) << endl;
+ FC_HWPRAM.VPCUT = asDouble(value);
+ } else if (name == "OMEGA0") {
+ getLog() << Log::INFO << "Setting omega_0 param in Mueller-Tang pomeron for IPROC=2400 (OMEGA0) = " << asDouble(value) << endl;
+ FC_HWHARD.OMEGA0 = asDouble(value);
+ } else if (name == "ASFIXD") {
+ getLog() << Log::INFO << "Setting a_s param in Mueller-Tang pomeron for IPROC=2400 (ASFIXD) = " << asDouble(value) << endl;
+ FC_HWHARD.ASFIXD = asDouble(value);
+ } else if (name == "Q2MIN") {
+ getLog() << Log::INFO << "Setting minimum DIS Q2 (Q2MIN) = " << asDouble(value) << endl;
+ FC_HWHARD.Q2MIN = asDouble(value);
+ } else if (name == "Q2MAX") {
+ getLog() << Log::INFO << "Setting maximum DIS Q2 (Q2MAX) = " << asDouble(value) << endl;
+ FC_HWHARD.Q2MAX = asDouble(value);
+ } else if (name == "Q2POW") {
+ getLog() << Log::INFO << "Setting reweighting power in DIS Q2 (Q2POW) = " << asDouble(value) << endl;
+ FC_HWHARD.Q2POW = asDouble(value);
+ } else if (name == "Q2WWMN") {
+ getLog() << Log::INFO << "Setting Q2WWMN (Q2WWMN) = " << asDouble(value) << endl;
+ FC_HWHARD.Q2WWMN = asDouble(value);
+ } else if (name == "Q2WWMX") {
+ getLog() << Log::INFO << "Setting Q2WWMX (Q2WWMX) = " << asDouble(value) << endl;
+ FC_HWHARD.Q2WWMX = asDouble(value);
+ } else if (name == "QLIM") {
+ getLog() << Log::INFO << "Setting QLIM (QLIM) = " << asDouble(value) << endl;
+ FC_HWHARD.QLIM = asDouble(value);
+ } else if (name == "YBMIN") {
+ getLog() << Log::INFO << "Setting minimum Bjorken y=Q2/xs (YBMIN) = " << asDouble(value) << endl;
+ FC_HWHARD.YBMIN = asDouble(value);
+ } else if (name == "YBMAX") {
+ getLog() << Log::INFO << "Setting maximum Bjorken y=Q2/xs (YBMAX) = " << asDouble(value) << endl;
+ FC_HWHARD.YBMAX = asDouble(value);
+ } else if (name == "YJMIN") {
+ getLog() << Log::INFO << "Setting minimum ??? (YJMIN) = " << asDouble(value) << endl;
+ FC_HWHARD.YJMIN = asDouble(value);
+ } else if (name == "YJMAX") {
+ getLog() << Log::INFO << "Setting maximum ??? (YJMAX) = " << asDouble(value) << endl;
+ FC_HWHARD.YJMAX = asDouble(value);
+ } else if (name == "YWWMIN") {
+ getLog() << Log::INFO << "Setting minimum ??? (YWWMIN) = " << asDouble(value) << endl;
+ FC_HWHARD.YWWMIN = asDouble(value);
+ } else if (name == "YWWMAX") {
+ getLog() << Log::INFO << "Setting maximum ??? (YWWMAX) = " << asDouble(value) << endl;
+ FC_HWHARD.YWWMAX = asDouble(value);
+ } else if (name == "XX1") {
+ getLog() << Log::INFO << "Setting ??? (XX(1)) = " << asDouble(value) << endl;
+ FC_HWHARD.XX[0] = asDouble(value);
+ } else if (name == "XX2") {
+ getLog() << Log::INFO << "Setting ??? (XX(2)) = " << asDouble(value) << endl;
+ FC_HWHARD.XX[1] = asDouble(value);
+ } else if (name == "XLMIN") {
+ getLog() << Log::INFO << "Setting minimum ??? (XLMIN) = " << asDouble(value) << endl;
+ FC_HWHARD.XLMIN = asDouble(value);
+ } else if (name == "XXMIN") {
+ getLog() << Log::INFO << "Setting minimum ??? (XXMIN) = " << asDouble(value) << endl;
+ FC_HWHARD.XXMIN = asDouble(value);
+ } else if (name == "WHMIN") {
+ getLog() << Log::INFO << "Setting minimum ??? (WHMIN) = " << asDouble(value) << endl;
+ FC_HWHARD.WHMIN = asDouble(value);
+ } else if (name == "ZJMAX") {
+ getLog() << Log::INFO << "Setting maximum ??? (ZJMAX) = " << asDouble(value) << endl;
+ FC_HWHARD.ZJMAX = asDouble(value);
+ } else if (name == "TMNISR") {
+ getLog() << Log::INFO << "Setting minimum ??? (TMNISR) = " << asDouble(value) << endl;
+ FC_HWHARD.TMNISR = asDouble(value);
+ } else if (name == "ZMXISR") {
+ getLog() << Log::INFO << "Setting maximum ??? in ISR (ZMXISR) = " << asDouble(value) << endl;
+ FC_HWHARD.ZMXISR = asDouble(value);
+ } else if (name == "THMAX") {
+ getLog() << Log::INFO << "Setting maximum ??? (THMAX) = " << asDouble(value) << endl;
+ FC_HWHARD.THMAX = asDouble(value);
+ } else if (name == "Y4JT") {
+ getLog() << Log::INFO << "Setting ??? (Y4JT) = " << asDouble(value) << endl;
+ FC_HWHARD.Y4JT = asDouble(value);
+ } else if (name == "SINS") {
+ getLog() << Log::INFO << "Setting ??? (SINS) = " << asDouble(value) << endl;
+ FC_HWHARD.SINS = asDouble(value);
+
+
+ } else if (name == "PLTCUT") {
+ getLog() << Log::INFO << "Setting lifetime cut (PLTCUT) = " << asDouble(value) << endl;
+ FC_HWDIST.PLTCUT = asDouble(value);
+ } else if (name == "GAMW") {
+ getLog() << Log::INFO << "Setting W width (GAMW) = " << asDouble(value) << endl;
+ FC_HWPRAM.GAMW = asDouble(value);
+ } else if (name == "GAMZ") {
+ getLog() << Log::INFO << "Setting Z0 width (GAMZ) = " << asDouble(value) << endl;
+ FC_HWPRAM.GAMZ = asDouble(value);
+ } else if (name == "GAMZP") {
+ getLog() << Log::INFO << "Setting Z0/gamma width (GAMZP) = " << asDouble(value) << endl;
+ FC_HWPRAM.GAMZP = asDouble(value);
+ } else if (name == "H1MIX") {
+ /// @todo Add meaning of param (Higgs mixing angle?)
+ getLog() << Log::INFO << "Setting H1MIX (H1MIX) = " << asDouble(value) << endl;
+ FC_HWPRAM.H1MIX = asDouble(value);
+ } else if (name == "PHIMIX") {
+ /// @todo Add meaning of param (??? mixing angle?)
+ getLog() << Log::INFO << "Setting PHIMIX (PHIMIX) = " << asDouble(value) << endl;
+ FC_HWPRAM.PHIMIX = asDouble(value);
+ }
+ // NB. The -1 C-Fortran array offset does not apply for RMASS, which is declared as (0:NMXRES).
+ else if (name == "RMASS(1)") {
+ getLog() << Log::INFO << "Setting down mass (RMASS(1)) = " << asDouble(value) << endl;
+ FC_HWPROP.RMASS[1] = asDouble(value);
+ } else if (name == "RMASS(2)") {
+ getLog() << Log::INFO << "Setting up mass (RMASS(2)) = " << asDouble(value) << endl;
+ FC_HWPROP.RMASS[2] = asDouble(value);
+ } else if (name == "RMASS(3)") {
+ getLog() << Log::INFO << "Setting strange mass (RMASS(3)) = " << asDouble(value) << endl;
+ FC_HWPROP.RMASS[3] = asDouble(value);
+ } else if (name == "RMASS(4)") {
+ getLog() << Log::INFO << "Setting charm mass (RMASS(4)) = " << asDouble(value) << endl;
+ FC_HWPROP.RMASS[4] = asDouble(value);
+ } else if (name == "RMASS(5)") {
+ getLog() << Log::INFO << "Setting bottom mass (RMASS(5)) = " << asDouble(value) << endl;
+ FC_HWPROP.RMASS[5] = asDouble(value);
+ } else if (name == "RMASS(6)") {
+ getLog() << Log::INFO << "Setting top mass (RMASS(6)) = " << asDouble(value) << endl;
+ FC_HWPROP.RMASS[6] = asDouble(value);
+ } else if (name == "RMASS(198)") {
+ getLog() << Log::INFO << "Setting W+ mass (RMASS(198)) = " << asDouble(value) << endl;
+ FC_HWPROP.RMASS[198] = asDouble(value);
+ } else if (name == "RMASS(199)") {
+ getLog() << Log::INFO << "Setting W- mass (RMASS(199)) = " << asDouble(value) << endl;
+ FC_HWPROP.RMASS[199] = asDouble(value);
+ } else if (name == "RMASS(200)") {
+ getLog() << Log::INFO << "Setting Z0 mass (RMASS(200)) = " << asDouble(value) << endl;
+ FC_HWPROP.RMASS[200] = asDouble(value);
+ } //...
+
+ // Booleans (done as ints in Fortran)
+ else if (name == "GENSOF") {
+ getLog() << Log::INFO << "Setting ... (GENSOF) = " << asInt(value) << endl;
+ FC_HWEVNT.GENSOF = asInt(value);
+ } else if (name == "AZSOFT") {
+ getLog() << Log::INFO << "Setting use of soft gluon azimuthal corellations on/off (AZSOFT) = " << asInt(value) << endl;
+ FC_HWPRAM.AZSOFT = asInt(value);
+ } else if (name == "CLRECO") {
+ getLog() << Log::INFO << "Setting inclusion of colour rearrangement on/off (CLRECO) = " << asInt(value) << endl;
+ FC_HWUCLU.CLRECO = asInt(value);
+ } else if (name == "AZSPIN") {
+ getLog() << Log::INFO << "Setting use of gloun spin azimuthal correlations on/off (AZSPIN) = " << asInt(value) << endl;
+ FC_HWPRAM.AZSPIN = asInt(value);
+ } else if (name == "ZPRIME") {
+ getLog() << Log::INFO << "Setting Z' flag (ZPRIME) = " << asInt(value) << endl;
+ FC_HWPRAM.ZPRIME = asInt(value);
+ } else if (name == "HARDME") {
+ getLog() << Log::INFO << "Setting hard matrix element flag (HARDME) = " << asInt(value) << endl;
+ FC_HWPRAM.HARDME = asInt(value);
+ } else if (name == "SOFTME") {
+ getLog() << Log::INFO << "Setting soft matrix element flag (SOFTME) = " << asInt(value) << endl;
+ FC_HWPRAM.SOFTME = asInt(value);
+ } else if (name == "NOSPAC") {
+ getLog() << Log::INFO << "Setting spacelike showers on/off (NOSPAC) = " << asInt(value) << endl;
+ FC_HWPRAM.NOSPAC = asInt(value);
+ } else if (name == "PRVTX") {
+ getLog() << Log::INFO << "Setting inclusion of vertex info in event printout on/off (PRVTX) = " << asInt(value) << endl;
+ FC_HWPRAM.PRVTX = asInt(value);
+ } else if (name == "PRNDEC") {
+ getLog() << Log::INFO << "Setting use of decimal in event printout (PRNDEC) = " << asInt(value) << endl;
+ FC_HWPRAM.PRNDEC = asInt(value);
+ } else if (name == "PRNDEF") {
+ getLog() << Log::INFO << "Setting stdout printout on/off (PRNDEF) = " << asInt(value) << endl;
+ FC_HWPRAM.PRNDEF = asInt(value);
+ } else if (name == "PRNTEX") {
+ getLog() << Log::INFO << "Setting LaTeX output on/off (PRNTEX) = " << asInt(value) << endl;
+ FC_HWPRAM.PRNTEX = asInt(value);
+ } else if (name == "PRNWEB") {
+ getLog() << Log::INFO << "Setting HTML output on/off (PRNWEB) = " << asInt(value) << endl;
+ FC_HWPRAM.PRNWEB = asInt(value);
+ } else if (name == "MIXING") {
+ getLog() << Log::INFO << "Setting neutral B mixing on/off (MIXING) = " << asInt(value) << endl;
+ FC_HWDIST.MIXING = asInt(value);
+ } else if (name == "NOWGT") {
+ getLog() << Log::INFO << "Setting unweighted generation (NOWGT) = " << asInt(value) << endl;
+ FC_HWEVNT.NOWGT = asInt(value);
+ } else if (name == "DoHadronisation"){
+ getLog() << Log::INFO << "Do Hadronisation = "<<value<<endl;
+ _doHadronise = asBool(value);//...
+
+ }else if(name == "unitWeight"){
+ getLog() << Log::INFO << "Using a weight value of 1 in unweighted events = "<<value<<endl;
+ _unitWeight = asBool(value);
+ // Error
+ }else {
+ getLog() << Log::ERROR << "Herwig doesn't have a parameter called " << name << endl;
+ return FAILURE;
+ }
+ return SUCCESS;
+ }
+
+
+ // Run the generator for one event
+ void FHerwig::makeEvent(HepMC::GenEvent& evt) {
+ // Loop until event works
+ while (true) {
+ Generator::makeEvent(evt);
+ FC_HWUINE(); // Initialize event
+ FC_HWEPRO(); // Generate hard subprocess
+ FC_HWBGEN(); // Generate parton cascade
+ FC_HWDHOB(); // Do heavy quark decays
+ if(_doHadronise){
+ FC_HWCFOR(); // Do cluster formation
+ FC_HWCDEC(); // Do cluster decays
+ FC_HWDHAD(); // Do unstable particle decays
+ FC_HWDHVY(); // Do heavy flavor decays
+ }
+ FC_HWMEVT(); // Add soft underlying event
+ FC_HWUFNE(); // Finish event
+ if (FC_HWEVNT.IERROR == 0) break;
+ }
+ // Fill event from HEPEVT
+ fillEvent(evt);
+ // Increment an event counter (Pythia does not count for itself).
+ _nevt++;
+ }
+
+
+ /// Fill a HepMC event
+ void FHerwig::fillEvent(HepMC::GenEvent& evt) {
+ HepMC::IO_HERWIG hepevt;
+ hepevt.fill_next_event(&evt);
+ fixHepMCUnitsFromGeVmm(evt);
+ evt.set_event_number(_nevt);
+
+ //IO_HERWIG::fillEvent does not fill the weight
+
+ evt.weights().clear();
+ if(FC_HWEVNT.NOWGT == 0 || !_unitWeight){
+ evt.weights().push_back(FC_HWEVNT.EVWGT);
+ }else{
+ evt.weights().push_back(1.0);
+ }
+
+ #ifdef HEPMC_HAS_CROSS_SECTION
+ HepMC::GenCrossSection xsec;
+ const double xsecval = getCrossSection();
+ const double xsecerr = getCrossSection() / std::sqrt(_nevt);
+ getLog() << Log::DEBUG << "Writing cross-section = " << xsecval << " +- " << xsecerr << endl;
+ xsec.set_cross_section(xsecval, xsecerr);
+ evt.set_cross_section(xsec);
+ #endif
+ }
+
+
+ /// Return the beam number (0 or 1) of a particle.
+ /// Return -1 if not a beam particle
+ int FHerwig::beamNumber(PdgCode pid){
+ string pName = _particleNames[pid];
+ string beamName = "";
+ for (int i = 0; i < 8; ++i) {
+ beamName += FC_HWBMCH.PART1[i];
+ }
+ if (beamName.compare(pName) == 0) return 0;
+
+ for (int i = 0; i < 8; ++i) {
+ beamName += FC_HWBMCH.PART2[i];
+ }
+ if (beamName.compare(pName) == 0) return 1;
+ return -1;
+ }
+
+
+ string FHerwig::getPDFSet(PdgCode pid){
+ const int beamNum = beamNumber(pid);
+ if (beamNum < 0) {
+ throw runtime_error("PDFSet unknown for PDG code " + pid);
+ }
+ string autString = "";
+ for (int ii = 0; ii != AUTPDF_LENGTH; ++ii){
+ autString += FC_HWPRCH.AUTPDF[beamNum][ii];
+ }
+ return autString;
+ }
+
+
+ int FHerwig::getPDFMember(PdgCode pid){
+ const int beamNum = beamNumber(pid);
+ if (beamNum < 0) {
+ throw runtime_error("PDFMember unknown for PDG code "+ pid);
+ }
+ const int member = FC_HWPRAM.MODPDF[beamNum];
+ return member;
+ }
+
+
+ string FHerwig::getPDFScheme(PdgCode pid)const{
+ return "LHAPDF";
+ }
+
+
+ const double FHerwig::getCrossSection(){
+ // _crossSection = FC_HWEVNT.AVWGT * 1000.0;
+ _crossSection = 1000.0 * FC_HWEVNT.WGTSUM / ((float)FC_HWEVNT.NWGTS);
+ return _crossSection;
+ }
+
+
+ /// Tidy up, print out run stats, etc.
+ void FHerwig::finalize() {
+ getLog() << Log::INFO << "Finalising..." << endl;
+ FC_HWEFIN();
+ }
+
+
+}
+
+
+// Class factory
+extern "C" {
+ AGILe::Generator* create() { return new AGILe::FHerwig(); }
+ void destroy(AGILe::Generator* gen) { delete gen; }
+}
Index: tags/agile-1.2.0/src/FHerwig
===================================================================
--- tags/agile-1.2.0/src/FHerwig (revision 754)
+++ tags/agile-1.2.0/src/FHerwig (revision 755)
Property changes on: tags/agile-1.2.0/src/FHerwig
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,4 ##
+.deps
+.libs
+Makefile.in
+Makefile
Index: tags/agile-1.2.0/src
===================================================================
--- tags/agile-1.2.0/src (revision 754)
+++ tags/agile-1.2.0/src (revision 755)
Property changes on: tags/agile-1.2.0/src
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,6 ##
+.deps
+.libs
+Makefile.in
+Makefile
+rivetgun
+*.loT
Index: tags/agile-1.2.0/README
===================================================================
Index: tags/agile-1.2.0/configure.ac
===================================================================
--- tags/agile-1.2.0/configure.ac (revision 0)
+++ tags/agile-1.2.0/configure.ac (revision 755)
@@ -0,0 +1,227 @@
+## Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.59)
+AC_INIT([AGILe],[1.2.0],[rivet@projects.hepforge.org],[AGILe])
+AC_CONFIG_SRCDIR([src/Core/Loader.cc])
+AC_CONFIG_HEADER([include/AGILe/AGILeConfig.hh include/AGILe/FortranWrappers.hh])
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE(dist-bzip2)
+AC_CONFIG_MACRO_DIR([m4])
+
+## Library version flags (increment these for each new version)
+VERSIONFLAGS="-version-info 6:0:4" ## set for 1.2.0
+AC_SUBST(VERSIONFLAGS)
+
+## Cache PATH variable
+AC_ARG_VAR(PATH, [we grab the PATH variable, since various generator config scripts may need to be called repeatably])
+
+## Set default compiler flags
+if test "x$CXXFLAGS" == "x"; then CXXFLAGS="-O3"; fi
+
+## More comprehensible error messages if possible. See:
+## http://www.bdsoft.com/tools/stlfilt.html
+if test "x$CXXFLAGS" == "x"; then
+ AC_PATH_PROG(GFILT, gfilt, $CXX, $PATH:$HOME/bin:$HOME/local/bin)
+ CXX=$GFILT
+fi
+
+## Declare language
+AC_LANG(C++)
+
+## OS X
+AC_CEDAR_OSX
+
+## LCG platform tag
+AC_LCG_TAG
+
+## Checks for programs.
+AC_PROG_CXX
+AC_PROG_FC(gfortran g95 g77)
+AC_FC_LIBRARY_LDFLAGS
+AC_FC_WRAPPERS
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_DISABLE_STATIC
+
+## Hack to make libtool use the FC Fortran compiler via F77, since
+## libtool < 2.x doesn't understand --tag=FC
+F77=$FC
+AM_FFLAGS=$AM_FCFLAGS
+AC_SUBST(F77)
+AC_SUBST(AM_FFLAGS)
+
+AC_LIBTOOL_DLOPEN
+AC_PROG_LIBTOOL
+
+## Work out library suffix for the build
+LIB_SUFFIX=\\\"$shrext_cmds\\\"
+AC_SUBST([LIB_SUFFIX])
+
+## System libraries
+AC_CEDAR_HEADERS([Boost], , , [AC_MSG_ERROR([Boost is required])])
+oldCPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS -I$BOOSTINCPATH"
+BOOSTERRMSG="You need at least version 1.34.0 of Boost for this installation."
+BOOSTERRMSG="$BOOSTERRMSG If you want to use Boost from a non-standard location,"
+BOOSTERRMSG="$BOOSTERRMSG please specify '--with-boost-incpath=/path/to/boost_1_35/include'"
+BOOSTERRMSG="$BOOSTERRMSG as option to the configure script or run 'export"
+BOOSTERRMSG="$BOOSTERRMSG BOOSTFLAGS=--with-boost-incpath=/path/to/boost_1_35/include'"
+BOOSTERRMSG="$BOOSTERRMSG before you run the rivet-bootstrap script."
+AC_CHECK_HEADER([boost/foreach.hpp], [], [AC_MSG_ERROR([Boost foreach not found. $BOOSTERRMSG])])
+AC_CHECK_HEADER([boost/smart_ptr.hpp], [], [AC_MSG_ERROR([Boost smart_ptr not found. $BOOSTERRMSG])])
+AC_CHECK_HEADER([boost/lexical_cast.hpp], [], [AC_MSG_ERROR([Boost lexical_cast not found. $BOOSTERRMSG])])
+AC_CHECK_HEADER([boost/assign.hpp], [], [AC_MSG_ERROR([Boost assign not found. $BOOSTERRMSG])])
+CPPFLAGS=$oldCPPFLAGS
+
+## Testing HepMC
+AC_CEDAR_LIBRARYANDHEADERS([HepMC], , , [AC_MSG_ERROR([HepMC is required])])
+#AC_CEDAR_LIBRARY([HepMCfio], , , [AC_MSG_ERROR([HepMCfio is required])])
+
+## Standard build flags
+AM_CPPFLAGS="-I\$(top_srcdir)/include -I\$(top_builddir)/include "
+AM_CPPFLAGS="$AM_CPPFLAGS -I\$(BOOSTINCPATH) \$(BOOST_CPPFLAGS)"
+AM_CPPFLAGS="$AM_CPPFLAGS -I\$(HEPMCINCPATH) "
+AM_LDFLAGS="-L\$(top_builddir)/src/Tools -L\$(top_builddir)/src"
+AM_CXXFLAGS="$AM_CXXFLAGS -DLIB_SUFFIX=$LIB_SUFFIX "
+AC_CEDAR_CHECKCXXFLAG([-pedantic], [AM_CXXFLAGS="$AM_CXXFLAGS -pedantic "])
+AC_CEDAR_CHECKCXXFLAG([-ansi], [AM_CXXFLAGS="$AM_CXXFLAGS -ansi "])
+AC_CEDAR_CHECKCXXFLAG([-Wall], [AM_CXXFLAGS="$AM_CXXFLAGS -Wall "])
+
+## Debug flag (default=none)
+AC_ARG_ENABLE([debug], [AC_HELP_STRING(--enable-debug,
+ [build with debugging symbols @<:@default=no@:>@])], [], [enable_debug=no])
+if test x$enable_debug == xyes; then
+ AC_CEDAR_CHECKCXXFLAG([-g], [AM_CXXFLAGS="$AM_CXXFLAGS -g "])
+fi
+
+AC_SUBST(AM_CPPFLAGS)
+AC_SUBST(AM_LDFLAGS)
+AC_SUBST(AM_CXXFLAGS)
+
+## Fortran build flags
+FORTRANLDFLAGS="-L$HEPMCLIBPATH" # -L$HEPMCFIOLIBPATH"
+FORTRANLIBADD="$FCLIBS" # -l$HEPMCFIOLIBNAME
+AC_SUBST(FORTRANLDFLAGS)
+AC_SUBST(FORTRANLIBADD)
+
+## Dlopen export flags
+DLOPENFLAGS="-export-dynamic"
+AC_SUBST(DLOPENFLAGS)
+
+
+## Python extension
+AC_ARG_ENABLE(pyext, [AC_HELP_STRING(--disable-pyext,
+ [don't build Python module (default=build)])],
+ [], [enable_pyext=yes])
+AZ_PYTHON_DEFAULT
+## Basic Python checks
+if test x$enable_pyext == xyes; then
+ AZ_PYTHON_PATH
+ AZ_PYTHON_VERSION_ENSURE([2.4])
+ PYTHON_VERSION=`$PYTHON -c "import sys; print '.'.join(map(str, sys.version_info@<:@:2@:>@));"`
+ AC_SUBST(PYTHON_VERSION)
+ AGILE_PYTHONPATH=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib(prefix='$prefix');"`
+ AC_SUBST(AGILE_PYTHONPATH)
+ ## Test for Python header
+ if test -x "$PYTHON"; then
+ AC_MSG_CHECKING([for Python include path])
+ python_incpath=`$PYTHON -c "import distutils.sysconfig; print distutils.sysconfig.get_python_inc();"`
+ AC_MSG_RESULT([$python_incpath])
+ python_header="$python_incpath/Python.h"
+ if test -z "$python_incpath"; then
+ AC_MSG_ERROR([Can't build Python extension since include directory cannot be determined from distutils])
+ enable_pyext=no
+ elif test ! -e "$python_header"; then
+ AC_MSG_ERROR([Can't build Python extension since header file $python_header cannot be found])
+ enable_pyext=no
+ fi
+ else
+ AC_MSG_ERROR([Can't build Python extension since python can't be found])
+ enable_pyext=no
+ fi
+fi
+## SWIG checks
+if test x$enable_pyext == xyes; then
+ AC_PROG_SWIG
+ if test x$SWIG == x; then
+ AC_MSG_ERROR([Can't build Python extension since swig could not be found])
+ enable_pyext=no
+ else
+ ## Test that SWIG makes a compilable source file...
+ ## cf. g++ 4.x requires that string literal is "_const_ char*"
+ cat > conftest.i <<EOL
+%module conftest
+%{
+ void foo();
+%}
+void foo();
+EOL
+ AC_MSG_CHECKING([if $SWIG can make a Python function wrapper])
+ flag_ok=yes
+ stat_string=`$SWIG -c++ -python conftest.i 2>&1 1>&5` ; test -z "$stat_string" || flag_ok=no
+ AC_MSG_RESULT([$flag_ok])
+ if test x$flag_ok != xyes; then
+ AC_MSG_ERROR([Can't build Python extension since $SWIG is not able to make a Python wrapper])
+ enable_pyext=no
+ else
+ swig_compiler=$CXX
+ AC_CEDAR_CHECKCXXFLAG([-Wno-format], [AC_MSG_NOTICE([adding -Wno-format to swig compilation test]);
+ swig_compiler="$swig_compiler -Wno-format"])
+ AC_MSG_CHECKING([if $SWIG is compatible with the $CXX compiler])
+ flag_ok=yes
+ if test x$flag_ok == xyes; then
+ stat_string=`$swig_compiler -c conftest_wrap.cxx -I$python_incpath 2>&1 1>&5` ; test -z "$stat_string" || flag_ok=no
+ fi
+ AC_MSG_RESULT([$flag_ok])
+ if test x$flag_ok != xyes; then
+ AC_MSG_ERROR([Can't build Python extension since $SWIG is not compatible with $CXX. Get a newer SWIG version!])
+ enable_pyext=no
+ fi
+ fi
+ fi
+ rm -rf conftest*
+fi
+## Finish
+if test x$enable_pyext == xyes; then
+ AC_MSG_NOTICE([All Python build checks successful: 'AGILe' Python extension will be built])
+fi
+AM_CONDITIONAL(ENABLE_PYEXT, [test x$enable_pyext == xyes])
+
+
+AC_EMPTY_SUBST
+AC_CONFIG_FILES(Makefile)
+AC_CONFIG_FILES(include/Makefile include/AGILe/Makefile)
+AC_CONFIG_FILES(src/Makefile src/Core/Makefile src/Tools/Makefile src/IO/Makefile)
+AC_CONFIG_FILES(src/FPythia/Makefile)
+AC_CONFIG_FILES(src/FHerwig/Makefile)
+AC_CONFIG_FILES(src/AlpGen/Makefile)
+AC_CONFIG_FILES(src/Charybdis/Makefile)
+AC_CONFIG_FILES(src/Rapgap/Makefile)
+AC_CONFIG_FILES(src/Cascade/Makefile)
+AC_CONFIG_FILES(bin/Makefile bin/agile-config)
+AC_CONFIG_FILES(pyext/Makefile pyext/AGILe/Makefile pyext/setup.py)
+AC_CONFIG_FILES(data/Makefile)
+AC_CONFIG_FILES(test/Makefile)
+AC_CONFIG_FILES(agileenv.sh agileenv.csh)
+
+AC_OUTPUT
+
+if test x$enable_python == xyes; then
+ cat <<EOF
+
+************************************************************
+AGILe CONFIGURED!
+
+Now build and install (to the $prefix tree) with e.g.
+make -j2 && make -j2 install
+
+To use AGILe, either link against the AGILe library with
+your own main program, or use the agile-runmc command line
+program.
+
+For a more pleasant command line experience, you can include
+the data/agile-completion file into your .bashrc file
+(or your bash_completion.d directory if you have one.)
+************************************************************
+EOF
+fi
Property changes on: tags/agile-1.2.0/configure.ac
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Index: tags/agile-1.2.0/INSTALL
===================================================================
--- tags/agile-1.2.0/INSTALL (revision 0)
+++ tags/agile-1.2.0/INSTALL (revision 755)
@@ -0,0 +1,234 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006 Free Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package. The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system.
+
+ Running `configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+Compilers and Options
+=====================
+
+Some systems require unusual options for compilation or linking that the
+`configure' script does not know about. Run `./configure --help' for
+details on some of the pertinent environment variables.
+
+ You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here
+is an example:
+
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you can use GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
+
+Installation Names
+==================
+
+By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc. You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+There may be some features `configure' cannot figure out automatically,
+but needs to determine by the type of machine the package will run on.
+Usually, assuming the package is built to be run on the _same_
+architectures, `configure' can figure that out, but if it prints a
+message saying it cannot guess the machine type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+ CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+ OS KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+ If you are _building_ compiler tools for cross-compiling, you should
+use the option `--target=TYPE' to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+If you want to set default values for `configure' scripts to share, you
+can create a site shell script called `config.site' that gives default
+values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+causes the specified `gcc' to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug. Until the bug is fixed you can use this workaround:
+
+ CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
+`configure' Invocation
+======================
+
+`configure' recognizes the following options to control how it operates.
+
+`--help'
+`-h'
+ Print a summary of the options to `configure', and exit.
+
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
+
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
+
Index: tags/agile-1.2.0/COPYING
===================================================================
--- tags/agile-1.2.0/COPYING (revision 0)
+++ tags/agile-1.2.0/COPYING (revision 755)
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
Index: tags/agile-1.2.0/agileenv.sh.in
===================================================================
--- tags/agile-1.2.0/agileenv.sh.in (revision 0)
+++ tags/agile-1.2.0/agileenv.sh.in (revision 755)
@@ -0,0 +1,8 @@
+# These variables need to exist
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datarootdir=@datarootdir@
+
+export PATH="$exec_prefix/bin:$PATH"
+export @LIBPATHVARNAME@="@libdir@:@HEPMCLIBPATH@:$@LIBPATHVARNAME@"
+export PYTHONPATH="@AGILE_PYTHONPATH@:$PYTHONPATH"
Index: tags/agile-1.2.0/bin/agile-runmc
===================================================================
--- tags/agile-1.2.0/bin/agile-runmc (revision 0)
+++ tags/agile-1.2.0/bin/agile-runmc (revision 755)
@@ -0,0 +1,528 @@
+#! /usr/bin/env python
+
+"""Generate events and write to file or stdout
+
+EXAMPLES:
+ %prog <gen> [-p<param> ...] [-P<pfile> ...] \\
+ [-n<nevts>] [-o<outfile>] [--sqrts=<energy>] \\
+ [--beams=<beamsstr>] \\
+ [--seed=<rngseed> | --randomize-seed]
+ %prog --list-gens
+ %prog --list-used-params
+
+
+BEAM SPEC:
+ Beams can be specified in several different schemes. The
+ strings are compared case-insensitively. Energies are
+ specified in GeV. The energy must be explicitly specified,
+ either as part of the beam string (after a colon) or via
+ the --sqrts option.
+
+ * --beams=p:900,pbar:900
+ * --beams=ppbar:1960
+ * --beams=LHC:14000
+ * --beams=pp:14T
+
+ Beam particles:
+ * "proton", "2212", "p", "p+"
+ * "antiproton", "-2212", "pbar", "p-"
+ * "electron", "11", "e-"
+ * "positron", "-11", "e+"
+
+ Beam pair strings:
+ * pp: "LHC", "PP", "RHIC"
+ * ppbar: "TEVATRON", "TVT", "PPBAR"
+ * e+e-: "LEP", "E+E-", "EE"
+
+
+ENVIRONMENT:
+ * AGILE_GEN_PATH
+ Colon-separated list of filesystem paths which get checked
+ in order when searching for generator libraries in the
+ Genser structure. The current directory and the AGILe install
+ path are also searched, after AGILE_GEN_PATH.
+ * AGILE_PARAM_PATH
+ Colon-separated list of filesystem paths which get checked
+ in order when searching for generator parameter files as
+ passed to the -P option. The current directory and the AGILe
+ install path are also searched, after AGILE_PARAM_PATH.
+ * AGILE_DEBUG
+ Enables debug output level if set
+"""
+
+import os, logging, re, sys
+
+## Try to rename the process on Linux
+try:
+ import ctypes
+ libc = ctypes.cdll.LoadLibrary('libc.so.6')
+ libc.prctl(15, 'agile-runmc', 0, 0, 0)
+except Exception:
+ pass
+
+
+## Try to bootstrap the Python path
+import commands
+try:
+ modname = sys.modules[__name__].__file__
+ binpath = os.path.dirname(modname)
+ agileconfigpath = os.path.join(binpath, "agile-config")
+ agilepypath = commands.getoutput(agileconfigpath + " --pythonpath")
+ sys.path.append(agilepypath)
+except:
+ pass
+import AGILe
+
+
+## Randomly seed a random seed. Hmm.
+import random, time
+random.seed(time.time())
+RANDRANDSEED = random.randint(0, 100000000)
+
+
+## Parse command line arguments
+from optparse import OptionParser, OptionGroup
+parser = OptionParser(usage=__doc__)
+parser.add_option("-n", "--nevts", help="Specify the number of events to generate",
+ dest="NEVTS", default="10")
+parser.add_option("--list-gens", help="List the available generators",
+ action="store_true", dest="LISTGENS", default=False)
+parser.add_option("--list-used-params", help="List the parameters passed to the generator by this command",
+ action="store_true", dest="LISTPARAMS", default=False)
+parser.add_option("-o", "--out", help="Specify the file/pipe to write to. Use a '-' to write to stdout.",
+ dest="OUTFILE", default=None)
+parser.add_option("-p", "--param", metavar="PNAME=PVAR", action="append", default=[],
+ help="Change a generator parameter PNAME to value PVAL",
+ dest="PARAMSTRS")
+parser.add_option("-b", "--beams", help="Specify the beams. Super-flexible!",
+ dest="BEAMSTR", default=None)
+parser.add_option("-s", "--seed", help="Specify the generator random number seed",
+ dest="RNGSEED", type="int", default=31415926)
+parser.add_option("--randomize-seed", help="Randomize the generator random number seed",
+ action="store_const", const=RANDRANDSEED, dest="RNGSEED")
+parser.add_option("-P", "--paramfile", metavar="PFILE", action="append", default=[],
+ help="Read a generator parameter file PFILE containing 'name = value' pairs",
+ dest="PARAMFILES")
+parser.add_option("--filter", help="Remove particles without status == {1,2,4} from events",
+ action="store_true", dest="FILTER_EVENTS", default=False)
+verbgroup = OptionGroup(parser, "Verbosity control")
+verbgroup.add_option("-l", dest="NATIVE_LOG_STRS", action="append",
+ default=[], help="set a log level in the AGILe library")
+verbgroup.add_option("-Q", "--quiet", help="Suppress normal messages", dest="LOGLEVEL",
+ action="store_const", default=logging.INFO, const=logging.WARNING)
+verbgroup.add_option("-V", "--verbose", help="Add extra debug messages", dest="LOGLEVEL",
+ action="store_const", default=logging.INFO, const=logging.DEBUG)
+parser.add_option_group(verbgroup)
+opts, args = parser.parse_args()
+
+
+## Change log level if AGILE_DEBUG env variable is set
+if os.environ.has_key("AGILE_DEBUG"):
+ opts.LOGLEVEL = logging.DEBUG
+
+
+## Configure logging
+try:
+ logging.basicConfig(level=opts.LOGLEVEL, format="%(message)s")
+except:
+ pass
+h = logging.StreamHandler()
+h.setFormatter(logging.Formatter("%(message)s"))
+logging.getLogger().setLevel(opts.LOGLEVEL)
+if logging.getLogger().handlers:
+ logging.getLogger().handlers[0] = h
+else:
+ logging.getLogger().addHandler(h)
+
+
+## Control AGILe logger
+for l in opts.NATIVE_LOG_STRS:
+ name, level = None, None
+ try:
+ name, level = l.split("=")
+ except:
+ name = "AGILe"
+ level = l
+ ## Fix name
+ if name != "AGILe" and not name.startswith("AGILe."):
+ name = "AGILe." + name
+ try:
+ ## Get right error type
+ LEVEL = level.upper()
+ if LEVEL == "TRACE":
+ level = AGILe.Log.TRACE
+ elif LEVEL == "DEBUG":
+ level = AGILe.Log.DEBUG
+ elif LEVEL == "INFO":
+ level = AGILe.Log.INFO
+ elif LEVEL == "WARNING" or LEVEL == "WARN":
+ level = AGILe.Log.WARN
+ elif LEVEL == "ERROR":
+ level = AGILe.Log.ERROR
+ else:
+ level = int(level)
+ logging.debug("Setting log level: %s %d" % (name, level))
+ ## Set log level
+ AGILe.Log.setLogLevel(name, level)
+ except:
+ logging.warning("Couldn't process logging string '%s'" % l)
+
+
+## Set up signal handling
+import signal
+RECVD_KILL_SIGNAL = None
+def handleKillSignal(signum, frame):
+ "Declare us as having been signalled, and return to default handling behaviour"
+ global RECVD_KILL_SIGNAL
+ logging.critical("Signal handler called with signal " + str(signum))
+ RECVD_KILL_SIGNAL = signum
+ signal.signal(signum, signal.SIG_DFL)
+## Signals to handle
+signal.signal(signal.SIGTERM, handleKillSignal);
+signal.signal(signal.SIGHUP, handleKillSignal);
+signal.signal(signal.SIGINT, handleKillSignal);
+signal.signal(signal.SIGUSR1, handleKillSignal);
+signal.signal(signal.SIGUSR2, handleKillSignal);
+try:
+ signal.signal(signal.SIGXCPU, handleKillSignal);
+except:
+ pass
+
+
+## Parse number-of-events string
+if not opts.LISTGENS and not opts.LISTPARAMS:
+ try:
+ factor = 1
+ base = opts.NEVTS
+ suffix = opts.NEVTS[-1]
+ if suffix.upper() == "K":
+ factor = 1000
+ base = opts.NEVTS[:-1]
+ elif suffix == "M":
+ factor = 1000000
+ base = opts.NEVTS[:-1]
+ num = int(float(base) * factor)
+ logging.info("Generating %d events" % num)
+ opts.NEVTS = num
+ except:
+ logging.error("Invalid num events specification, '%s'" % opts.NEVTS)
+ sys.exit(1)
+
+
+def readParamStrsFromFile(ppath):
+ paramstrs = []
+ pf = open(ppath, "r")
+ logging.debug("Reading param file '%s'" % ppath)
+ for line in pf:
+ sline = line.strip()
+ if len(sline) == 0 or sline[0] == "#":
+ continue
+ if re.match(r"@include \S+", sline.lower()):
+ incfile = sline.split()[1]
+ logging.info("Reading included parameters from %s" % incfile)
+ paramstrs += readParamFile(incfile)
+ else:
+ paramstrs.append(sline)
+ pf.close()
+ return paramstrs
+
+
+def readParamFile(pfile):
+ global SEARCHPATH
+ ## If a path has been given, don't use the search path
+ if "/" in pfile:
+ logging.debug("Trying to read param file '%s'" % pfile)
+ if os.access(pfile, os.R_OK):
+ return readParamStrsFromFile(pfile)
+ else:
+ raise Exception("Could not read param file '%s'" % pfile)
+ else:
+ for pdir in SEARCHPATH:
+ ppath = os.path.join(pdir, pfile)
+ logging.debug("Trying to read param file '%s'" % ppath)
+ if os.access(ppath, os.R_OK):
+ return readParamStrsFromFile(ppath)
+ raise Exception("Could not find param file '%s'" % pfile)
+
+
+## Get parameter strings from file and CLI
+PARAMSTRS = []
+SEARCHPATH = ["."]
+try:
+ SEARCHPATH += os.getenv("AGILE_PARAM_PATH").split(":")
+except:
+ pass
+try:
+ installdir = os.path.dirname(os.path.abspath(sys.argv[0]))
+ if os.path.basename(installdir) == "bin":
+ installdir = os.path.dirname(installdir)
+
+ agilesharedir = os.path.join(installdir, "share", "AGILe")
+ logging.debug("Adding %s to param file search path" % agilesharedir)
+ SEARCHPATH.append(agilesharedir)
+
+ ## TODO: Deprecate and remove
+ rgsharedir = os.path.join(installdir, "share", "RivetGun")
+ logging.debug("Adding %s to param file search path" % rgsharedir)
+ SEARCHPATH.append(rgsharedir)
+
+ uninstalledsharedir = os.path.join(installdir, "data", "params")
+ logging.debug("Adding %s to param file search path" % uninstalledsharedir)
+ SEARCHPATH.append(uninstalledsharedir)
+except:
+ pass
+logging.debug("Searching for param files in dirs: %s" % str(SEARCHPATH))
+try:
+ for pfile in opts.PARAMFILES:
+ PARAMSTRS += readParamFile(pfile)
+except Exception, e:
+ logging.error(e)
+ sys.exit(2)
+## Add CLI params
+PARAMSTRS += opts.PARAMSTRS
+
+
+## Interpret param strings
+def getKeyVal(pstr):
+ mypstr = pstr.strip().replace("=", " ")
+ parts = mypstr.split()
+ if len(parts) != 2:
+ logging.error("Invalid param string: '%s'" % pstr)
+ sys.exit(1)
+ return parts
+##
+PARAMKEYS = []
+PARAMS = {}
+for pstr in PARAMSTRS:
+ k, v = getKeyVal(pstr)
+ PARAMS[k] = v
+ if not k in PARAMKEYS:
+ PARAMKEYS.append(k)
+
+
+def _parse_energy(numstr):
+ import re
+ try:
+ e = float(numstr)
+ return e
+ except:
+ suffmatch = re.search(r"[^\d.]", numstr)
+ if not suffmatch:
+ raise ValueError("Bad energy string: %s" % numstr)
+ factor = base = None
+ suffstart = suffmatch.start()
+ if suffstart != -1:
+ base = numstr[:suffstart]
+ suffix = numstr[suffstart:]
+ if suffix.startswith("K"):
+ factor = 1e-6
+ elif suffix.startswith("M"):
+ factor = 1e-3
+ elif suffix.startswith("G"):
+ factor = 1
+ elif suffix.startswith("T"):
+ factor = 1e3
+ if factor is None or base is None:
+ raise ValueError("Bad energy string: %s" % numstr)
+ num = float(base) * factor
+ return num
+
+
+## Parse a beam string
+def _parseOneBeamStr(bstr):
+ if not ":" in bstr:
+ raise ValueError("Beam string must contain a colon to separate particle and energy parts")
+
+ name, energy = bstr.split(":")
+ energy = _parse_energy(energy)
+
+ pid = None
+ if name.lower() in ["proton", "2212", "p", "p+"]:
+ pid = AGILe.PROTON
+ elif name.lower() in ["antiproton", "-2212", "pbar", "p-"]:
+ pid = AGILe.ANTIPROTON
+ elif name.lower() in ["electron", "11", "e-"]:
+ pid = AGILe.ELECTRON
+ elif name.lower() in ["positron", "-11", "e+"]:
+ pid = AGILe.POSITRON
+ else:
+ raise Exception("Particle '%s' unknown" % name)
+ return pid, energy
+
+
+## Choose beam string
+## Defaults
+#BEAMSTR = "LHC:14TeV"
+BEAM1 = BEAM2 = "p"
+MOM1 = MOM2 = "7000"
+
+
+## Using params from file and command line
+if PARAMS.has_key("RG:Beam1"):
+ BEAM1 = PARAMS["RG:Beam1"]
+if PARAMS.has_key("RG:Beam2"):
+ BEAM2 = PARAMS["RG:Beam2"]
+if PARAMS.has_key("RG:Mom1"):
+ MOM1 = PARAMS["RG:Mom1"]
+if PARAMS.has_key("RG:Mom2"):
+ MOM2 = PARAMS["RG:Mom2"]
+
+## Build beam string
+BEAMSTR = "%s:%s,%s:%s" % (BEAM1, MOM1, BEAM2, MOM2)
+## Override from params
+if PARAMS.has_key("RG:Beams"):
+ BEAMSTR = PARAMS["RG:Beams"]
+## Override from command line
+if opts.BEAMSTR is not None:
+ BEAMSTR = opts.BEAMSTR
+## Declare what we've got so far
+logging.debug("Beam spec: " + BEAMSTR)
+
+
+## Parse the beams string
+try:
+ if "," in BEAMSTR:
+ beamAStr, beamBStr = BEAMSTR.split(",")
+ PID_A, E_A = _parseOneBeamStr(beamAStr)
+ PID_B, E_B = _parseOneBeamStr(beamBStr)
+ else:
+ if not ":" in BEAMSTR:
+ raise ValueError("Beams string must contain a colon to separate beam type and energy parts")
+ name, energyStr = BEAMSTR.split(":")
+ energy = _parse_energy(energyStr)
+ NAME = name.upper()
+ ## If only a total energy is given, assume collision is symmetric
+ E_A, E_B = energy/2.0, energy/2.0
+ #
+ if NAME in ["LHC", "PP", "RHIC"]:
+ PID_A = AGILe.PROTON
+ PID_B = AGILe.PROTON
+ elif NAME in ["TEVATRON", "TVT", "PPBAR"]:
+ PID_A = AGILe.PROTON
+ PID_B = AGILe.ANTIPROTON
+ elif NAME in ["LEP", "E+E-", "EE"]:
+ PID_A = AGILe.ELECTRON
+ PID_B = AGILe.POSITRON
+ elif NAME in ["HERA", "EP"]:
+ PID_A = AGILe.ELECTRON
+ PID_B = AGILe.PROTON
+ ## HERA uses asymmetric beams
+ ## People seem to quote anything between 296 to 300 GeV for Run I
+ ## These are the actual beam energies
+ if energy <= 300.0 and energy >= 295.0 :
+ E_A = 26.7
+ E_B = 820.0
+ ## Again, people quote a variety of different cms energies
+ elif energy >= 318.0 and energy <= 320.0 :
+ E_A = 27.5
+ E_B = 920
+ else:
+ raise Exception("Unrecognised beams string, '%s'" % BEAMSTR)
+except Exception, e:
+ logging.error("Beam parsing error: " + str(e))
+ sys.exit(1)
+logging.debug("Beams: %s @ %2.1f GeV -> <- %s @ %2.1f GeV" % (str(PID_A), E_A, str(PID_B), E_B))
+
+
+## List generators and exit, if requested
+if opts.LISTGENS:
+ gens = AGILe.getAvailableGens()
+ if len(gens) > 0:
+ allgensstr = "\n".join(AGILe.getAvailableGens())
+ #logging.info(allgensstr)
+ print allgensstr
+ sys.exit(0)
+
+
+## Determine the generator
+GEN = None
+## Override from params
+if PARAMS.has_key("RG:Generator"):
+ GEN = PARAMS["RG:Generator"]
+## Override from command line
+if len(args) == 1:
+ GEN = args[0]
+## Declare what we've got so far
+logging.debug("Specified generator: " + str(GEN))
+
+
+## Push beam and gen choices back into the params dictionary, for dumping
+if PARAMS.has_key("RG:Beams"):
+ del PARAMS["RG:Beams"]
+PARAMS["RG:Mom1"] = str(E_A)
+PARAMS["RG:Mom2"] = str(E_B)
+PARAMS["RG:Beam1"] = str(PID_A)
+PARAMS["RG:Beam2"] = str(PID_B)
+PARAMS["RG:Generator"] = str(GEN)
+
+
+## List params and exit, if requested
+if opts.LISTPARAMS:
+ for k in sorted(PARAMS.keys()):
+ print k, PARAMS[k]
+ sys.exit(0)
+
+
+## No generator specified?
+if GEN is None:
+ allgensstr = "\n ".join(AGILe.getAvailableGens())
+ msg = "No generator specified.\n"
+ if len(allgensstr) > 0:
+ msg += "Available generators:\n %s" % allgensstr
+ else:
+ msg += "No generators are available! Check your AGILE_GEN_PATH variable."
+ logging.error(msg)
+ sys.exit(1)
+
+
+## Invalid generator specified
+if GEN not in AGILe.getAvailableGens():
+ allgensstr = "\n ".join(AGILe.getAvailableGens())
+ msg = "Generator '%s' is not a valid choice.\n" % GEN
+ msg += "Available generators:\n %s" % allgensstr
+ logging.error(msg)
+ sys.exit(1)
+
+
+## Valid generator specified -- hurrah!
+logging.info("Generator is %s" % GEN)
+AGILe.loadGenLibs(GEN)
+gen = AGILe.createGen()
+
+
+## Config and run generator
+logging.debug("Generator name = %s" % gen.getName())
+logging.info("Setting random seed = %d" % opts.RNGSEED)
+gen.setSeed(opts.RNGSEED)
+logging.info("Setting initial state: %s @ %2.1f GeV -> <- %s @ %2.1f GeV" % (str(PID_A), E_A, str(PID_B), E_B))
+gen.setInitialState(PID_A, E_A, PID_B, E_B)
+for pname in PARAMKEYS:
+ pval = PARAMS[pname]
+ if pname.startswith("RG:"):
+ logging.info("Skipping meta-param %s = %s" % (pname, pval))
+ continue
+ logging.info("Setting parameter %s = %s" % (pname,pval))
+ gen.setParam(pname,pval)
+
+
+## Set up Run
+OUT = ""
+if opts.OUTFILE:
+ if opts.OUTFILE != "-" and not "." in opts.OUTFILE:
+ opts.OUTFILE += ".hepmc"
+ OUT = opts.OUTFILE
+run = AGILe.Run(gen, OUT)
+if opts.FILTER_EVENTS:
+ run.doFilter(True)
+
+## Make and write events
+for i in range(opts.NEVTS):
+ st = run.makeEvent()
+ logging.debug(run.eventSummary())
+ if not st:
+ logging.error("Writing events failed")
+ break
+ if RECVD_KILL_SIGNAL is not None:
+ logging.critical("Leaving event loop early due to signal " + str(RECVD_KILL_SIGNAL))
+ break
+gen.finalize()
Property changes on: tags/agile-1.2.0/bin/agile-runmc
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mergeinfo
Index: tags/agile-1.2.0/bin/Makefile.am
===================================================================
--- tags/agile-1.2.0/bin/Makefile.am (revision 0)
+++ tags/agile-1.2.0/bin/Makefile.am (revision 755)
@@ -0,0 +1,8 @@
+bin_SCRIPTS = agile-config
+
+EXTRA_DIST =
+if ENABLE_PYEXT
+dist_bin_SCRIPTS = agile-runmc
+else
+EXTRA_DIST += agile-runmc
+endif
Index: tags/agile-1.2.0/bin/agile-config.in
===================================================================
--- tags/agile-1.2.0/bin/agile-config.in (revision 0)
+++ tags/agile-1.2.0/bin/agile-config.in (revision 755)
@@ -0,0 +1,68 @@
+#! /usr/bin/env bash
+## -*- sh -*-
+## @configure_input@
+
+## These variables need to exist
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+datarootdir=@datarootdir@
+
+tmp=$(echo $* | egrep -- '--\<help\>|-\<h\>')
+if test $# -eq 0 || test -n "$tmp"; then
+ echo "agile-config: configuration tool for the AGILe generator interfaces"
+ echo " http://projects.hepforge.org/agile/"
+ echo
+ echo "Usage: $( basename $0 ) [--help|-h] | "
+ echo " [--{prefix,datadir,libdir,includedir}] | "
+ echo " [--{cppflags,ldflags,ldlibs}] | "
+ echo " [--version]"
+ echo "Options:"
+ echo " --help | -h : show this help message"
+ echo
+ echo " --prefix : show the installation prefix (cf. autoconf)"
+ echo " --includedir : show the path to the directory containing the AGILe headers"
+ echo " --libdir : show the path to the directory containing the AGILe libraries"
+ echo " --datadir : show the path to the directory containing shared data"
+ echo " --pythonpath : show the path(s) to the directory containing AGILe Python modules"
+ echo
+ echo " --cppflags : returns a Rivet '-I' string for insertion into CPPFLAGS"
+ echo " --ldflags : returns a Rivet '-L' string for insertion into LDFLAGS"
+ echo " --libs : returns a Rivet '-l' string for insertion into LIBS or LIBADD"
+ echo
+ echo " --version : returns Rivet release version number"
+fi
+
+OUT=""
+
+## "Atomic" build info, for "roll your own build" obsessives
+tmp=$( echo "$*" | egrep -- '--\<prefix\>')
+test -n "$tmp" && OUT="$OUT @prefix@"
+
+tmp=$( echo "$*" | egrep -- '--\<includedir\>')
+test -n "$tmp" && OUT="$OUT @includedir@"
+
+tmp=$( echo "$*" | egrep -- '--\<libdir\>')
+test -n "$tmp" && OUT="$OUT @libdir@"
+
+tmp=$( echo "$*" | egrep -- '--\<datadir\>')
+test -n "$tmp" && OUT="$OUT @datadir@/@PACKAGE_TARNAME@"
+
+tmp=$( echo "$*" | egrep -- '--\<pythonpath\>')
+test -n "$tmp" && OUT="$OUT @AGILE_PYTHONPATH@"
+
+## "Pre-rolled" build info
+tmp=$( echo "$*" | egrep -- '--\<cppflags\>')
+test -n "$tmp" && OUT="$OUT -I@includedir@"
+
+tmp=$( echo "$*" | egrep -- '--\<ldflags\>')
+test -n "$tmp" && OUT="$OUT -L@libdir@"
+
+tmp=$( echo "$*" | egrep -- '--\<libs\>|--\<ldadd\>')
+test -n "$tmp" && OUT="$OUT -lAGILe"
+
+
+## Version
+tmp=$( echo "$*" | egrep -- '--\<version\>')
+test -n "$tmp" && OUT="$OUT @PACKAGE_VERSION@"
+
+echo $OUT
Index: tags/agile-1.2.0/bin
===================================================================
--- tags/agile-1.2.0/bin (revision 754)
+++ tags/agile-1.2.0/bin (revision 755)
Property changes on: tags/agile-1.2.0/bin
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,2 ##
+Makefile*
+agile-config
Index: tags/agile-1.2.0/Makefile.am
===================================================================
--- tags/agile-1.2.0/Makefile.am (revision 0)
+++ tags/agile-1.2.0/Makefile.am (revision 755)
@@ -0,0 +1,18 @@
+ACLOCAL_AMFLAGS = -I m4
+SUBDIRS = src pyext include bin data
+
+clean-local:
+ @rm -rf a.out
+
+pyclean:
+ cd pyext && $(MAKE) clean
+
+## Remove SVN dirs
+dist-hook:
+ @rm -rf `find $(distdir) -name ".svn"`
+
+## Upload to HepForge
+RSH=rsync
+DEST=login.hepforge.org:agile/downloads/
+upload: dist
+ $(RSH) $(DIST_ARCHIVES) $(DEST)
Property changes on: tags/agile-1.2.0/Makefile.am
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: tags/agile-1.2.0/data/params/fpythia-minbias.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-minbias.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-minbias.params (revision 755)
@@ -0,0 +1,11 @@
+## Switch off all processes
+MSEL 0
+## Switch on elastic scattering
+##MSUB(91) 1
+## Switch on single-diffractive events
+MSUB(92) 1
+MSUB(93) 1
+## Switch on double-diffractive events
+MSUB(94) 1
+## Switch on low-pT scattering
+MSUB(95) 1
Index: tags/agile-1.2.0/data/params/fpythia-Zee.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-Zee.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-Zee.params (revision 755)
@@ -0,0 +1,51 @@
+### Only Z/gamma -> e e events are produced.
+
+# produce only Drell-Yan
+MSEL 0
+MSUB(1) 1
+
+## gamma decays
+# d
+MDME(162,1) 0
+# u
+MDME(163,1) 0
+# s
+MDME(164,1) 0
+# c
+MDME(165,1) 0
+# b
+MDME(166,1) 0
+# t
+MDME(167,1) 0
+# e-
+MDME(170,1) 1
+# mu-
+MDME(171,1) 0
+# tau-
+MDME(172,1) 0
+
+## Z decays
+# d
+MDME(174,1) 0
+# u
+MDME(175,1) 0
+# s
+MDME(176,1) 0
+# c
+MDME(177,1) 0
+# b
+MDME(178,1) 0
+# t
+MDME(179,1) 0
+# e-
+MDME(182,1) 1
+# mu-
+MDME(184,1) 0
+# tau-
+MDME(186,1) 0
+# nu_e
+MDME(183,1) 0
+# nu_mu
+MDME(185,1) 0
+# nu_tau
+MDME(187,1) 0
Index: tags/agile-1.2.0/data/params/fpythia-CDF_2000_S4155203.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-CDF_2000_S4155203.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-CDF_2000_S4155203.params (revision 755)
@@ -0,0 +1,56 @@
+### This parameter file is for the CDF_2000_S4155203 analysis.
+### Only Z/gamma->ee events are produced.
+### The invariant mass of the lepton pair is > 66 GeV.
+
+# produce only Drell-Yan
+MSEL 0
+MSUB(1) 1
+
+# invariant mass of the fermion pair from the Z decay > 66 GeV
+CKIN(1) 66
+
+## gamma decays
+# d
+MDME(162,1) 0
+# u
+MDME(163,1) 0
+# s
+MDME(164,1) 0
+# c
+MDME(165,1) 0
+# b
+MDME(166,1) 0
+# t
+MDME(167,1) 0
+# e-
+MDME(170,1) 1
+# mu-
+MDME(171,1) 0
+# tau-
+MDME(172,1) 0
+
+## Z decays
+# d
+MDME(174,1) 0
+# u
+MDME(175,1) 0
+# s
+MDME(176,1) 0
+# c
+MDME(177,1) 0
+# b
+MDME(178,1) 0
+# t
+MDME(179,1) 0
+# e-
+MDME(182,1) 1
+# mu-
+MDME(184,1) 0
+# tau-
+MDME(186,1) 0
+# nu_e
+MDME(183,1) 0
+# nu_mu
+MDME(185,1) 0
+# nu_tau
+MDME(187,1) 0
Index: tags/agile-1.2.0/data/params/fpythia-Zhadronic-delphi.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-Zhadronic-delphi.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-Zhadronic-delphi.params (revision 755)
@@ -0,0 +1,2 @@
+@include fpythia-Zhadronic.params
+@include fpythia-delphi.params
Index: tags/agile-1.2.0/data/params/fpythia-default.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-default.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-default.params (revision 755)
@@ -0,0 +1,5 @@
+MSUB(20) = 0
+MSUB(25) = 1
+MSUB(95) = 1
+MSTP(51) = 20470
+MSTP(52) = 2
Index: tags/agile-1.2.0/data/params/fpythia-nsd.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-nsd.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-nsd.params (revision 755)
@@ -0,0 +1,6 @@
+## Switch off all processes
+MSEL 0
+## Switch on double-diffractive events
+MSUB(94) 1
+## Switch on low-pT scattering
+MSUB(95) 1
Index: tags/agile-1.2.0/data/params/lhc10000.params
===================================================================
--- tags/agile-1.2.0/data/params/lhc10000.params (revision 0)
+++ tags/agile-1.2.0/data/params/lhc10000.params (revision 755)
@@ -0,0 +1,4 @@
+RG:Beam1 = PROTON
+RG:Beam2 = PROTON
+RG:Mom1 = 5000
+RG:Mom2 = 5000
Index: tags/agile-1.2.0/data/params/fherwig-atlas-mc09-7000.params
===================================================================
--- tags/agile-1.2.0/data/params/fherwig-atlas-mc09-7000.params (revision 0)
+++ tags/agile-1.2.0/data/params/fherwig-atlas-mc09-7000.params (revision 755)
@@ -0,0 +1,14 @@
+AUTPDF(1) = HWLHAPDF
+AUTPDF(2) = HWLHAPDF
+MODPDF(1) = 20650
+MODPDF(2) = 20650
+
+## Turn on Jimmy as underlying event.
+# JMBUG = 0
+JMUEO = 1
+PRSOF = 0
+MSFLAG = 1
+
+PTMIN = 10.0
+PTJIM = 5.2
+PRRAD = 2.2
Index: tags/agile-1.2.0/data/params/charybdisher-default.params
===================================================================
--- tags/agile-1.2.0/data/params/charybdisher-default.params (revision 0)
+++ tags/agile-1.2.0/data/params/charybdisher-default.params (revision 755)
@@ -0,0 +1,33 @@
+#
+AUTPDF(1) = HWLHAPDF
+AUTPDF(2) = HWLHAPDF
+MODPDF(1) = 10042
+MODPDF(2) = 10042
+# JMBUG = 0
+# Turn on Jimmy as underlying event.
+#JMUEO = 1
+#MSFLAG = 1
+#PTJIM = 3.0
+#PRRAD = 2.13
+#MAXER = 10
+#IPROC = -100
+#
+MPLNCK = 1000.0
+MSSDEF = 2
+TOTDIM = 6
+GTSCA = 0
+MINMSS = 5000.0
+MAXMSS = 14000.0
+NBODY = 2
+TIMVAR = 1
+MSSDEC = 3
+GRYBDY = 1
+KINCUT = 0
+YRCSEC = 0
+THWMAX = 1000.0
+RMBOIL = 0
+RMMINM = 1000.0
+IBHPRN = 1
+#
+
+
Index: tags/agile-1.2.0/data/params/lhc14000.params
===================================================================
--- tags/agile-1.2.0/data/params/lhc14000.params (revision 0)
+++ tags/agile-1.2.0/data/params/lhc14000.params (revision 755)
@@ -0,0 +1,4 @@
+RG:Beam1 = PROTON
+RG:Beam2 = PROTON
+RG:Mom1 = 7000
+RG:Mom2 = 7000
Index: tags/agile-1.2.0/data/params/fpythia-aleph.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-aleph.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-aleph.params (revision 755)
@@ -0,0 +1,33 @@
+## LEP ALEPH experiment tune of Fortran PYTHIA
+## NB. Incomplete, since ALEPH also used a hacked PY5 with
+## hard-coded flavour-sector parameters.
+MSTJ(11) 3
+MSTJ(12) 2
+MSTJ(41) 2
+MSTJ(45) 5
+MSTJ(46) 0
+MSTJ(107) 4
+MSTJ(110) 2
+PARJ(41) 0.400
+PARJ(42) 1.03
+PARJ(21) 0.36
+PARJ(81) 0.32
+PARJ(82) 1.22
+PARJ(54) -0.0500
+PARJ(55) -0.0045
+PARJ(1) 0.095
+PARJ(2) 0.285
+PARJ(3) 0.58
+PARJ(4) 0.05
+PARJ(5) 0.5
+PARJ(19) 1.
+PARJ(25) 1.
+PARJ(26) 0.4
+MSTJ(51) 0
+PARJ(11) 0.55
+PARJ(12) 0.47
+PARJ(13) 0.60
+PARJ(14) 0.096
+PARJ(15) 0.032
+PARJ(16) 0.096
+PARJ(17) 0.16
Index: tags/agile-1.2.0/data/params/tevatron630.params
===================================================================
--- tags/agile-1.2.0/data/params/tevatron630.params (revision 0)
+++ tags/agile-1.2.0/data/params/tevatron630.params (revision 755)
@@ -0,0 +1,4 @@
+RG:Beam1 = PROTON
+RG:Beam2 = ANTIPROTON
+RG:Mom1 = 315
+RG:Mom2 = 315
Index: tags/agile-1.2.0/data/params/fpythia-ALEPH_1996_S3196992.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-ALEPH_1996_S3196992.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-ALEPH_1996_S3196992.params (revision 755)
@@ -0,0 +1,7 @@
+## Pythia config for ALEPH_1996_S3196992 photon fragmentation analysis
+MSEL 0
+MSUB(1) 1
+MSUB(18) 1
+MSTJ(21) 0
+
+@include fpythia-Zhadronic.params
Index: tags/agile-1.2.0/data/params/fpythia-atlaspdf.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-atlaspdf.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-atlaspdf.params (revision 755)
@@ -0,0 +1,2 @@
+MSTP(51) = 10042
+MSTP(52) = 2
Index: tags/agile-1.2.0/data/params/fherwig-atlas-mc09-10000.params
===================================================================
--- tags/agile-1.2.0/data/params/fherwig-atlas-mc09-10000.params (revision 0)
+++ tags/agile-1.2.0/data/params/fherwig-atlas-mc09-10000.params (revision 755)
@@ -0,0 +1,14 @@
+AUTPDF(1) = HWLHAPDF
+AUTPDF(2) = HWLHAPDF
+MODPDF(1) = 20650
+MODPDF(2) = 20650
+
+## Turn on Jimmy as underlying event.
+# JMBUG = 0
+JMUEO = 1
+PRSOF = 0
+MSFLAG = 1
+
+PTMIN = 10.0
+PTJIM = 5.8
+PRRAD = 2.2
Index: tags/agile-1.2.0/data/params/falppyt-default.params
===================================================================
--- tags/agile-1.2.0/data/params/falppyt-default.params (revision 0)
+++ tags/agile-1.2.0/data/params/falppyt-default.params (revision 755)
@@ -0,0 +1,12 @@
+MSUB(20) = 0
+MSUB(25) = 1
+MSUB(95) = 1
+MSTP(51) = 20470
+MSTP(52) = 2
+
+## Read parton-level process from LHA event file
+MSTP(143) = 1
+
+## Handle this specially - we need a single FAlpHer generator
+## interface rather than the aux generator hack
+ALPGENFILE = zhjj
Index: tags/agile-1.2.0/data/params/fherwig-atlas-mc09-14000.params
===================================================================
--- tags/agile-1.2.0/data/params/fherwig-atlas-mc09-14000.params (revision 0)
+++ tags/agile-1.2.0/data/params/fherwig-atlas-mc09-14000.params (revision 755)
@@ -0,0 +1,14 @@
+AUTPDF(1) = HWLHAPDF
+AUTPDF(2) = HWLHAPDF
+MODPDF(1) = 20650
+MODPDF(2) = 20650
+
+## Turn on Jimmy as underlying event.
+# JMBUG = 0
+JMUEO = 1
+PRSOF = 0
+MSFLAG = 1
+
+PTMIN = 10.0
+PTJIM = 6.3
+PRRAD = 2.2
Index: tags/agile-1.2.0/data/params/fpythia-CDF_2001_S4751469.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-CDF_2001_S4751469.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-CDF_2001_S4751469.params (revision 755)
@@ -0,0 +1 @@
+## This analysis doesn't require any special settings for Pythia 6
Index: tags/agile-1.2.0/data/params/fpythia-atlas.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-atlas.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-atlas.params (revision 755)
@@ -0,0 +1,47 @@
+# Replicates the ATLAS 2008 Pythia 6 settings
+# tagged EvgenJobOptions-00-00-67 in ATLAS' CVS repository
+# http://atlas-sw.cern.ch/cgi-bin/viewcvs-atlas.cgi/offline/Generators/EvgenJobOptions/share/MC8_Pythia_Common.py?revision=1.5&view=markup
+
+PMAS(6,1) = 172.5
+PMAS(24,1) = 80.403
+PMAS(24,2) = 2.141
+PMAS(23,1) = 91.1876
+PMAS(23,2) = 2.4952
+
+MSTP(128) = 1
+MSTU(21) = 1
+MSTP(81) = 21
+MSTP(82) = 4
+
+MSTP(70) = 0
+MSTP(72) = 1
+MSTP(88) = 1
+MSTP(90) = 1
+
+PARP(78) = 0.3
+PARP(80) = 0.1
+PARP(82) = 2.1
+PARP(83) = 0.8
+PARP(84) = 0.7
+PARP(90) = 0.16
+PARJ(81) = 0.29
+MSTP(95) = 1
+
+MSTP(52) = 2
+MSTP(54) = 2
+MSTP(56) = 2
+MSTP(51) = 10042
+MSTP(53) = 10042
+MSTP(55) = 10042
+
+MSTJ(11) = 3
+MSTJ(22) = 2
+PARJ(54) = -0.07
+PARJ(55) = -0.006
+
+MSTP(84) = 1
+MSTP(85) = 1
+MSTP(86) = 2
+MSTP(87) = 4
+MSTP(89) = 1
+PARP(89) = 1800.
\ No newline at end of file
Index: tags/agile-1.2.0/data/params/fpythia-delphi.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-delphi.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-delphi.params (revision 755)
@@ -0,0 +1,33 @@
+## LEP DELPHI experiment tune of Fortran PYTHIA
+## NB. Incomplete, since DELPHI also used a hacked PY5 with
+## hard-coded flavour-sector parameters.
+MSTJ(11) 3
+MSTJ(12) 3
+MSTJ(41) 2
+MSTJ(45) 5
+MSTJ(46) 3
+MSTJ(107) 4
+MSTJ(110) 2
+PARJ(41) 0.417
+PARJ(42) 0.850
+PARJ(21) 0.408
+PARJ(81) 0.297
+PARJ(82) 1.56
+PARJ(54) -0.03800
+PARJ(55) -0.00284
+PARJ(1) 0.099
+PARJ(2) 0.307
+PARJ(3) 0.59283
+PARJ(4) 0.07
+PARJ(5) 0.5
+PARJ(19) 0.5
+PARJ(25) 0.65
+PARJ(26) 0.23
+MSTJ(51) 0
+PARJ(11) 0.55
+PARJ(12) 0.55
+PARJ(13) 0.75
+PARJ(14) 0.090
+PARJ(15) 0.070
+PARJ(16) 0.085
+PARJ(17) 0.14
Index: tags/agile-1.2.0/data/params/fpythia-CDF_2002_S4796047.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-CDF_2002_S4796047.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-CDF_2002_S4796047.params (revision 755)
@@ -0,0 +1,4 @@
+### This parameter file makes particles with c*tau > 10 mm stable.
+
+MSTJ(22) 2
+PARJ(71) 10.0
Index: tags/agile-1.2.0/data/params/fpythia-atlas-ambt1.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-atlas-ambt1.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-atlas-ambt1.params (revision 755)
@@ -0,0 +1,39 @@
+## "MC09-like" base setup
+MSTP(51) 20650
+MSTP(52) 2
+PMAS(6,1) 172.5
+PMAS(24,1) 80.403
+PMAS(24,2) 2.141
+PMAS(23,1) 91.1876
+PMAS(23,2) 2.4952
+MSTP(128) 1
+MSTU(21) 1
+MSTP(81) 21
+MSTP(82) 4
+MSTP(70) 0
+MSTP(72) 1
+MSTP(88) 1
+MSTP(90) 0
+PARP(80) 0.1
+PARJ(81) 0.29
+MSTP(95) 6
+MSTP(84) 1
+MSTP(85) 1
+MSTP(86) 2
+MSTP(87) 4
+PARP(89) 1800.
+MSTJ(11) 4
+PARJ(41) 0.3
+PARJ(42) 0.58
+PARJ(46) 0.75
+MSTJ(22) 2
+
+## AMBT1-specifics
+PARP(62) 1.025
+PARP(93) 10.0
+PARP(77) 1.0159
+PARP(78) 0.5378
+PARP(82) 2.292
+PARP(83) 0.356
+PARP(84) 0.6508
+PARP(90) 0.250
Index: tags/agile-1.2.0/data/params/fpythia-Zhadronic-aleph.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-Zhadronic-aleph.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-Zhadronic-aleph.params (revision 755)
@@ -0,0 +1,2 @@
+@include fpythia-Zhadronic.params
+@include fpythia-aleph.params
Index: tags/agile-1.2.0/data/params/fpythia-atlas-mc09.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-atlas-mc09.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-atlas-mc09.params (revision 755)
@@ -0,0 +1,33 @@
+MSTP(51) 20650
+MSTP(52) 2
+PMAS(6,1) 172.5
+PMAS(24,1) 80.403
+PMAS(24,2) 2.141
+PMAS(23,1) 91.1876
+PMAS(23,2) 2.4952
+MSTP(128) 1
+MSTU(21) 1
+MSTP(81) 21
+MSTP(82) 4
+MSTP(70) 0
+MSTP(72) 1
+MSTP(88) 1
+MSTP(90) 0
+PARP(80) 0.1
+PARJ(81) 0.29
+MSTP(95) 6
+MSTP(84) 1
+MSTP(85) 1
+MSTP(86) 2
+MSTP(87) 4
+PARP(89) 1800.
+MSTJ(11) 4
+PARJ(41) 0.3
+PARJ(42) 0.58
+PARJ(46) 0.75
+MSTJ(22) 2
+PARP(78) 0.3
+PARP(82) 2.3
+PARP(83) 0.8
+PARP(84) 0.7
+PARP(90) 0.25
Index: tags/agile-1.2.0/data/params/fpythia-cms-z1.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-cms-z1.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-cms-z1.params (revision 755)
@@ -0,0 +1,37 @@
+## "MC09-like" base setup, but with CTEQ5L
+PMAS(6,1) 172.5
+PMAS(24,1) 80.403
+PMAS(24,2) 2.141
+PMAS(23,1) 91.1876
+PMAS(23,2) 2.4952
+MSTP(128) 1
+MSTU(21) 1
+MSTP(81) 21
+MSTP(82) 4
+MSTP(70) 0
+MSTP(72) 1
+MSTP(88) 1
+MSTP(90) 0
+PARP(80) 0.1
+PARJ(81) 0.29
+MSTP(95) 6
+MSTP(84) 1
+MSTP(85) 1
+MSTP(86) 2
+MSTP(87) 4
+PARP(89) 1800.
+MSTJ(11) 4
+PARJ(41) 0.3
+PARJ(42) 0.58
+PARJ(46) 0.75
+MSTJ(22) 2
+
+## Z1-specifics
+PARP(62) 1.025
+PARP(93) 10.0
+PARP(77) 1.0159
+PARP(78) 0.5378
+PARP(82) 1.932
+PARP(83) 0.356
+PARP(84) 0.6508
+PARP(90) 0.275
Index: tags/agile-1.2.0/data/params/fherwig-default.params
===================================================================
--- tags/agile-1.2.0/data/params/fherwig-default.params (revision 0)
+++ tags/agile-1.2.0/data/params/fherwig-default.params (revision 755)
@@ -0,0 +1,12 @@
+AUTPDF(1) = HWLHAPDF
+AUTPDF(2) = HWLHAPDF
+MODPDF(1) = 20470
+MODPDF(2) = 20470
+# JMBUG = 0
+# Turn on Jimmy as underlying event.
+JMUEO = 1
+MSFLAG = 1
+PTJIM = 3.0
+PRRAD = 2.13
+#MAXER = 10
+IPROC = 1500;
Index: tags/agile-1.2.0/data/params/fpythia-CDF_2008_NOTE_9351.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-CDF_2008_NOTE_9351.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-CDF_2008_NOTE_9351.params (revision 755)
@@ -0,0 +1,62 @@
+### This parameter file is for the CDF_2008_NOTE_9351 analysis.
+### Only Z/gamma->ee and Z/gamma->mumu are produced.
+### The invariant mass of the lepton pair is > 70 GeV.
+
+# produce only Drell-Yan
+MSEL 0
+MSUB(1) 1
+
+# invariant mass of the fermion pair from the Z decay > 70 GeV
+CKIN(1) 70
+
+# set particles with c*tau > 10 mm stable.
+
+MSTJ(22) 2
+PARJ(71) 10.0
+
+## gamma decays
+# d
+MDME(162,1) 0
+# u
+MDME(163,1) 0
+# s
+MDME(164,1) 0
+# c
+MDME(165,1) 0
+# b
+MDME(166,1) 0
+# t
+MDME(167,1) 0
+# e-
+MDME(170,1) 1
+# mu-
+MDME(171,1) 1
+# tau-
+MDME(172,1) 0
+
+## Z decays
+# d
+MDME(174,1) 0
+# u
+MDME(175,1) 0
+# s
+MDME(176,1) 0
+# c
+MDME(177,1) 0
+# b
+MDME(178,1) 0
+# t
+MDME(179,1) 0
+# e-
+MDME(182,1) 1
+# mu-
+MDME(184,1) 1
+# tau-
+MDME(186,1) 0
+# nu_e
+MDME(183,1) 0
+# nu_mu
+MDME(185,1) 0
+# nu_tau
+MDME(187,1) 0
+
Index: tags/agile-1.2.0/data/params/fpythia-atlas-mc09c.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-atlas-mc09c.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-atlas-mc09c.params (revision 755)
@@ -0,0 +1,33 @@
+MSTP(51) 20650
+MSTP(52) 2
+PMAS(6,1) 172.5
+PMAS(24,1) 80.403
+PMAS(24,2) 2.141
+PMAS(23,1) 91.1876
+PMAS(23,2) 2.4952
+MSTP(128) 1
+MSTU(21) 1
+MSTP(81) 21
+MSTP(82) 4
+MSTP(70) 0
+MSTP(72) 1
+MSTP(88) 1
+MSTP(90) 0
+PARP(80) 0.1
+PARJ(81) 0.29
+MSTP(95) 6
+MSTP(84) 1
+MSTP(85) 1
+MSTP(86) 2
+MSTP(87) 4
+PARP(89) 1800.
+MSTJ(11) 4
+PARJ(41) 0.3
+PARJ(42) 0.58
+PARJ(46) 0.75
+MSTJ(22) 2
+PARP(78) 0.224
+PARP(82) 2.315
+PARP(83) 0.8
+PARP(84) 0.7
+PARP(90) 0.2487
Index: tags/agile-1.2.0/data/params/fpythia-Zmumu.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-Zmumu.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-Zmumu.params (revision 755)
@@ -0,0 +1,51 @@
+### Only Z/gamma -> mu mu events are produced.
+
+# produce only Drell-Yan
+MSEL 0
+MSUB(1) 1
+
+## gamma decays
+# d
+MDME(162,1) 0
+# u
+MDME(163,1) 0
+# s
+MDME(164,1) 0
+# c
+MDME(165,1) 0
+# b
+MDME(166,1) 0
+# t
+MDME(167,1) 0
+# e-
+MDME(170,1) 0
+# mu-
+MDME(171,1) 1
+# tau-
+MDME(172,1) 0
+
+## Z decays
+# d
+MDME(174,1) 0
+# u
+MDME(175,1) 0
+# s
+MDME(176,1) 0
+# c
+MDME(177,1) 0
+# b
+MDME(178,1) 0
+# t
+MDME(179,1) 0
+# e-
+MDME(182,1) 0
+# mu-
+MDME(184,1) 1
+# tau-
+MDME(186,1) 0
+# nu_e
+MDME(183,1) 0
+# nu_mu
+MDME(185,1) 0
+# nu_tau
+MDME(187,1) 0
Index: tags/agile-1.2.0/data/params/hera296.params
===================================================================
--- tags/agile-1.2.0/data/params/hera296.params (revision 0)
+++ tags/agile-1.2.0/data/params/hera296.params (revision 755)
@@ -0,0 +1,4 @@
+RG:Beam1 = ELECTRON
+RG:Beam2 = PROTON
+RG:Mom1 = 26.7
+RG:Mom2 = 820
\ No newline at end of file
Index: tags/agile-1.2.0/data/params/fpythia-D0_2008_S7837160.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-D0_2008_S7837160.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-D0_2008_S7837160.params (revision 755)
@@ -0,0 +1,44 @@
+## W+- production
+MSEL 12
+
+## W+- decays
+# dbar u
+MDME(190,1) 0
+# dbar c
+MDME(191,1) 0
+# dbar t
+MDME(192,1) 0
+# dbar t'
+MDME(193,1) 0
+# sbar u
+MDME(194,1) 0
+# sbar c
+MDME(195,1) 0
+# sbar t
+MDME(196,1) 0
+# sbar t'
+MDME(197,1) 0
+# bbar u
+MDME(198,1) 0
+# bbar c
+MDME(199,1) 0
+# bbar t
+MDME(200,1) 0
+# bbar t'
+MDME(201,1) 0
+# b'bar u
+MDME(202,1) 0
+# b'bar c
+MDME(203,1) 0
+# b'bar t
+MDME(204,1) 0
+# b'bar t'
+MDME(205,1) 0
+# e+ nu_e
+MDME(206,1) 1
+# mu+ nu_mu
+MDME(207,1) 0
+# tau+ nu_tau
+MDME(208,1) 0
+# tau'+ nu'_tau
+MDME(209,1) 0
Index: tags/agile-1.2.0/data/params/fpythia-CDF_2008_LEADINGJETS.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-CDF_2008_LEADINGJETS.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-CDF_2008_LEADINGJETS.params (revision 755)
@@ -0,0 +1,4 @@
+### This parameter file makes particles with c*tau > 10 mm stable.
+
+MSTJ(22) 2
+PARJ(71) 10.0
Index: tags/agile-1.2.0/data/params/fpythia-D0_2008_S7554427.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-D0_2008_S7554427.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-D0_2008_S7554427.params (revision 755)
@@ -0,0 +1,5 @@
+## Include Z -> e e config
+@include fpythia-Zee.params
+
+## Invariant mass of the fermion pair from the Z decay > 40 GeV
+CKIN(1) 40
Index: tags/agile-1.2.0/data/params/tevatron1960.params
===================================================================
--- tags/agile-1.2.0/data/params/tevatron1960.params (revision 0)
+++ tags/agile-1.2.0/data/params/tevatron1960.params (revision 755)
@@ -0,0 +1,4 @@
+RG:Beam1 = PROTON
+RG:Beam2 = ANTIPROTON
+RG:Mom1 = 980
+RG:Mom2 = 980
Index: tags/agile-1.2.0/data/params/fpythia-Zhadronic.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-Zhadronic.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-Zhadronic.params (revision 755)
@@ -0,0 +1,20 @@
+MDME(162,1) 1
+MDME(163,1) 1
+MDME(164,1) 1
+MDME(165,1) 1
+MDME(166,1) 1
+MDME(170,1) 0
+MDME(171,1) 0
+MDME(172,1) 0
+MDME(174,1) 1
+MDME(175,1) 1
+MDME(176,1) 1
+MDME(177,1) 1
+MDME(178,1) 1
+MDME(179,1) 1
+MDME(182,1) 0
+MDME(184,1) 0
+MDME(186,1) 0
+MDME(183,1) 0
+MDME(185,1) 0
+MDME(187,1) 0
Index: tags/agile-1.2.0/data/params/rhic-pp200.params
===================================================================
--- tags/agile-1.2.0/data/params/rhic-pp200.params (revision 0)
+++ tags/agile-1.2.0/data/params/rhic-pp200.params (revision 755)
@@ -0,0 +1,4 @@
+RG:Beam1 = PROTON
+RG:Beam2 = PROTON
+RG:Mom1 = 100
+RG:Mom2 = 100
Index: tags/agile-1.2.0/data/params/fpythia-D0_2008_S7863608.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-D0_2008_S7863608.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-D0_2008_S7863608.params (revision 755)
@@ -0,0 +1,5 @@
+## Include Z -> mu mu config
+@include fpythia-Zmumu.params
+
+## Invariant mass of the fermion pair from the Z decay > 65 GeV
+CKIN(1) 65
Index: tags/agile-1.2.0/data/params/fpythia-D0_2007_S7075677.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-D0_2007_S7075677.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-D0_2007_S7075677.params (revision 755)
@@ -0,0 +1,5 @@
+## Include Z -> e e config
+@include fpythia-Zee.params
+
+## Invariant mass of the fermion pair from the Z decay > 40 GeV
+CKIN(1) 40
Index: tags/agile-1.2.0/data/params/ccpythia-default.params
===================================================================
--- tags/agile-1.2.0/data/params/ccpythia-default.params (revision 0)
+++ tags/agile-1.2.0/data/params/ccpythia-default.params (revision 755)
@@ -0,0 +1,7 @@
+PhaseSpace:pTHatMin = 2.0
+HardQCD:all = on
+
+## More examples
+#WeakSingleBoson:ffbar2gmZ = on
+#PhaseSpace:mHatMin = 80.0
+#PhaseSpace:mHatMax = 120.0
Index: tags/agile-1.2.0/data/params/charybdispyt-default.params
===================================================================
--- tags/agile-1.2.0/data/params/charybdispyt-default.params (revision 0)
+++ tags/agile-1.2.0/data/params/charybdispyt-default.params (revision 755)
@@ -0,0 +1,23 @@
+#
+MSTP(52) = 2
+MSTP(51) = 10042
+#
+MPLNCK = 1000.0
+MSSDEF = 2
+TOTDIM = 6
+GTSCA = 0
+MINMSS = 5000.0
+MAXMSS = 14000.0
+NBODY = 2
+TIMVAR = 1
+MSSDEC = 3
+GRYBDY = 1
+KINCUT = 0
+YRCSEC = 0
+THWMAX = 1000.0
+RMBOIL = 0
+RMMINM = 1000.0
+IBHPRN = 1
+#
+
+
Index: tags/agile-1.2.0/data/params/fpythia-gammajet.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-gammajet.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-gammajet.params (revision 755)
@@ -0,0 +1,7 @@
+## This sets up jet + prompt photon event production for Pythia 6
+
+# Produce only gamma + jet (q,qbar,g) hard processes
+MSEL 0
+MSUB(14) 1
+MSUB(29) 1
+MSUB(115) 1
Index: tags/agile-1.2.0/data/params/fpythia-dd.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-dd.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-dd.params (revision 755)
@@ -0,0 +1,4 @@
+## Switch off all processes
+MSEL 0
+## Switch on double-diffractive events
+MSUB(94) 1
Index: tags/agile-1.2.0/data/params/lhc900.params
===================================================================
--- tags/agile-1.2.0/data/params/lhc900.params (revision 0)
+++ tags/agile-1.2.0/data/params/lhc900.params (revision 755)
@@ -0,0 +1,4 @@
+RG:Beam1 = PROTON
+RG:Beam2 = PROTON
+RG:Mom1 = 450
+RG:Mom2 = 450
Index: tags/agile-1.2.0/data/params/fherwig-qcd.params
===================================================================
--- tags/agile-1.2.0/data/params/fherwig-qcd.params (revision 0)
+++ tags/agile-1.2.0/data/params/fherwig-qcd.params (revision 755)
@@ -0,0 +1,14 @@
+AUTPDF(1) = HWLHAPDF
+AUTPDF(2) = HWLHAPDF
+MODPDF(1) = 20470
+MODPDF(2) = 20470
+# JMBUG = 0
+# Turn on Jimmy as underlying event.
+# JMUEO = 1
+PRSOF = 0.0
+MSFLAG = 0
+PTJIM = 5.0
+MAXER = 1000
+PTMIN = 20.
+IPROC = 1500
+# MAXPR = 10
Index: tags/agile-1.2.0/data/params/fherwig.qcd.params
===================================================================
--- tags/agile-1.2.0/data/params/fherwig.qcd.params (revision 0)
+++ tags/agile-1.2.0/data/params/fherwig.qcd.params (revision 755)
@@ -0,0 +1,14 @@
+AUTPDF(1) = HWLHAPDF
+AUTPDF(2) = HWLHAPDF
+MODPDF(1) = 20470
+MODPDF(2) = 20470
+# JMBUG = 0
+# Turn on Jimmy as underlying event.
+# JMUEO = 1
+PRSOF = 0.0
+MSFLAG = 0
+PTJIM = 5.0
+MAXER = 1000
+PTMIN = 20.
+IPROC = 1500
+# MAXPR = 10
Index: tags/agile-1.2.0/data/params/lep1.params
===================================================================
--- tags/agile-1.2.0/data/params/lep1.params (revision 0)
+++ tags/agile-1.2.0/data/params/lep1.params (revision 755)
@@ -0,0 +1,4 @@
+RG:Beam1 = ELECTRON
+RG:Beam2 = POSITRON
+RG:Mom1 = 45.6
+RG:Mom2 = 45.6
Index: tags/agile-1.2.0/data/params/fherwig-atlas-mc08.params
===================================================================
--- tags/agile-1.2.0/data/params/fherwig-atlas-mc08.params (revision 0)
+++ tags/agile-1.2.0/data/params/fherwig-atlas-mc08.params (revision 755)
@@ -0,0 +1,16 @@
+AUTPDF(1) = HWLHAPDF
+AUTPDF(2) = HWLHAPDF
+MODPDF(1) = 10042
+MODPDF(2) = 10042
+
+## Turn on Jimmy as underlying event.
+# JMBUG = 0
+JMUEO = 1
+MSFLAG = 1
+PTJIM = 3.0
+PRRAD = 1.8
+PRSOF = 1.0
+
+## Process and error control
+#MAXER = 1000
+#IPROC = 1500
Index: tags/agile-1.2.0/data/params/falpher-default.params
===================================================================
--- tags/agile-1.2.0/data/params/falpher-default.params (revision 0)
+++ tags/agile-1.2.0/data/params/falpher-default.params (revision 755)
@@ -0,0 +1,16 @@
+AUTPDF(1) = HWLHAPDF
+AUTPDF(2) = HWLHAPDF
+MODPDF(1) = 20470
+MODPDF(2) = 20470
+# JMBUG = 0
+# Turn on Jimmy as underlying event.
+JMUEO = 1
+MSFLAG = 1
+PTJIM = 3.0
+PRRAD = 2.13
+MAXER = 10
+IPROC = -100;
+
+## Handle this specially - we need a single FAlpHer generator
+## interface rather than the aux generator hack
+ALPGENFILE = zhjj
Index: tags/agile-1.2.0/data/params/fpythia-nd.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-nd.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-nd.params (revision 755)
@@ -0,0 +1 @@
+MSEL 1
Index: tags/agile-1.2.0/data/params/fpythia-D0_2001_S4674421.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-D0_2001_S4674421.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-D0_2001_S4674421.params (revision 755)
@@ -0,0 +1,10 @@
+## Pythia config for D0_2001_S4674421 W/Z pT ratio analysis
+MSEL 0
+MSUB(1) 1
+MSUB(2) 1
+
+# ME invariant mass
+CKIN(1) 40
+
+@include fpythia-Zee.params
+@include fpythia-Wenu.params
Index: tags/agile-1.2.0/data/params/fpythia-sd.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-sd.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-sd.params (revision 755)
@@ -0,0 +1,5 @@
+## Switch off all processes
+MSEL 0
+## Switch on single-diffractive events
+MSUB(92) 1
+MSUB(93) 1
Index: tags/agile-1.2.0/data/params/fherwig-atlas-mc09-900.params
===================================================================
--- tags/agile-1.2.0/data/params/fherwig-atlas-mc09-900.params (revision 0)
+++ tags/agile-1.2.0/data/params/fherwig-atlas-mc09-900.params (revision 755)
@@ -0,0 +1,14 @@
+AUTPDF(1) = HWLHAPDF
+AUTPDF(2) = HWLHAPDF
+MODPDF(1) = 20650
+MODPDF(2) = 20650
+
+## Turn on Jimmy as underlying event.
+# JMBUG = 0
+JMUEO = 1
+PRSOF = 0
+MSFLAG = 1
+
+PTMIN = 10.0
+PTJIM = 3.0
+PRRAD = 2.2
Index: tags/agile-1.2.0/data/params/fpythia-longlife-stable.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-longlife-stable.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-longlife-stable.params (revision 755)
@@ -0,0 +1,4 @@
+### This parameter file makes particles with c*tau > 10 mm stable.
+
+MSTJ(22) 2
+PARJ(71) 10.0
Index: tags/agile-1.2.0/data/params/fpythia-CDF_2004_S5839831.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-CDF_2004_S5839831.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-CDF_2004_S5839831.params (revision 755)
@@ -0,0 +1 @@
+## This analysis doesn't require any special settings for Pythia 6
Index: tags/agile-1.2.0/data/params/tevatron1800.params
===================================================================
--- tags/agile-1.2.0/data/params/tevatron1800.params (revision 0)
+++ tags/agile-1.2.0/data/params/tevatron1800.params (revision 755)
@@ -0,0 +1,4 @@
+RG:Beam1 = PROTON
+RG:Beam2 = ANTIPROTON
+RG:Mom1 = 900
+RG:Mom2 = 900
Index: tags/agile-1.2.0/data/params/fpythia-D0_2004_S5992206.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-D0_2004_S5992206.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-D0_2004_S5992206.params (revision 755)
@@ -0,0 +1 @@
+## This analysis doesn't require any special settings for Pythia 6
Index: tags/agile-1.2.0/data/params/lhc7000.params
===================================================================
--- tags/agile-1.2.0/data/params/lhc7000.params (revision 0)
+++ tags/agile-1.2.0/data/params/lhc7000.params (revision 755)
@@ -0,0 +1,4 @@
+RG:Beam1 = PROTON
+RG:Beam2 = PROTON
+RG:Mom1 = 3500
+RG:Mom2 = 3500
Index: tags/agile-1.2.0/data/params/fpythia-D0_2006_S6438750.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-D0_2006_S6438750.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-D0_2006_S6438750.params (revision 755)
@@ -0,0 +1,4 @@
+## This is the set-up for the D0 2008 S7554427 inclusive gamma analysis
+
+# Produce only hard processes with prompt photons
+MSEL 10
Index: tags/agile-1.2.0/data/params/fpythia-zerobias.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-zerobias.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-zerobias.params (revision 755)
@@ -0,0 +1,2 @@
+# Switch on all elastic and min bias QCD processes
+MSEL 2
Index: tags/agile-1.2.0/data/params/fpythia-Wenu.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-Wenu.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-Wenu.params (revision 755)
@@ -0,0 +1,42 @@
+## W+- decays to e nu_e (+ conj) only
+
+# dbar u
+MDME(190,1) 0
+# dbar c
+MDME(191,1) 0
+# dbar t
+MDME(192,1) 0
+# dbar t'
+MDME(193,1) -1
+# sbar u
+MDME(194,1) 0
+# sbar c
+MDME(195,1) 0
+# sbar t
+MDME(196,1) 0
+# sbar t'
+MDME(197,1) -1
+# bbar u
+MDME(198,1) 0
+# bbar c
+MDME(199,1) 0
+# bbar t
+MDME(200,1) 0
+# bbar t'
+MDME(201,1) -1
+# b'bar u
+MDME(202,1) -1
+# b'bar c
+MDME(203,1) -1
+# b'bar t
+MDME(204,1) -1
+# b'bar t'
+MDME(205,1) -1
+# e+ nu_e
+MDME(206,1) 1
+# mu+ nu_mu
+MDME(207,1) 0
+# tau+ nu_tau
+MDME(208,1) 0
+# tau'+ nu'_tau
+MDME(209,1) -1
Index: tags/agile-1.2.0/data/params/fpythia-CDF_2009_S8233977.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-CDF_2009_S8233977.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-CDF_2009_S8233977.params (revision 755)
@@ -0,0 +1,4 @@
+### This parameter file makes particles with c*tau > 10 mm stable.
+
+MSTJ(22) 2
+PARJ(71) 10.0
Index: tags/agile-1.2.0/data/params/fpythia-D0_2008_S7719523.params
===================================================================
--- tags/agile-1.2.0/data/params/fpythia-D0_2008_S7719523.params (revision 0)
+++ tags/agile-1.2.0/data/params/fpythia-D0_2008_S7719523.params (revision 755)
@@ -0,0 +1,7 @@
+## This is the set-up for the D0 2008 S7719523 gamma +jet analysis
+
+# Produce only gamma + jet (q,qbar,g) hard processes
+MSEL 10
+MSUB(14) 1
+MSUB(29) 1
+MSUB(115) 1
Index: tags/agile-1.2.0/data/agile-completion
===================================================================
--- tags/agile-1.2.0/data/agile-completion (revision 0)
+++ tags/agile-1.2.0/data/agile-completion (revision 755)
@@ -0,0 +1,70 @@
+## -*- sh -*-
+## Analysis name completion for agile-runmc
+
+function _agile_runmc() {
+ local cur prev commands options command
+ COMPREPLY=()
+ #cur=`_get_cword`
+ cur="${COMP_WORDS[COMP_CWORD]}"
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
+
+ opts="--help --verbose --quiet --version --list-gens"
+ opts="$opts --list-used-params --out --param --sqrts --beams"
+ opts="$opts --seed --randomize-seed --paramfile --nevts"
+ opts="$opts -h -n -o -p -P -b -s -S -l -Q -V"
+ if [[ ${cur} == -* ]] ; then
+ #if test -x "$(which agile-runmc)"; then
+ # anas=$(agile-runmc --list-options)
+ #fi
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ if test -n "$COMPREPLY"; then
+ return 0
+ fi
+ fi
+
+ beams="LHC PP TEVATRON TVT PPBAR LEP E+E- EE"
+ if [[ ${prev} == -b || ${prev} == --beams ]]; then
+ COMPREPLY=( $(compgen -W "$beams" -- ${cur}) )
+ return 0
+ elif [[ ${cur} == "--beams=" ]] ; then
+ COMPREPLY=( $(compgen -W "$beams" --) )
+ return 0
+ fi
+
+ pfiles=
+ searchpath=".:$AGILE_PARAMS_PATH"
+ if test -x "$(which agile-runmc)"; then
+ prefix=$(dirname $(dirname `which agile-runmc`))
+ if test -d "$prefix"; then
+ searchpath="$searchpath:$prefix/share/RivetGun:$prefix/share/AGILe"
+ fi
+ fi
+ for dir in `echo $searchpath | sed -e "s/:/ /g"`; do
+ if test -d "$dir"; then
+ pfiles="$pfiles `cd $dir && ls`"
+ fi
+ done
+ if [[ ${prev} == -P || ${prev} == --paramfile ]]; then
+ COMPREPLY=( $(compgen -W "$pfiles" -- ${cur}) )
+ return 0
+ elif [[ ${cur} == "--paramfile=" ]] ; then
+ COMPREPLY=( $(compgen -W "$pfiles" --) )
+ return 0
+ fi
+
+ ## Colon-escaping problem workaround
+ COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
+ if test -x "$(which agile-runmc)"; then
+ gens=$(agile-runmc --list-gens)
+ #gens=$(echo $gens | sed -e 's/:/@/g')
+ #echo "&& $cur &&"
+ #echo "&& $gens &&"
+ COMPREPLY=( $(compgen -W "$gens $opts" -- ${cur}) )
+ #echo "&& $COMPREPLY &&"
+ fi
+
+ return 0
+}
+
+default="-o default"
+complete -F _agile_runmc $default agile-runmc
Index: tags/agile-1.2.0/data/Makefile.am
===================================================================
--- tags/agile-1.2.0/data/Makefile.am (revision 0)
+++ tags/agile-1.2.0/data/Makefile.am (revision 755)
@@ -0,0 +1,91 @@
+EXTRA_DIST =
+
+dist_pkgdata_DATA = \
+ params/lep1.params \
+ params/lhc900.params \
+ params/lhc7000.params \
+ params/lhc10000.params \
+ params/lhc14000.params \
+ params/tevatron630.params \
+ params/tevatron1800.params \
+ params/tevatron1960.params \
+ params/rhic-pp200.params \
+ params/hera296.params
+
+dist_pkgdata_DATA += \
+ params/fpythia-atlas.params \
+ params/fpythia-atlas-mc09.params \
+ params/fpythia-atlas-mc09c.params \
+ params/fpythia-atlas-ambt1.params \
+ params/fpythia-aleph.params \
+ params/fpythia-cms-z1.params \
+ params/fpythia-delphi.params \
+ params/fpythia-atlaspdf.params \
+ params/fpythia-Zee.params \
+ params/fpythia-Zmumu.params \
+ params/fpythia-Wenu.params \
+ params/fpythia-default.params \
+ params/fpythia-Zhadronic.params \
+ params/fpythia-Zhadronic-delphi.params \
+ params/fpythia-Zhadronic-aleph.params \
+ params/fpythia-gammajet.params \
+ params/fpythia-longlife-stable.params \
+ params/fpythia-minbias.params \
+ params/fpythia-zerobias.params \
+ params/fpythia-dd.params \
+ params/fpythia-nd.params \
+ params/fpythia-sd.params \
+ params/fpythia-nsd.params
+
+dist_pkgdata_DATA += \
+ params/fpythia-ALEPH_1996_S3196992.params \
+ params/fpythia-CDF_2000_S4155203.params \
+ params/fpythia-CDF_2001_S4751469.params \
+ params/fpythia-CDF_2002_S4796047.params \
+ params/fpythia-CDF_2004_S5839831.params \
+ params/fpythia-CDF_2008_LEADINGJETS.params \
+ params/fpythia-CDF_2008_NOTE_9351.params \
+ params/fpythia-CDF_2009_S8233977.params \
+ params/fpythia-D0_2001_S4674421.params \
+ params/fpythia-D0_2004_S5992206.params \
+ params/fpythia-D0_2006_S6438750.params \
+ params/fpythia-D0_2007_S7075677.params \
+ params/fpythia-D0_2008_S7719523.params \
+ params/fpythia-D0_2008_S7837160.params \
+ params/fpythia-D0_2008_S7554427.params \
+ params/fpythia-D0_2008_S7863608.params
+
+dist_pkgdata_DATA += \
+ params/ccpythia-default.params \
+ params/charybdisher-default.params \
+ params/charybdispyt-default.params \
+ params/falpher-default.params \
+ params/falppyt-default.params
+
+dist_pkgdata_DATA += \
+ params/fherwig-atlas-mc08.params \
+ params/fherwig-atlas-mc09-900.params \
+ params/fherwig-atlas-mc09-7000.params \
+ params/fherwig-atlas-mc09-10000.params \
+ params/fherwig-atlas-mc09-14000.params \
+ params/fherwig-default.params \
+ params/fherwig.qcd.params
+
+
+
+## bash completion
+if ENABLE_PYEXT
+
+dist_pkgdata_DATA += agile-completion
+bashcomp_dir = $(prefix)/etc/bash_completion.d
+install-data-local:
+ if [[ -d "$(bashcomp_dir)" && -w "$(bashcomp_dir)" ]]; then \
+ install --mode 644 agile-completion $(bashcomp_dir)/; fi
+uninstall-local:
+ rm -f $(bashcomp_dir)/agile-completion
+
+else
+
+EXTRA_DIST += agile-completion
+
+endif
Index: tags/agile-1.2.0/data
===================================================================
--- tags/agile-1.2.0/data (revision 754)
+++ tags/agile-1.2.0/data (revision 755)
Property changes on: tags/agile-1.2.0/data
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,2 ##
+Makefile
+Makefile.in
Index: tags/agile-1.2.0/pyext/AGILe.py
===================================================================
--- tags/agile-1.2.0/pyext/AGILe.py (revision 0)
+++ tags/agile-1.2.0/pyext/AGILe.py (revision 755)
@@ -0,0 +1,383 @@
+# This file was automatically generated by SWIG (http://www.swig.org).
+# Version 1.3.40
+#
+# Do not make changes to this file unless you know what you are doing--modify
+# the SWIG interface file instead.
+# This file is compatible with both classic and new-style classes.
+
+from sys import version_info
+if version_info >= (2,6,0):
+ def swig_import_helper():
+ from os.path import dirname
+ import imp
+ fp = None
+ try:
+ fp, pathname, description = imp.find_module('_AGILe', [dirname(__file__)])
+ except ImportError:
+ import _AGILe
+ return _AGILe
+ if fp is not None:
+ try:
+ _mod = imp.load_module('_AGILe', fp, pathname, description)
+ finally:
+ fp.close()
+ return _mod
+ _AGILe = swig_import_helper()
+ del swig_import_helper
+else:
+ import _AGILe
+del version_info
+try:
+ _swig_property = property
+except NameError:
+ pass # Python < 2.2 doesn't have 'property'.
+def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
+ if (name == "thisown"): return self.this.own(value)
+ if (name == "this"):
+ if type(value).__name__ == 'SwigPyObject':
+ self.__dict__[name] = value
+ return
+ method = class_type.__swig_setmethods__.get(name,None)
+ if method: return method(self,value)
+ if (not static) or hasattr(self,name):
+ self.__dict__[name] = value
+ else:
+ raise AttributeError("You cannot add attributes to %s" % self)
+
+def _swig_setattr(self,class_type,name,value):
+ return _swig_setattr_nondynamic(self,class_type,name,value,0)
+
+def _swig_getattr(self,class_type,name):
+ if (name == "thisown"): return self.this.own()
+ method = class_type.__swig_getmethods__.get(name,None)
+ if method: return method(self)
+ raise AttributeError(name)
+
+def _swig_repr(self):
+ try: strthis = "proxy of " + self.this.__repr__()
+ except: strthis = ""
+ return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
+
+try:
+ _object = object
+ _newclass = 1
+except AttributeError:
+ class _object : pass
+ _newclass = 0
+
+
+class SwigPyIterator(_object):
+ __swig_setmethods__ = {}
+ __setattr__ = lambda self, name, value: _swig_setattr(self, SwigPyIterator, name, value)
+ __swig_getmethods__ = {}
+ __getattr__ = lambda self, name: _swig_getattr(self, SwigPyIterator, name)
+ def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
+ __repr__ = _swig_repr
+ __swig_destroy__ = _AGILe.delete_SwigPyIterator
+ __del__ = lambda self : None;
+ def value(self): return _AGILe.SwigPyIterator_value(self)
+ def incr(self, n = 1): return _AGILe.SwigPyIterator_incr(self, n)
+ def decr(self, n = 1): return _AGILe.SwigPyIterator_decr(self, n)
+ def distance(self, *args): return _AGILe.SwigPyIterator_distance(self, *args)
+ def equal(self, *args): return _AGILe.SwigPyIterator_equal(self, *args)
+ def copy(self): return _AGILe.SwigPyIterator_copy(self)
+ def next(self): return _AGILe.SwigPyIterator_next(self)
+ def __next__(self): return _AGILe.SwigPyIterator___next__(self)
+ def previous(self): return _AGILe.SwigPyIterator_previous(self)
+ def advance(self, *args): return _AGILe.SwigPyIterator_advance(self, *args)
+ def __eq__(self, *args): return _AGILe.SwigPyIterator___eq__(self, *args)
+ def __ne__(self, *args): return _AGILe.SwigPyIterator___ne__(self, *args)
+ def __iadd__(self, *args): return _AGILe.SwigPyIterator___iadd__(self, *args)
+ def __isub__(self, *args): return _AGILe.SwigPyIterator___isub__(self, *args)
+ def __add__(self, *args): return _AGILe.SwigPyIterator___add__(self, *args)
+ def __sub__(self, *args): return _AGILe.SwigPyIterator___sub__(self, *args)
+ def __iter__(self): return self
+SwigPyIterator_swigregister = _AGILe.SwigPyIterator_swigregister
+SwigPyIterator_swigregister(SwigPyIterator)
+
+class StrList(_object):
+ __swig_setmethods__ = {}
+ __setattr__ = lambda self, name, value: _swig_setattr(self, StrList, name, value)
+ __swig_getmethods__ = {}
+ __getattr__ = lambda self, name: _swig_getattr(self, StrList, name)
+ __repr__ = _swig_repr
+ def iterator(self): return _AGILe.StrList_iterator(self)
+ def __iter__(self): return self.iterator()
+ def __nonzero__(self): return _AGILe.StrList___nonzero__(self)
+ def __bool__(self): return _AGILe.StrList___bool__(self)
+ def __len__(self): return _AGILe.StrList___len__(self)
+ def pop(self): return _AGILe.StrList_pop(self)
+ def __getslice__(self, *args): return _AGILe.StrList___getslice__(self, *args)
+ def __setslice__(self, *args): return _AGILe.StrList___setslice__(self, *args)
+ def __delslice__(self, *args): return _AGILe.StrList___delslice__(self, *args)
+ def __delitem__(self, *args): return _AGILe.StrList___delitem__(self, *args)
+ def __getitem__(self, *args): return _AGILe.StrList___getitem__(self, *args)
+ def __setitem__(self, *args): return _AGILe.StrList___setitem__(self, *args)
+ def append(self, *args): return _AGILe.StrList_append(self, *args)
+ def empty(self): return _AGILe.StrList_empty(self)
+ def size(self): return _AGILe.StrList_size(self)
+ def clear(self): return _AGILe.StrList_clear(self)
+ def swap(self, *args): return _AGILe.StrList_swap(self, *args)
+ def get_allocator(self): return _AGILe.StrList_get_allocator(self)
+ def begin(self): return _AGILe.StrList_begin(self)
+ def end(self): return _AGILe.StrList_end(self)
+ def rbegin(self): return _AGILe.StrList_rbegin(self)
+ def rend(self): return _AGILe.StrList_rend(self)
+ def pop_back(self): return _AGILe.StrList_pop_back(self)
+ def erase(self, *args): return _AGILe.StrList_erase(self, *args)
+ def __init__(self, *args):
+ this = _AGILe.new_StrList(*args)
+ try: self.this.append(this)
+ except: self.this = this
+ def push_back(self, *args): return _AGILe.StrList_push_back(self, *args)
+ def front(self): return _AGILe.StrList_front(self)
+ def back(self): return _AGILe.StrList_back(self)
+ def assign(self, *args): return _AGILe.StrList_assign(self, *args)
+ def resize(self, *args): return _AGILe.StrList_resize(self, *args)
+ def insert(self, *args): return _AGILe.StrList_insert(self, *args)
+ def reserve(self, *args): return _AGILe.StrList_reserve(self, *args)
+ def capacity(self): return _AGILe.StrList_capacity(self)
+ __swig_destroy__ = _AGILe.delete_StrList
+ __del__ = lambda self : None;
+StrList_swigregister = _AGILe.StrList_swigregister
+StrList_swigregister(StrList)
+
+class LogLevelMap(_object):
+ __swig_setmethods__ = {}
+ __setattr__ = lambda self, name, value: _swig_setattr(self, LogLevelMap, name, value)
+ __swig_getmethods__ = {}
+ __getattr__ = lambda self, name: _swig_getattr(self, LogLevelMap, name)
+ __repr__ = _swig_repr
+ def iterator(self): return _AGILe.LogLevelMap_iterator(self)
+ def __iter__(self): return self.iterator()
+ def __nonzero__(self): return _AGILe.LogLevelMap___nonzero__(self)
+ def __bool__(self): return _AGILe.LogLevelMap___bool__(self)
+ def __len__(self): return _AGILe.LogLevelMap___len__(self)
+ def __getitem__(self, *args): return _AGILe.LogLevelMap___getitem__(self, *args)
+ def __delitem__(self, *args): return _AGILe.LogLevelMap___delitem__(self, *args)
+ def has_key(self, *args): return _AGILe.LogLevelMap_has_key(self, *args)
+ def keys(self): return _AGILe.LogLevelMap_keys(self)
+ def values(self): return _AGILe.LogLevelMap_values(self)
+ def items(self): return _AGILe.LogLevelMap_items(self)
+ def __contains__(self, *args): return _AGILe.LogLevelMap___contains__(self, *args)
+ def key_iterator(self): return _AGILe.LogLevelMap_key_iterator(self)
+ def value_iterator(self): return _AGILe.LogLevelMap_value_iterator(self)
+ def __iter__(self): return self.key_iterator()
+ def iterkeys(self): return self.key_iterator()
+ def itervalues(self): return self.value_iterator()
+ def iteritems(self): return self.iterator()
+ def __setitem__(self, *args): return _AGILe.LogLevelMap___setitem__(self, *args)
+ def __init__(self, *args):
+ this = _AGILe.new_LogLevelMap(*args)
+ try: self.this.append(this)
+ except: self.this = this
+ def empty(self): return _AGILe.LogLevelMap_empty(self)
+ def size(self): return _AGILe.LogLevelMap_size(self)
+ def clear(self): return _AGILe.LogLevelMap_clear(self)
+ def swap(self, *args): return _AGILe.LogLevelMap_swap(self, *args)
+ def get_allocator(self): return _AGILe.LogLevelMap_get_allocator(self)
+ def begin(self): return _AGILe.LogLevelMap_begin(self)
+ def end(self): return _AGILe.LogLevelMap_end(self)
+ def rbegin(self): return _AGILe.LogLevelMap_rbegin(self)
+ def rend(self): return _AGILe.LogLevelMap_rend(self)
+ def count(self, *args): return _AGILe.LogLevelMap_count(self, *args)
+ def erase(self, *args): return _AGILe.LogLevelMap_erase(self, *args)
+ def find(self, *args): return _AGILe.LogLevelMap_find(self, *args)
+ def lower_bound(self, *args): return _AGILe.LogLevelMap_lower_bound(self, *args)
+ def upper_bound(self, *args): return _AGILe.LogLevelMap_upper_bound(self, *args)
+ __swig_destroy__ = _AGILe.delete_LogLevelMap
+ __del__ = lambda self : None;
+LogLevelMap_swigregister = _AGILe.LogLevelMap_swigregister
+LogLevelMap_swigregister(LogLevelMap)
+
+class Log(_object):
+ __swig_setmethods__ = {}
+ __setattr__ = lambda self, name, value: _swig_setattr(self, Log, name, value)
+ __swig_getmethods__ = {}
+ __getattr__ = lambda self, name: _swig_getattr(self, Log, name)
+ def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined")
+ __repr__ = _swig_repr
+ TRACE = _AGILe.Log_TRACE
+ DEBUG = _AGILe.Log_DEBUG
+ INFO = _AGILe.Log_INFO
+ WARN = _AGILe.Log_WARN
+ ERROR = _AGILe.Log_ERROR
+ CRITICAL = _AGILe.Log_CRITICAL
+ ALWAYS = _AGILe.Log_ALWAYS
+ __swig_getmethods__["setLogLevel"] = lambda x: _AGILe.Log_setLogLevel
+ if _newclass:setLogLevel = staticmethod(_AGILe.Log_setLogLevel)
+ __swig_getmethods__["setLevels"] = lambda x: _AGILe.Log_setLevels
+ if _newclass:setLevels = staticmethod(_AGILe.Log_setLevels)
+ __swig_getmethods__["setShowTimestamp"] = lambda x: _AGILe.Log_setShowTimestamp
+ if _newclass:setShowTimestamp = staticmethod(_AGILe.Log_setShowTimestamp)
+ __swig_getmethods__["setShowLevel"] = lambda x: _AGILe.Log_setShowLevel
+ if _newclass:setShowLevel = staticmethod(_AGILe.Log_setShowLevel)
+ __swig_getmethods__["setShowLoggerName"] = lambda x: _AGILe.Log_setShowLoggerName
+ if _newclass:setShowLoggerName = staticmethod(_AGILe.Log_setShowLoggerName)
+ __swig_getmethods__["setUseColors"] = lambda x: _AGILe.Log_setUseColors
+ if _newclass:setUseColors = staticmethod(_AGILe.Log_setUseColors)
+ __swig_getmethods__["getLog"] = lambda x: _AGILe.Log_getLog
+ if _newclass:getLog = staticmethod(_AGILe.Log_getLog)
+ def getLevel(self): return _AGILe.Log_getLevel(self)
+ def setLevel(self, *args): return _AGILe.Log_setLevel(self, *args)
+ __swig_getmethods__["getLevelFromName"] = lambda x: _AGILe.Log_getLevelFromName
+ if _newclass:getLevelFromName = staticmethod(_AGILe.Log_getLevelFromName)
+ __swig_getmethods__["getLevelName"] = lambda x: _AGILe.Log_getLevelName
+ if _newclass:getLevelName = staticmethod(_AGILe.Log_getLevelName)
+ def getName(self): return _AGILe.Log_getName(self)
+ def setName(self, *args): return _AGILe.Log_setName(self, *args)
+ def isActive(self, *args): return _AGILe.Log_isActive(self, *args)
+ def trace(self, *args): return _AGILe.Log_trace(self, *args)
+ def debug(self, *args): return _AGILe.Log_debug(self, *args)
+ def info(self, *args): return _AGILe.Log_info(self, *args)
+ def warn(self, *args): return _AGILe.Log_warn(self, *args)
+ def error(self, *args): return _AGILe.Log_error(self, *args)
+ def always(self, *args): return _AGILe.Log_always(self, *args)
+ __swig_getmethods__["_nostream"] = _AGILe.Log__nostream_get
+ if _newclass:_nostream = _swig_property(_AGILe.Log__nostream_get)
+ __swig_destroy__ = _AGILe.delete_Log
+ __del__ = lambda self : None;
+Log_swigregister = _AGILe.Log_swigregister
+Log_swigregister(Log)
+
+def Log_setLogLevel(*args):
+ return _AGILe.Log_setLogLevel(*args)
+Log_setLogLevel = _AGILe.Log_setLogLevel
+
+def Log_setLevels(*args):
+ return _AGILe.Log_setLevels(*args)
+Log_setLevels = _AGILe.Log_setLevels
+
+def Log_setShowTimestamp(showTime = True):
+ return _AGILe.Log_setShowTimestamp(showTime)
+Log_setShowTimestamp = _AGILe.Log_setShowTimestamp
+
+def Log_setShowLevel(showLevel = True):
+ return _AGILe.Log_setShowLevel(showLevel)
+Log_setShowLevel = _AGILe.Log_setShowLevel
+
+def Log_setShowLoggerName(showName = True):
+ return _AGILe.Log_setShowLoggerName(showName)
+Log_setShowLoggerName = _AGILe.Log_setShowLoggerName
+
+def Log_setUseColors(useColors = True):
+ return _AGILe.Log_setUseColors(useColors)
+Log_setUseColors = _AGILe.Log_setUseColors
+
+def Log_getLog(*args):
+ return _AGILe.Log_getLog(*args)
+Log_getLog = _AGILe.Log_getLog
+
+def Log_getLevelFromName(*args):
+ return _AGILe.Log_getLevelFromName(*args)
+Log_getLevelFromName = _AGILe.Log_getLevelFromName
+
+def Log_getLevelName(*args):
+ return _AGILe.Log_getLevelName(*args)
+Log_getLevelName = _AGILe.Log_getLevelName
+
+
+def __lshift__(*args):
+ return _AGILe.__lshift__(*args)
+__lshift__ = _AGILe.__lshift__
+ELECTRON = _AGILe.ELECTRON
+POSITRON = _AGILe.POSITRON
+PROTON = _AGILe.PROTON
+ANTIPROTON = _AGILe.ANTIPROTON
+PHOTON = _AGILe.PHOTON
+NEUTRON = _AGILe.NEUTRON
+ANTINEUTRON = _AGILe.ANTINEUTRON
+MUON = _AGILe.MUON
+ANTIMUON = _AGILe.ANTIMUON
+NU_E = _AGILe.NU_E
+NU_EBAR = _AGILe.NU_EBAR
+NU_MU = _AGILe.NU_MU
+NU_MUBAR = _AGILe.NU_MUBAR
+NU_TAU = _AGILe.NU_TAU
+NU_TAUBAR = _AGILe.NU_TAUBAR
+PIPLUS = _AGILe.PIPLUS
+PIMINUS = _AGILe.PIMINUS
+TAU = _AGILe.TAU
+ANTITAU = _AGILe.ANTITAU
+EMINUS = _AGILe.EMINUS
+EPLUS = _AGILe.EPLUS
+P = _AGILe.P
+PBAR = _AGILe.PBAR
+GAMMA = _AGILe.GAMMA
+ANY = _AGILe.ANY
+PHOTOELECTRON = _AGILe.PHOTOELECTRON
+PHOTOPOSITRON = _AGILe.PHOTOPOSITRON
+PHOTOMUON = _AGILe.PHOTOMUON
+PHOTOANTIMUON = _AGILe.PHOTOANTIMUON
+PHOTOTAU = _AGILe.PHOTOTAU
+PHOTOANTITAU = _AGILe.PHOTOANTITAU
+class Generator(_object):
+ __swig_setmethods__ = {}
+ __setattr__ = lambda self, name, value: _swig_setattr(self, Generator, name, value)
+ __swig_getmethods__ = {}
+ __getattr__ = lambda self, name: _swig_getattr(self, Generator, name)
+ def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
+ __repr__ = _swig_repr
+ SUCCESS = _AGILe.Generator_SUCCESS
+ FAILURE = _AGILe.Generator_FAILURE
+ __swig_destroy__ = _AGILe.delete_Generator
+ __del__ = lambda self : None;
+ def setInitialState(self, *args): return _AGILe.Generator_setInitialState(self, *args)
+ def getName(self): return _AGILe.Generator_getName(self)
+ def setVersion(self, *args): return _AGILe.Generator_setVersion(self, *args)
+ def getVersion(self): return _AGILe.Generator_getVersion(self)
+ def getPDFSet(self, *args): return _AGILe.Generator_getPDFSet(self, *args)
+ def getPDFMember(self, *args): return _AGILe.Generator_getPDFMember(self, *args)
+ def getPDFScheme(self, *args): return _AGILe.Generator_getPDFScheme(self, *args)
+ def setSeed(self, *args): return _AGILe.Generator_setSeed(self, *args)
+ def setParam(self, *args): return _AGILe.Generator_setParam(self, *args)
+ def makeEvent(self, *args): return _AGILe.Generator_makeEvent(self, *args)
+ def getCrossSection(self): return _AGILe.Generator_getCrossSection(self)
+ def finalize(self): return _AGILe.Generator_finalize(self)
+Generator_swigregister = _AGILe.Generator_swigregister
+Generator_swigregister(Generator)
+
+class Run(_object):
+ __swig_setmethods__ = {}
+ __setattr__ = lambda self, name, value: _swig_setattr(self, Run, name, value)
+ __swig_getmethods__ = {}
+ __getattr__ = lambda self, name: _swig_getattr(self, Run, name)
+ __repr__ = _swig_repr
+ def __init__(self, *args):
+ this = _AGILe.new_Run(*args)
+ try: self.this.append(this)
+ except: self.this = this
+ __swig_destroy__ = _AGILe.delete_Run
+ __del__ = lambda self : None;
+ def doFilter(self, filt = True): return _AGILe.Run_doFilter(self, filt)
+ def makeEvent(self): return _AGILe.Run_makeEvent(self)
+ def eventSummary(self): return _AGILe.Run_eventSummary(self)
+Run_swigregister = _AGILe.Run_swigregister
+Run_swigregister(Run)
+
+
+def initialize():
+ return _AGILe.initialize()
+initialize = _AGILe.initialize
+
+def getAvailableGens():
+ return _AGILe.getAvailableGens()
+getAvailableGens = _AGILe.getAvailableGens
+
+def loadGenLibs(*args):
+ return _AGILe.loadGenLibs(*args)
+loadGenLibs = _AGILe.loadGenLibs
+
+def createGen():
+ return _AGILe.createGen()
+createGen = _AGILe.createGen
+
+def destroyGen(*args):
+ return _AGILe.destroyGen(*args)
+destroyGen = _AGILe.destroyGen
+
+def finalize():
+ return _AGILe.finalize()
+finalize = _AGILe.finalize
+
+
Index: tags/agile-1.2.0/pyext/Makefile.am
===================================================================
--- tags/agile-1.2.0/pyext/Makefile.am (revision 0)
+++ tags/agile-1.2.0/pyext/Makefile.am (revision 755)
@@ -0,0 +1,26 @@
+EXTRA_DIST = ez_setup.py
+
+if ENABLE_PYEXT
+
+SUBDIRS = AGILe .
+
+all-local: AGILe/agilewrap_wrap.cc
+ $(PYTHON) setup.py build
+
+install-exec-local:
+ $(PYTHON) setup.py install --prefix=$(DESTDIR)$(prefix)
+
+## TODO: Really want DESTDIR here?
+uninstall-local:
+ rm -rf $(DESTDIR)$(AGILE_PYTHONPATH)/*AGILe*
+
+clean-local:
+ $(PYTHON) setup.py clean --all
+ @rm -f $(top_builddir)/*.pyc
+ @rm -rf $(builddir)/build
+ @rm -rf dist
+
+distclean-local:
+ @rm -rf AGILe.egg-info
+
+endif
Index: tags/agile-1.2.0/pyext/setup.py.in
===================================================================
--- tags/agile-1.2.0/pyext/setup.py.in (revision 0)
+++ tags/agile-1.2.0/pyext/setup.py.in (revision 755)
@@ -0,0 +1,33 @@
+#! /usr/bin/env python
+
+"""This is a simple SWIG wrapper on the main steering interface of the AGILe
+event generator interface library.
+"""
+
+from distutils.core import setup, Extension
+
+## Extension definition
+import os
+incdir = os.path.abspath('@top_srcdir@/include')
+srcdir = os.path.abspath('@top_srcdir@/src/')
+ext = Extension('_agilewrap',
+ ['@srcdir@/AGILe/agilewrap_wrap.cc'],
+ define_macros = [("SWIG_TYPE_TABLE", "hepmccompat")],
+ include_dirs=['@HEPMCINCPATH@', '@BOOSTINCPATH@', incdir],
+ library_dirs=['@HEPMCLIBPATH@', srcdir, os.path.join(srcdir,'.libs')],
+ libraries=['HepMC', 'AGILe'])
+
+## Setup definition
+setup(name = 'AGILe',
+ version = '@PACKAGE_VERSION@',
+ ext_package = 'AGILe',
+ ext_modules = [ext],
+ py_modules = ['AGILe.__init__', 'AGILe.agilewrap'],
+ author = ['Andy Buckley'],
+ author_email = 'andy.buckley@cern.ch',
+ url = 'http://projects.hepforge.org/agile/',
+ description = 'A Python interface to the AGILe high-energy physics event generator interface library.',
+ long_description = __doc__,
+ keywords = 'generator montecarlo simulation data hep physics particle validation analysis tuning',
+ license = 'GPL',
+ )
Property changes on: tags/agile-1.2.0/pyext/setup.py.in
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: tags/agile-1.2.0/pyext/AGILe_wrap.cc
===================================================================
--- tags/agile-1.2.0/pyext/AGILe_wrap.cc (revision 0)
+++ tags/agile-1.2.0/pyext/AGILe_wrap.cc (revision 755)
@@ -0,0 +1,11866 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.40
+ *
+ * This file is not intended to be easily readable and contains a number of
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+#define SWIGPYTHON
+#define SWIG_PYTHON_DIRECTOR_NO_VTABLE
+
+
+#ifdef __cplusplus
+/* SwigValueWrapper is described in swig.swg */
+template<typename T> class SwigValueWrapper {
+ struct SwigMovePointer {
+ T *ptr;
+ SwigMovePointer(T *p) : ptr(p) { }
+ ~SwigMovePointer() { delete ptr; }
+ SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
+ } pointer;
+ SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+ SwigValueWrapper(const SwigValueWrapper<T>& rhs);
+public:
+ SwigValueWrapper() : pointer(0) { }
+ SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
+ operator T&() const { return *pointer.ptr; }
+ T *operator&() { return pointer.ptr; }
+};
+
+template <typename T> T SwigValueInit() {
+ return T();
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ * This section contains generic SWIG labels for method/variable
+ * declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+# define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+# define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+# define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+# define SWIGINLINE inline
+# else
+# define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define SWIGUNUSED __attribute__ ((__unused__))
+# else
+# define SWIGUNUSED
+# endif
+# elif defined(__ICC)
+# define SWIGUNUSED __attribute__ ((__unused__))
+# else
+# define SWIGUNUSED
+# endif
+#endif
+
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+# pragma warning(disable : 4505) /* unreferenced local function has been removed */
+# endif
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+# define SWIGUNUSEDPARM(p)
+# else
+# define SWIGUNUSEDPARM(p) p SWIGUNUSED
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+# ifndef GCC_HASCLASSVISIBILITY
+# define GCC_HASCLASSVISIBILITY
+# endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+# if defined(STATIC_LINKED)
+# define SWIGEXPORT
+# else
+# define SWIGEXPORT __declspec(dllexport)
+# endif
+# else
+# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+# define SWIGEXPORT __attribute__ ((visibility("default")))
+# else
+# define SWIGEXPORT
+# endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+# define SWIGSTDCALL __stdcall
+# else
+# define SWIGSTDCALL
+# endif
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+
+/* Python.h has to appear first */
+#include <Python.h>
+
+/* -----------------------------------------------------------------------------
+ * swigrun.swg
+ *
+ * This file contains generic C API SWIG runtime support for pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+/* This should only be incremented when either the layout of swig_type_info changes,
+ or for whatever reason, the runtime changes incompatibly */
+#define SWIG_RUNTIME_VERSION "4"
+
+/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
+#ifdef SWIG_TYPE_TABLE
+# define SWIG_QUOTE_STRING(x) #x
+# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
+# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
+#else
+# define SWIG_TYPE_TABLE_NAME
+#endif
+
+/*
+ You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
+ creating a static or dynamic library from the SWIG runtime code.
+ In 99.9% of the cases, SWIG just needs to declare them as 'static'.
+
+ But only do this if strictly necessary, ie, if you have problems
+ with your compiler or suchlike.
+*/
+
+#ifndef SWIGRUNTIME
+# define SWIGRUNTIME SWIGINTERN
+#endif
+
+#ifndef SWIGRUNTIMEINLINE
+# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
+#endif
+
+/* Generic buffer size */
+#ifndef SWIG_BUFFER_SIZE
+# define SWIG_BUFFER_SIZE 1024
+#endif
+
+/* Flags for pointer conversions */
+#define SWIG_POINTER_DISOWN 0x1
+#define SWIG_CAST_NEW_MEMORY 0x2
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_OWN 0x1
+
+
+/*
+ Flags/methods for returning states.
+
+ The SWIG conversion methods, as ConvertPtr, return and integer
+ that tells if the conversion was successful or not. And if not,
+ an error code can be returned (see swigerrors.swg for the codes).
+
+ Use the following macros/flags to set or process the returning
+ states.
+
+ In old versions of SWIG, code such as the following was usually written:
+
+ if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
+ // success code
+ } else {
+ //fail code
+ }
+
+ Now you can be more explicit:
+
+ int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
+ if (SWIG_IsOK(res)) {
+ // success code
+ } else {
+ // fail code
+ }
+
+ which is the same really, but now you can also do
+
+ Type *ptr;
+ int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
+ if (SWIG_IsOK(res)) {
+ // success code
+ if (SWIG_IsNewObj(res) {
+ ...
+ delete *ptr;
+ } else {
+ ...
+ }
+ } else {
+ // fail code
+ }
+
+ I.e., now SWIG_ConvertPtr can return new objects and you can
+ identify the case and take care of the deallocation. Of course that
+ also requires SWIG_ConvertPtr to return new result values, such as
+
+ int SWIG_ConvertPtr(obj, ptr,...) {
+ if (<obj is ok>) {
+ if (<need new object>) {
+ *ptr = <ptr to new allocated object>;
+ return SWIG_NEWOBJ;
+ } else {
+ *ptr = <ptr to old object>;
+ return SWIG_OLDOBJ;
+ }
+ } else {
+ return SWIG_BADOBJ;
+ }
+ }
+
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
+ SWIG errors code.
+
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
+ allows to return the 'cast rank', for example, if you have this
+
+ int food(double)
+ int fooi(int);
+
+ and you call
+
+ food(1) // cast rank '1' (1 -> 1.0)
+ fooi(1) // cast rank '0'
+
+ just use the SWIG_AddCast()/SWIG_CheckState()
+*/
+
+#define SWIG_OK (0)
+#define SWIG_ERROR (-1)
+#define SWIG_IsOK(r) (r >= 0)
+#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
+
+/* The CastRankLimit says how many bits are used for the cast rank */
+#define SWIG_CASTRANKLIMIT (1 << 8)
+/* The NewMask denotes the object was created (using new/malloc) */
+#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
+/* The TmpMask is for in/out typemaps that use temporal objects */
+#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
+/* Simple returning values */
+#define SWIG_BADOBJ (SWIG_ERROR)
+#define SWIG_OLDOBJ (SWIG_OK)
+#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
+#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
+/* Check, add and del mask methods */
+#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
+#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
+#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
+#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
+#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
+#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
+
+/* Cast-Rank Mode */
+#if defined(SWIG_CASTRANK_MODE)
+# ifndef SWIG_TypeRank
+# define SWIG_TypeRank unsigned long
+# endif
+# ifndef SWIG_MAXCASTRANK /* Default cast allowed */
+# define SWIG_MAXCASTRANK (2)
+# endif
+# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
+# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
+SWIGINTERNINLINE int SWIG_AddCast(int r) {
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+}
+SWIGINTERNINLINE int SWIG_CheckState(int r) {
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
+}
+#else /* no cast-rank mode */
+# define SWIG_AddCast
+# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
+#endif
+
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *(*swig_converter_func)(void *, int *);
+typedef struct swig_type_info *(*swig_dycast_func)(void **);
+
+/* Structure to store information on one type */
+typedef struct swig_type_info {
+ const char *name; /* mangled name of this type */
+ const char *str; /* human readable name of this type */
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
+ void *clientdata; /* language specific type data */
+ int owndata; /* flag if the structure owns the clientdata */
+} swig_type_info;
+
+/* Structure to store a type and conversion function used for casting */
+typedef struct swig_cast_info {
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
+ swig_converter_func converter; /* function to cast the void pointers */
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
+ struct swig_cast_info *prev; /* pointer to the previous cast */
+} swig_cast_info;
+
+/* Structure used to store module information
+ * Each module generates one structure like this, and the runtime collects
+ * all of these structures and stores them in a circularly linked list.*/
+typedef struct swig_module_info {
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
+ size_t size; /* Number of types in this module */
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
+ swig_type_info **type_initial; /* Array of initially generated type structures */
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
+ void *clientdata; /* Language specific module data */
+} swig_module_info;
+
+/*
+ Compare two type names skipping the space characters, therefore
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
+
+ Return 0 when the two name types are equivalent, as in
+ strncmp, but skipping ' '.
+*/
+SWIGRUNTIME int
+SWIG_TypeNameComp(const char *f1, const char *l1,
+ const char *f2, const char *l2) {
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
+ }
+ return (int)((l1 - f1) - (l2 - f2));
+}
+
+/*
+ Check type equivalence in a name list like <name1>|<name2>|...
+ Return 0 if not equal, 1 if equal
+*/
+SWIGRUNTIME int
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+ int equiv = 0;
+ const char* te = tb + strlen(tb);
+ const char* ne = nb;
+ while (!equiv && *ne) {
+ for (nb = ne; *ne; ++ne) {
+ if (*ne == '|') break;
+ }
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+ if (*ne) ++ne;
+ }
+ return equiv;
+}
+
+/*
+ Check type equivalence in a name list like <name1>|<name2>|...
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+*/
+SWIGRUNTIME int
+SWIG_TypeCompare(const char *nb, const char *tb) {
+ int equiv = 0;
+ const char* te = tb + strlen(tb);
+ const char* ne = nb;
+ while (!equiv && *ne) {
+ for (nb = ne; *ne; ++ne) {
+ if (*ne == '|') break;
+ }
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+ if (*ne) ++ne;
+ }
+ return equiv;
+}
+
+
+/*
+ Check the typename
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheck(const char *c, swig_type_info *ty) {
+ if (ty) {
+ swig_cast_info *iter = ty->cast;
+ while (iter) {
+ if (strcmp(iter->type->name, c) == 0) {
+ if (iter == ty->cast)
+ return iter;
+ /* Move iter to the top of the linked list */
+ iter->prev->next = iter->next;
+ if (iter->next)
+ iter->next->prev = iter->prev;
+ iter->next = ty->cast;
+ iter->prev = 0;
+ if (ty->cast) ty->cast->prev = iter;
+ ty->cast = iter;
+ return iter;
+ }
+ iter = iter->next;
+ }
+ }
+ return 0;
+}
+
+/*
+ Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
+ if (ty) {
+ swig_cast_info *iter = ty->cast;
+ while (iter) {
+ if (iter->type == from) {
+ if (iter == ty->cast)
+ return iter;
+ /* Move iter to the top of the linked list */
+ iter->prev->next = iter->next;
+ if (iter->next)
+ iter->next->prev = iter->prev;
+ iter->next = ty->cast;
+ iter->prev = 0;
+ if (ty->cast) ty->cast->prev = iter;
+ ty->cast = iter;
+ return iter;
+ }
+ iter = iter->next;
+ }
+ }
+ return 0;
+}
+
+/*
+ Cast a pointer up an inheritance hierarchy
+*/
+SWIGRUNTIMEINLINE void *
+SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
+}
+
+/*
+ Dynamic pointer casting. Down an inheritance hierarchy
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
+ swig_type_info *lastty = ty;
+ if (!ty || !ty->dcast) return ty;
+ while (ty && (ty->dcast)) {
+ ty = (*ty->dcast)(ptr);
+ if (ty) lastty = ty;
+ }
+ return lastty;
+}
+
+/*
+ Return the name associated with this type
+*/
+SWIGRUNTIMEINLINE const char *
+SWIG_TypeName(const swig_type_info *ty) {
+ return ty->name;
+}
+
+/*
+ Return the pretty name associated with this type,
+ that is an unmangled type name in a form presentable to the user.
+*/
+SWIGRUNTIME const char *
+SWIG_TypePrettyName(const swig_type_info *type) {
+ /* The "str" field contains the equivalent pretty names of the
+ type, separated by vertical-bar characters. We choose
+ to print the last name, as it is often (?) the most
+ specific. */
+ if (!type) return NULL;
+ if (type->str != NULL) {
+ const char *last_name = type->str;
+ const char *s;
+ for (s = type->str; *s; s++)
+ if (*s == '|') last_name = s+1;
+ return last_name;
+ }
+ else
+ return type->name;
+}
+
+/*
+ Set the clientdata field for a type
+*/
+SWIGRUNTIME void
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
+ swig_cast_info *cast = ti->cast;
+ /* if (ti->clientdata == clientdata) return; */
+ ti->clientdata = clientdata;
+
+ while (cast) {
+ if (!cast->converter) {
+ swig_type_info *tc = cast->type;
+ if (!tc->clientdata) {
+ SWIG_TypeClientData(tc, clientdata);
+ }
+ }
+ cast = cast->next;
+ }
+}
+SWIGRUNTIME void
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
+ SWIG_TypeClientData(ti, clientdata);
+ ti->owndata = 1;
+}
+
+/*
+ Search for a swig_type_info structure only by mangled name
+ Search is a O(log #types)
+
+ We start searching at module start, and finish searching when start == end.
+ Note: if start == end at the beginning of the function, we go all the way around
+ the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_MangledTypeQueryModule(swig_module_info *start,
+ swig_module_info *end,
+ const char *name) {
+ swig_module_info *iter = start;
+ do {
+ if (iter->size) {
+ register size_t l = 0;
+ register size_t r = iter->size - 1;
+ do {
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
+ register size_t i = (l + r) >> 1;
+ const char *iname = iter->types[i]->name;
+ if (iname) {
+ register int compare = strcmp(name, iname);
+ if (compare == 0) {
+ return iter->types[i];
+ } else if (compare < 0) {
+ if (i) {
+ r = i - 1;
+ } else {
+ break;
+ }
+ } else if (compare > 0) {
+ l = i + 1;
+ }
+ } else {
+ break; /* should never happen */
+ }
+ } while (l <= r);
+ }
+ iter = iter->next;
+ } while (iter != end);
+ return 0;
+}
+
+/*
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
+ It first searches the mangled names of the types, which is a O(log #types)
+ If a type is not found it then searches the human readable names, which is O(#types).
+
+ We start searching at module start, and finish searching when start == end.
+ Note: if start == end at the beginning of the function, we go all the way around
+ the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeQueryModule(swig_module_info *start,
+ swig_module_info *end,
+ const char *name) {
+ /* STEP 1: Search the name field using binary search */
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+ if (ret) {
+ return ret;
+ } else {
+ /* STEP 2: If the type hasn't been found, do a complete search
+ of the str field (the human readable name) */
+ swig_module_info *iter = start;
+ do {
+ register size_t i = 0;
+ for (; i < iter->size; ++i) {
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
+ return iter->types[i];
+ }
+ iter = iter->next;
+ } while (iter != end);
+ }
+
+ /* neither found a match */
+ return 0;
+}
+
+/*
+ Pack binary data into a string
+*/
+SWIGRUNTIME char *
+SWIG_PackData(char *c, void *ptr, size_t sz) {
+ static const char hex[17] = "0123456789abcdef";
+ register const unsigned char *u = (unsigned char *) ptr;
+ register const unsigned char *eu = u + sz;
+ for (; u != eu; ++u) {
+ register unsigned char uu = *u;
+ *(c++) = hex[(uu & 0xf0) >> 4];
+ *(c++) = hex[uu & 0xf];
+ }
+ return c;
+}
+
+/*
+ Unpack binary data from a string
+*/
+SWIGRUNTIME const char *
+SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
+ register unsigned char *u = (unsigned char *) ptr;
+ register const unsigned char *eu = u + sz;
+ for (; u != eu; ++u) {
+ register char d = *(c++);
+ register unsigned char uu;
+ if ((d >= '0') && (d <= '9'))
+ uu = ((d - '0') << 4);
+ else if ((d >= 'a') && (d <= 'f'))
+ uu = ((d - ('a'-10)) << 4);
+ else
+ return (char *) 0;
+ d = *(c++);
+ if ((d >= '0') && (d <= '9'))
+ uu |= (d - '0');
+ else if ((d >= 'a') && (d <= 'f'))
+ uu |= (d - ('a'-10));
+ else
+ return (char *) 0;
+ *u = uu;
+ }
+ return c;
+}
+
+/*
+ Pack 'void *' into a string buffer.
+*/
+SWIGRUNTIME char *
+SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
+ char *r = buff;
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
+ *(r++) = '_';
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
+ if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
+ strcpy(r,name);
+ return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
+ if (*c != '_') {
+ if (strcmp(c,"NULL") == 0) {
+ *ptr = (void *) 0;
+ return name;
+ } else {
+ return 0;
+ }
+ }
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
+}
+
+SWIGRUNTIME char *
+SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
+ char *r = buff;
+ size_t lname = (name ? strlen(name) : 0);
+ if ((2*sz + 2 + lname) > bsz) return 0;
+ *(r++) = '_';
+ r = SWIG_PackData(r,ptr,sz);
+ if (lname) {
+ strncpy(r,name,lname+1);
+ } else {
+ *r = 0;
+ }
+ return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
+ if (*c != '_') {
+ if (strcmp(c,"NULL") == 0) {
+ memset(ptr,0,sz);
+ return name;
+ } else {
+ return 0;
+ }
+ }
+ return SWIG_UnpackData(++c,ptr,sz);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Errors in SWIG */
+#define SWIG_UnknownError -1
+#define SWIG_IOError -2
+#define SWIG_RuntimeError -3
+#define SWIG_IndexError -4
+#define SWIG_TypeError -5
+#define SWIG_DivisionByZero -6
+#define SWIG_OverflowError -7
+#define SWIG_SyntaxError -8
+#define SWIG_ValueError -9
+#define SWIG_SystemError -10
+#define SWIG_AttributeError -11
+#define SWIG_MemoryError -12
+#define SWIG_NullReferenceError -13
+
+
+
+/* Compatibility macros for Python 3 */
+#if PY_VERSION_HEX >= 0x03000000
+
+#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
+#define PyInt_Check(x) PyLong_Check(x)
+#define PyInt_AsLong(x) PyLong_AsLong(x)
+#define PyInt_FromLong(x) PyLong_FromLong(x)
+#define PyString_Format(fmt, args) PyUnicode_Format(fmt, args)
+
+#endif
+
+#ifndef Py_TYPE
+# define Py_TYPE(op) ((op)->ob_type)
+#endif
+
+/* SWIG APIs for compatibility of both Python 2 & 3 */
+
+#if PY_VERSION_HEX >= 0x03000000
+# define SWIG_Python_str_FromFormat PyUnicode_FromFormat
+#else
+# define SWIG_Python_str_FromFormat PyString_FromFormat
+#endif
+
+
+/* Warning: This function will allocate a new string in Python 3,
+ * so please call SWIG_Python_str_DelForPy3(x) to free the space.
+ */
+SWIGINTERN char*
+SWIG_Python_str_AsChar(PyObject *str)
+{
+#if PY_VERSION_HEX >= 0x03000000
+ char *cstr;
+ char *newstr;
+ Py_ssize_t len;
+ str = PyUnicode_AsUTF8String(str);
+ PyBytes_AsStringAndSize(str, &cstr, &len);
+ newstr = (char *) malloc(len+1);
+ memcpy(newstr, cstr, len+1);
+ Py_XDECREF(str);
+ return newstr;
+#else
+ return PyString_AsString(str);
+#endif
+}
+
+#if PY_VERSION_HEX >= 0x03000000
+# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
+#else
+# define SWIG_Python_str_DelForPy3(x)
+#endif
+
+
+SWIGINTERN PyObject*
+SWIG_Python_str_FromChar(const char *c)
+{
+#if PY_VERSION_HEX >= 0x03000000
+ return PyUnicode_FromString(c);
+#else
+ return PyString_FromString(c);
+#endif
+}
+
+/* Add PyOS_snprintf for old Pythons */
+#if PY_VERSION_HEX < 0x02020000
+# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
+# define PyOS_snprintf _snprintf
+# else
+# define PyOS_snprintf snprintf
+# endif
+#endif
+
+/* A crude PyString_FromFormat implementation for old Pythons */
+#if PY_VERSION_HEX < 0x02020000
+
+#ifndef SWIG_PYBUFFER_SIZE
+# define SWIG_PYBUFFER_SIZE 1024
+#endif
+
+static PyObject *
+PyString_FromFormat(const char *fmt, ...) {
+ va_list ap;
+ char buf[SWIG_PYBUFFER_SIZE * 2];
+ int res;
+ va_start(ap, fmt);
+ res = vsnprintf(buf, sizeof(buf), fmt, ap);
+ va_end(ap);
+ return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
+}
+#endif
+
+/* Add PyObject_Del for old Pythons */
+#if PY_VERSION_HEX < 0x01060000
+# define PyObject_Del(op) PyMem_DEL((op))
+#endif
+#ifndef PyObject_DEL
+# define PyObject_DEL PyObject_Del
+#endif
+
+/* A crude PyExc_StopIteration exception for old Pythons */
+#if PY_VERSION_HEX < 0x02020000
+# ifndef PyExc_StopIteration
+# define PyExc_StopIteration PyExc_RuntimeError
+# endif
+# ifndef PyObject_GenericGetAttr
+# define PyObject_GenericGetAttr 0
+# endif
+#endif
+
+/* Py_NotImplemented is defined in 2.1 and up. */
+#if PY_VERSION_HEX < 0x02010000
+# ifndef Py_NotImplemented
+# define Py_NotImplemented PyExc_RuntimeError
+# endif
+#endif
+
+/* A crude PyString_AsStringAndSize implementation for old Pythons */
+#if PY_VERSION_HEX < 0x02010000
+# ifndef PyString_AsStringAndSize
+# define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
+# endif
+#endif
+
+/* PySequence_Size for old Pythons */
+#if PY_VERSION_HEX < 0x02000000
+# ifndef PySequence_Size
+# define PySequence_Size PySequence_Length
+# endif
+#endif
+
+/* PyBool_FromLong for old Pythons */
+#if PY_VERSION_HEX < 0x02030000
+static
+PyObject *PyBool_FromLong(long ok)
+{
+ PyObject *result = ok ? Py_True : Py_False;
+ Py_INCREF(result);
+ return result;
+}
+#endif
+
+/* Py_ssize_t for old Pythons */
+/* This code is as recommended by: */
+/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+typedef int Py_ssize_t;
+# define PY_SSIZE_T_MAX INT_MAX
+# define PY_SSIZE_T_MIN INT_MIN
+#endif
+
+/* -----------------------------------------------------------------------------
+ * error manipulation
+ * ----------------------------------------------------------------------------- */
+
+SWIGRUNTIME PyObject*
+SWIG_Python_ErrorType(int code) {
+ PyObject* type = 0;
+ switch(code) {
+ case SWIG_MemoryError:
+ type = PyExc_MemoryError;
+ break;
+ case SWIG_IOError:
+ type = PyExc_IOError;
+ break;
+ case SWIG_RuntimeError:
+ type = PyExc_RuntimeError;
+ break;
+ case SWIG_IndexError:
+ type = PyExc_IndexError;
+ break;
+ case SWIG_TypeError:
+ type = PyExc_TypeError;
+ break;
+ case SWIG_DivisionByZero:
+ type = PyExc_ZeroDivisionError;
+ break;
+ case SWIG_OverflowError:
+ type = PyExc_OverflowError;
+ break;
+ case SWIG_SyntaxError:
+ type = PyExc_SyntaxError;
+ break;
+ case SWIG_ValueError:
+ type = PyExc_ValueError;
+ break;
+ case SWIG_SystemError:
+ type = PyExc_SystemError;
+ break;
+ case SWIG_AttributeError:
+ type = PyExc_AttributeError;
+ break;
+ default:
+ type = PyExc_RuntimeError;
+ }
+ return type;
+}
+
+
+SWIGRUNTIME void
+SWIG_Python_AddErrorMsg(const char* mesg)
+{
+ PyObject *type = 0;
+ PyObject *value = 0;
+ PyObject *traceback = 0;
+
+ if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
+ if (value) {
+ char *tmp;
+ PyObject *old_str = PyObject_Str(value);
+ PyErr_Clear();
+ Py_XINCREF(type);
+
+ PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
+ SWIG_Python_str_DelForPy3(tmp);
+ Py_DECREF(old_str);
+ Py_DECREF(value);
+ } else {
+ PyErr_SetString(PyExc_RuntimeError, mesg);
+ }
+}
+
+#if defined(SWIG_PYTHON_NO_THREADS)
+# if defined(SWIG_PYTHON_THREADS)
+# undef SWIG_PYTHON_THREADS
+# endif
+#endif
+#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
+# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
+# if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
+# define SWIG_PYTHON_USE_GIL
+# endif
+# endif
+# if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
+# ifndef SWIG_PYTHON_INITIALIZE_THREADS
+# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads()
+# endif
+# ifdef __cplusplus /* C++ code */
+ class SWIG_Python_Thread_Block {
+ bool status;
+ PyGILState_STATE state;
+ public:
+ void end() { if (status) { PyGILState_Release(state); status = false;} }
+ SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
+ ~SWIG_Python_Thread_Block() { end(); }
+ };
+ class SWIG_Python_Thread_Allow {
+ bool status;
+ PyThreadState *save;
+ public:
+ void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
+ SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
+ ~SWIG_Python_Thread_Allow() { end(); }
+ };
+# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block
+# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end()
+# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow
+# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end()
+# else /* C code */
+# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
+# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block)
+# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread()
+# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow)
+# endif
+# else /* Old thread way, not implemented, user must provide it */
+# if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
+# define SWIG_PYTHON_INITIALIZE_THREADS
+# endif
+# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
+# define SWIG_PYTHON_THREAD_BEGIN_BLOCK
+# endif
+# if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
+# define SWIG_PYTHON_THREAD_END_BLOCK
+# endif
+# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
+# define SWIG_PYTHON_THREAD_BEGIN_ALLOW
+# endif
+# if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
+# define SWIG_PYTHON_THREAD_END_ALLOW
+# endif
+# endif
+#else /* No thread support */
+# define SWIG_PYTHON_INITIALIZE_THREADS
+# define SWIG_PYTHON_THREAD_BEGIN_BLOCK
+# define SWIG_PYTHON_THREAD_END_BLOCK
+# define SWIG_PYTHON_THREAD_BEGIN_ALLOW
+# define SWIG_PYTHON_THREAD_END_ALLOW
+#endif
+
+/* -----------------------------------------------------------------------------
+ * Python API portion that goes into the runtime
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* cc-mode */
+#endif
+#endif
+
+/* -----------------------------------------------------------------------------
+ * Constant declarations
+ * ----------------------------------------------------------------------------- */
+
+/* Constant Types */
+#define SWIG_PY_POINTER 4
+#define SWIG_PY_BINARY 5
+
+/* Constant information structure */
+typedef struct swig_const_info {
+ int type;
+ char *name;
+ long lvalue;
+ double dvalue;
+ void *pvalue;
+ swig_type_info **ptype;
+} swig_const_info;
+
+
+/* -----------------------------------------------------------------------------
+ * Wrapper of PyInstanceMethod_New() used in Python 3
+ * It is exported to the generated module, used for -fastproxy
+ * ----------------------------------------------------------------------------- */
+SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func)
+{
+#if PY_VERSION_HEX >= 0x03000000
+ return PyInstanceMethod_New(func);
+#else
+ return NULL;
+#endif
+}
+
+#ifdef __cplusplus
+#if 0
+{ /* cc-mode */
+#endif
+}
+#endif
+
+
+/* -----------------------------------------------------------------------------
+ * See the LICENSE file for information on copyright, usage and redistribution
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
+ *
+ * pyrun.swg
+ *
+ * This file contains the runtime support for Python modules
+ * and includes code for managing global variables and pointer
+ * type checking.
+ *
+ * ----------------------------------------------------------------------------- */
+
+/* Common SWIG API */
+
+/* for raw pointers */
+#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
+#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
+#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(ptr, type, flags)
+#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty)
+#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src)
+#define swig_owntype int
+
+/* for raw packed data */
+#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
+
+/* for class or struct pointers */
+#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
+
+/* for C or C++ function pointers */
+#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
+#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(ptr, type, 0)
+
+/* for C++ member pointers, ie, member methods */
+#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
+
+
+/* Runtime API */
+
+#define SWIG_GetModule(clientdata) SWIG_Python_GetModule()
+#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
+#define SWIG_NewClientData(obj) SwigPyClientData_New(obj)
+
+#define SWIG_SetErrorObj SWIG_Python_SetErrorObj
+#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
+#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
+#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
+#define SWIG_fail goto fail
+
+
+/* Runtime API implementation */
+
+/* Error manipulation */
+
+SWIGINTERN void
+SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
+ SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+ PyErr_SetObject(errtype, obj);
+ Py_DECREF(obj);
+ SWIG_PYTHON_THREAD_END_BLOCK;
+}
+
+SWIGINTERN void
+SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
+ SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+ PyErr_SetString(errtype, (char *) msg);
+ SWIG_PYTHON_THREAD_END_BLOCK;
+}
+
+#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
+
+/* Set a constant value */
+
+SWIGINTERN void
+SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
+ PyDict_SetItemString(d, (char*) name, obj);
+ Py_DECREF(obj);
+}
+
+/* Append a value to the result obj */
+
+SWIGINTERN PyObject*
+SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
+#if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
+ if (!result) {
+ result = obj;
+ } else if (result == Py_None) {
+ Py_DECREF(result);
+ result = obj;
+ } else {
+ if (!PyList_Check(result)) {
+ PyObject *o2 = result;
+ result = PyList_New(1);
+ PyList_SetItem(result, 0, o2);
+ }
+ PyList_Append(result,obj);
+ Py_DECREF(obj);
+ }
+ return result;
+#else
+ PyObject* o2;
+ PyObject* o3;
+ if (!result) {
+ result = obj;
+ } else if (result == Py_None) {
+ Py_DECREF(result);
+ result = obj;
+ } else {
+ if (!PyTuple_Check(result)) {
+ o2 = result;
+ result = PyTuple_New(1);
+ PyTuple_SET_ITEM(result, 0, o2);
+ }
+ o3 = PyTuple_New(1);
+ PyTuple_SET_ITEM(o3, 0, obj);
+ o2 = result;
+ result = PySequence_Concat(o2, o3);
+ Py_DECREF(o2);
+ Py_DECREF(o3);
+ }
+ return result;
+#endif
+}
+
+/* Unpack the argument tuple */
+
+SWIGINTERN int
+SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
+{
+ if (!args) {
+ if (!min && !max) {
+ return 1;
+ } else {
+ PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
+ name, (min == max ? "" : "at least "), (int)min);
+ return 0;
+ }
+ }
+ if (!PyTuple_Check(args)) {
+ PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
+ return 0;
+ } else {
+ register Py_ssize_t l = PyTuple_GET_SIZE(args);
+ if (l < min) {
+ PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
+ name, (min == max ? "" : "at least "), (int)min, (int)l);
+ return 0;
+ } else if (l > max) {
+ PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
+ name, (min == max ? "" : "at most "), (int)max, (int)l);
+ return 0;
+ } else {
+ register int i;
+ for (i = 0; i < l; ++i) {
+ objs[i] = PyTuple_GET_ITEM(args, i);
+ }
+ for (; l < max; ++l) {
+ objs[l] = 0;
+ }
+ return i + 1;
+ }
+ }
+}
+
+/* A functor is a function object with one single object argument */
+#if PY_VERSION_HEX >= 0x02020000
+#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL);
+#else
+#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj);
+#endif
+
+/*
+ Helper for static pointer initialization for both C and C++ code, for example
+ static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
+*/
+#ifdef __cplusplus
+#define SWIG_STATIC_POINTER(var) var
+#else
+#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var
+#endif
+
+/* -----------------------------------------------------------------------------
+ * Pointer declarations
+ * ----------------------------------------------------------------------------- */
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1)
+#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
+
+#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1)
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* cc-mode */
+#endif
+#endif
+
+/* How to access Py_None */
+#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+# ifndef SWIG_PYTHON_NO_BUILD_NONE
+# ifndef SWIG_PYTHON_BUILD_NONE
+# define SWIG_PYTHON_BUILD_NONE
+# endif
+# endif
+#endif
+
+#ifdef SWIG_PYTHON_BUILD_NONE
+# ifdef Py_None
+# undef Py_None
+# define Py_None SWIG_Py_None()
+# endif
+SWIGRUNTIMEINLINE PyObject *
+_SWIG_Py_None(void)
+{
+ PyObject *none = Py_BuildValue((char*)"");
+ Py_DECREF(none);
+ return none;
+}
+SWIGRUNTIME PyObject *
+SWIG_Py_None(void)
+{
+ static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
+ return none;
+}
+#endif
+
+/* The python void return value */
+
+SWIGRUNTIMEINLINE PyObject *
+SWIG_Py_Void(void)
+{
+ PyObject *none = Py_None;
+ Py_INCREF(none);
+ return none;
+}
+
+/* SwigPyClientData */
+
+typedef struct {
+ PyObject *klass;
+ PyObject *newraw;
+ PyObject *newargs;
+ PyObject *destroy;
+ int delargs;
+ int implicitconv;
+} SwigPyClientData;
+
+SWIGRUNTIMEINLINE int
+SWIG_Python_CheckImplicit(swig_type_info *ty)
+{
+ SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
+ return data ? data->implicitconv : 0;
+}
+
+SWIGRUNTIMEINLINE PyObject *
+SWIG_Python_ExceptionType(swig_type_info *desc) {
+ SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
+ PyObject *klass = data ? data->klass : 0;
+ return (klass ? klass : PyExc_RuntimeError);
+}
+
+
+SWIGRUNTIME SwigPyClientData *
+SwigPyClientData_New(PyObject* obj)
+{
+ if (!obj) {
+ return 0;
+ } else {
+ SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
+ /* the klass element */
+ data->klass = obj;
+ Py_INCREF(data->klass);
+ /* the newraw method and newargs arguments used to create a new raw instance */
+ if (PyClass_Check(obj)) {
+ data->newraw = 0;
+ data->newargs = obj;
+ Py_INCREF(obj);
+ } else {
+#if (PY_VERSION_HEX < 0x02020000)
+ data->newraw = 0;
+#else
+ data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
+#endif
+ if (data->newraw) {
+ Py_INCREF(data->newraw);
+ data->newargs = PyTuple_New(1);
+ PyTuple_SetItem(data->newargs, 0, obj);
+ } else {
+ data->newargs = obj;
+ }
+ Py_INCREF(data->newargs);
+ }
+ /* the destroy method, aka as the C++ delete method */
+ data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
+ if (PyErr_Occurred()) {
+ PyErr_Clear();
+ data->destroy = 0;
+ }
+ if (data->destroy) {
+ int flags;
+ Py_INCREF(data->destroy);
+ flags = PyCFunction_GET_FLAGS(data->destroy);
+#ifdef METH_O
+ data->delargs = !(flags & (METH_O));
+#else
+ data->delargs = 0;
+#endif
+ } else {
+ data->delargs = 0;
+ }
+ data->implicitconv = 0;
+ return data;
+ }
+}
+
+SWIGRUNTIME void
+SwigPyClientData_Del(SwigPyClientData* data)
+{
+ Py_XDECREF(data->newraw);
+ Py_XDECREF(data->newargs);
+ Py_XDECREF(data->destroy);
+}
+
+/* =============== SwigPyObject =====================*/
+
+typedef struct {
+ PyObject_HEAD
+ void *ptr;
+ swig_type_info *ty;
+ int own;
+ PyObject *next;
+} SwigPyObject;
+
+SWIGRUNTIME PyObject *
+SwigPyObject_long(SwigPyObject *v)
+{
+ return PyLong_FromVoidPtr(v->ptr);
+}
+
+SWIGRUNTIME PyObject *
+SwigPyObject_format(const char* fmt, SwigPyObject *v)
+{
+ PyObject *res = NULL;
+ PyObject *args = PyTuple_New(1);
+ if (args) {
+ if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
+ PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
+ if (ofmt) {
+#if PY_VERSION_HEX >= 0x03000000
+ res = PyUnicode_Format(ofmt,args);
+#else
+ res = PyString_Format(ofmt,args);
+#endif
+ Py_DECREF(ofmt);
+ }
+ Py_DECREF(args);
+ }
+ }
+ return res;
+}
+
+SWIGRUNTIME PyObject *
+SwigPyObject_oct(SwigPyObject *v)
+{
+ return SwigPyObject_format("%o",v);
+}
+
+SWIGRUNTIME PyObject *
+SwigPyObject_hex(SwigPyObject *v)
+{
+ return SwigPyObject_format("%x",v);
+}
+
+SWIGRUNTIME PyObject *
+#ifdef METH_NOARGS
+SwigPyObject_repr(SwigPyObject *v)
+#else
+SwigPyObject_repr(SwigPyObject *v, PyObject *args)
+#endif
+{
+ const char *name = SWIG_TypePrettyName(v->ty);
+ PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", name, v);
+ if (v->next) {
+#ifdef METH_NOARGS
+ PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
+#else
+ PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
+#endif
+#if PY_VERSION_HEX >= 0x03000000
+ PyObject *joined = PyUnicode_Concat(repr, nrep);
+ Py_DecRef(repr);
+ Py_DecRef(nrep);
+ repr = joined;
+#else
+ PyString_ConcatAndDel(&repr,nrep);
+#endif
+ }
+ return repr;
+}
+
+SWIGRUNTIME int
+SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
+{
+ char *str;
+#ifdef METH_NOARGS
+ PyObject *repr = SwigPyObject_repr(v);
+#else
+ PyObject *repr = SwigPyObject_repr(v, NULL);
+#endif
+ if (repr) {
+ str = SWIG_Python_str_AsChar(repr);
+ fputs(str, fp);
+ SWIG_Python_str_DelForPy3(str);
+ Py_DECREF(repr);
+ return 0;
+ } else {
+ return 1;
+ }
+}
+
+SWIGRUNTIME PyObject *
+SwigPyObject_str(SwigPyObject *v)
+{
+ char result[SWIG_BUFFER_SIZE];
+ return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ?
+ SWIG_Python_str_FromChar(result) : 0;
+}
+
+SWIGRUNTIME int
+SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
+{
+ void *i = v->ptr;
+ void *j = w->ptr;
+ return (i < j) ? -1 : ((i > j) ? 1 : 0);
+}
+
+/* Added for Python 3.x, would it also be useful for Python 2.x? */
+SWIGRUNTIME PyObject*
+SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
+{
+ PyObject* res;
+ if( op != Py_EQ && op != Py_NE ) {
+ Py_INCREF(Py_NotImplemented);
+ return Py_NotImplemented;
+ }
+ if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) )
+ res = Py_True;
+ else
+ res = Py_False;
+ Py_INCREF(res);
+ return res;
+}
+
+
+SWIGRUNTIME PyTypeObject* _PySwigObject_type(void);
+
+SWIGRUNTIME PyTypeObject*
+SwigPyObject_type(void) {
+ static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type();
+ return type;
+}
+
+SWIGRUNTIMEINLINE int
+SwigPyObject_Check(PyObject *op) {
+ return (Py_TYPE(op) == SwigPyObject_type())
+ || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
+}
+
+SWIGRUNTIME PyObject *
+SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
+
+SWIGRUNTIME void
+SwigPyObject_dealloc(PyObject *v)
+{
+ SwigPyObject *sobj = (SwigPyObject *) v;
+ PyObject *next = sobj->next;
+ if (sobj->own == SWIG_POINTER_OWN) {
+ swig_type_info *ty = sobj->ty;
+ SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
+ PyObject *destroy = data ? data->destroy : 0;
+ if (destroy) {
+ /* destroy is always a VARARGS method */
+ PyObject *res;
+ if (data->delargs) {
+ /* we need to create a temporary object to carry the destroy operation */
+ PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
+ res = SWIG_Python_CallFunctor(destroy, tmp);
+ Py_DECREF(tmp);
+ } else {
+ PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
+ PyObject *mself = PyCFunction_GET_SELF(destroy);
+ res = ((*meth)(mself, v));
+ }
+ Py_XDECREF(res);
+ }
+#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
+ else {
+ const char *name = SWIG_TypePrettyName(ty);
+ printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
+ }
+#endif
+ }
+ Py_XDECREF(next);
+ PyObject_DEL(v);
+}
+
+SWIGRUNTIME PyObject*
+SwigPyObject_append(PyObject* v, PyObject* next)
+{
+ SwigPyObject *sobj = (SwigPyObject *) v;
+#ifndef METH_O
+ PyObject *tmp = 0;
+ if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
+ next = tmp;
+#endif
+ if (!SwigPyObject_Check(next)) {
+ return NULL;
+ }
+ sobj->next = next;
+ Py_INCREF(next);
+ return SWIG_Py_Void();
+}
+
+SWIGRUNTIME PyObject*
+#ifdef METH_NOARGS
+SwigPyObject_next(PyObject* v)
+#else
+SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+#endif
+{
+ SwigPyObject *sobj = (SwigPyObject *) v;
+ if (sobj->next) {
+ Py_INCREF(sobj->next);
+ return sobj->next;
+ } else {
+ return SWIG_Py_Void();
+ }
+}
+
+SWIGINTERN PyObject*
+#ifdef METH_NOARGS
+SwigPyObject_disown(PyObject *v)
+#else
+SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+#endif
+{
+ SwigPyObject *sobj = (SwigPyObject *)v;
+ sobj->own = 0;
+ return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject*
+#ifdef METH_NOARGS
+SwigPyObject_acquire(PyObject *v)
+#else
+SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+#endif
+{
+ SwigPyObject *sobj = (SwigPyObject *)v;
+ sobj->own = SWIG_POINTER_OWN;
+ return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject*
+SwigPyObject_own(PyObject *v, PyObject *args)
+{
+ PyObject *val = 0;
+#if (PY_VERSION_HEX < 0x02020000)
+ if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
+#else
+ if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val))
+#endif
+ {
+ return NULL;
+ }
+ else
+ {
+ SwigPyObject *sobj = (SwigPyObject *)v;
+ PyObject *obj = PyBool_FromLong(sobj->own);
+ if (val) {
+#ifdef METH_NOARGS
+ if (PyObject_IsTrue(val)) {
+ SwigPyObject_acquire(v);
+ } else {
+ SwigPyObject_disown(v);
+ }
+#else
+ if (PyObject_IsTrue(val)) {
+ SwigPyObject_acquire(v,args);
+ } else {
+ SwigPyObject_disown(v,args);
+ }
+#endif
+ }
+ return obj;
+ }
+}
+
+#ifdef METH_O
+static PyMethodDef
+swigobject_methods[] = {
+ {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"},
+ {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"},
+ {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
+ {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"},
+ {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"},
+ {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"},
+ {0, 0, 0, 0}
+};
+#else
+static PyMethodDef
+swigobject_methods[] = {
+ {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"},
+ {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"},
+ {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
+ {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"},
+ {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"},
+ {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"},
+ {0, 0, 0, 0}
+};
+#endif
+
+#if PY_VERSION_HEX < 0x02020000
+SWIGINTERN PyObject *
+SwigPyObject_getattr(SwigPyObject *sobj,char *name)
+{
+ return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
+}
+#endif
+
+SWIGRUNTIME PyTypeObject*
+_PySwigObject_type(void) {
+ static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
+
+ static PyNumberMethods SwigPyObject_as_number = {
+ (binaryfunc)0, /*nb_add*/
+ (binaryfunc)0, /*nb_subtract*/
+ (binaryfunc)0, /*nb_multiply*/
+ /* nb_divide removed in Python 3 */
+#if PY_VERSION_HEX < 0x03000000
+ (binaryfunc)0, /*nb_divide*/
+#endif
+ (binaryfunc)0, /*nb_remainder*/
+ (binaryfunc)0, /*nb_divmod*/
+ (ternaryfunc)0,/*nb_power*/
+ (unaryfunc)0, /*nb_negative*/
+ (unaryfunc)0, /*nb_positive*/
+ (unaryfunc)0, /*nb_absolute*/
+ (inquiry)0, /*nb_nonzero*/
+ 0, /*nb_invert*/
+ 0, /*nb_lshift*/
+ 0, /*nb_rshift*/
+ 0, /*nb_and*/
+ 0, /*nb_xor*/
+ 0, /*nb_or*/
+#if PY_VERSION_HEX < 0x03000000
+ 0, /*nb_coerce*/
+#endif
+ (unaryfunc)SwigPyObject_long, /*nb_int*/
+#if PY_VERSION_HEX < 0x03000000
+ (unaryfunc)SwigPyObject_long, /*nb_long*/
+#else
+ 0, /*nb_reserved*/
+#endif
+ (unaryfunc)0, /*nb_float*/
+#if PY_VERSION_HEX < 0x03000000
+ (unaryfunc)SwigPyObject_oct, /*nb_oct*/
+ (unaryfunc)SwigPyObject_hex, /*nb_hex*/
+#endif
+#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
+#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
+#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
+#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */
+ 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
+#endif
+ };
+
+ static PyTypeObject swigpyobject_type;
+ static int type_init = 0;
+ if (!type_init) {
+ const PyTypeObject tmp
+ = {
+ /* PyObject header changed in Python 3 */
+#if PY_VERSION_HEX >= 0x03000000
+ PyVarObject_HEAD_INIT(&PyType_Type, 0)
+#else
+ PyObject_HEAD_INIT(NULL)
+ 0, /* ob_size */
+#endif
+ (char *)"SwigPyObject", /* tp_name */
+ sizeof(SwigPyObject), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ (destructor)SwigPyObject_dealloc, /* tp_dealloc */
+ (printfunc)SwigPyObject_print, /* tp_print */
+#if PY_VERSION_HEX < 0x02020000
+ (getattrfunc)SwigPyObject_getattr, /* tp_getattr */
+#else
+ (getattrfunc)0, /* tp_getattr */
+#endif
+ (setattrfunc)0, /* tp_setattr */
+#if PY_VERSION_HEX >= 0x03000000
+ 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
+#else
+ (cmpfunc)SwigPyObject_compare, /* tp_compare */
+#endif
+ (reprfunc)SwigPyObject_repr, /* tp_repr */
+ &SwigPyObject_as_number, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ (hashfunc)0, /* tp_hash */
+ (ternaryfunc)0, /* tp_call */
+ (reprfunc)SwigPyObject_str, /* tp_str */
+ PyObject_GenericGetAttr, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT, /* tp_flags */
+ swigobject_doc, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ (richcmpfunc)SwigPyObject_richcompare, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+#if PY_VERSION_HEX >= 0x02020000
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ swigobject_methods, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ 0, /* tp_bases */
+ 0, /* tp_mro */
+ 0, /* tp_cache */
+ 0, /* tp_subclasses */
+ 0, /* tp_weaklist */
+#endif
+#if PY_VERSION_HEX >= 0x02030000
+ 0, /* tp_del */
+#endif
+#ifdef COUNT_ALLOCS
+ 0,0,0,0 /* tp_alloc -> tp_next */
+#endif
+ };
+ swigpyobject_type = tmp;
+ /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */
+#if PY_VERSION_HEX < 0x03000000
+ swigpyobject_type.ob_type = &PyType_Type;
+#endif
+ type_init = 1;
+ }
+ return &swigpyobject_type;
+}
+
+SWIGRUNTIME PyObject *
+SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
+{
+ SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
+ if (sobj) {
+ sobj->ptr = ptr;
+ sobj->ty = ty;
+ sobj->own = own;
+ sobj->next = 0;
+ }
+ return (PyObject *)sobj;
+}
+
+/* -----------------------------------------------------------------------------
+ * Implements a simple Swig Packed type, and use it instead of string
+ * ----------------------------------------------------------------------------- */
+
+typedef struct {
+ PyObject_HEAD
+ void *pack;
+ swig_type_info *ty;
+ size_t size;
+} SwigPyPacked;
+
+SWIGRUNTIME int
+SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
+{
+ char result[SWIG_BUFFER_SIZE];
+ fputs("<Swig Packed ", fp);
+ if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
+ fputs("at ", fp);
+ fputs(result, fp);
+ }
+ fputs(v->ty->name,fp);
+ fputs(">", fp);
+ return 0;
+}
+
+SWIGRUNTIME PyObject *
+SwigPyPacked_repr(SwigPyPacked *v)
+{
+ char result[SWIG_BUFFER_SIZE];
+ if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
+ return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
+ } else {
+ return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
+ }
+}
+
+SWIGRUNTIME PyObject *
+SwigPyPacked_str(SwigPyPacked *v)
+{
+ char result[SWIG_BUFFER_SIZE];
+ if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
+ return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
+ } else {
+ return SWIG_Python_str_FromChar(v->ty->name);
+ }
+}
+
+SWIGRUNTIME int
+SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
+{
+ size_t i = v->size;
+ size_t j = w->size;
+ int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
+ return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
+}
+
+SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void);
+
+SWIGRUNTIME PyTypeObject*
+SwigPyPacked_type(void) {
+ static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type();
+ return type;
+}
+
+SWIGRUNTIMEINLINE int
+SwigPyPacked_Check(PyObject *op) {
+ return ((op)->ob_type == _PySwigPacked_type())
+ || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
+}
+
+SWIGRUNTIME void
+SwigPyPacked_dealloc(PyObject *v)
+{
+ if (SwigPyPacked_Check(v)) {
+ SwigPyPacked *sobj = (SwigPyPacked *) v;
+ free(sobj->pack);
+ }
+ PyObject_DEL(v);
+}
+
+SWIGRUNTIME PyTypeObject*
+_PySwigPacked_type(void) {
+ static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
+ static PyTypeObject swigpypacked_type;
+ static int type_init = 0;
+ if (!type_init) {
+ const PyTypeObject tmp
+ = {
+ /* PyObject header changed in Python 3 */
+#if PY_VERSION_HEX>=0x03000000
+ PyVarObject_HEAD_INIT(&PyType_Type, 0)
+#else
+ PyObject_HEAD_INIT(NULL)
+ 0, /* ob_size */
+#endif
+ (char *)"SwigPyPacked", /* tp_name */
+ sizeof(SwigPyPacked), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ (destructor)SwigPyPacked_dealloc, /* tp_dealloc */
+ (printfunc)SwigPyPacked_print, /* tp_print */
+ (getattrfunc)0, /* tp_getattr */
+ (setattrfunc)0, /* tp_setattr */
+#if PY_VERSION_HEX>=0x03000000
+ 0, /* tp_reserved in 3.0.1 */
+#else
+ (cmpfunc)SwigPyPacked_compare, /* tp_compare */
+#endif
+ (reprfunc)SwigPyPacked_repr, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ (hashfunc)0, /* tp_hash */
+ (ternaryfunc)0, /* tp_call */
+ (reprfunc)SwigPyPacked_str, /* tp_str */
+ PyObject_GenericGetAttr, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT, /* tp_flags */
+ swigpacked_doc, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+#if PY_VERSION_HEX >= 0x02020000
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ 0, /* tp_bases */
+ 0, /* tp_mro */
+ 0, /* tp_cache */
+ 0, /* tp_subclasses */
+ 0, /* tp_weaklist */
+#endif
+#if PY_VERSION_HEX >= 0x02030000
+ 0, /* tp_del */
+#endif
+#ifdef COUNT_ALLOCS
+ 0,0,0,0 /* tp_alloc -> tp_next */
+#endif
+ };
+ swigpypacked_type = tmp;
+ /* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */
+#if PY_VERSION_HEX < 0x03000000
+ swigpypacked_type.ob_type = &PyType_Type;
+#endif
+ type_init = 1;
+ }
+ return &swigpypacked_type;
+}
+
+SWIGRUNTIME PyObject *
+SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
+{
+ SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
+ if (sobj) {
+ void *pack = malloc(size);
+ if (pack) {
+ memcpy(pack, ptr, size);
+ sobj->pack = pack;
+ sobj->ty = ty;
+ sobj->size = size;
+ } else {
+ PyObject_DEL((PyObject *) sobj);
+ sobj = 0;
+ }
+ }
+ return (PyObject *) sobj;
+}
+
+SWIGRUNTIME swig_type_info *
+SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
+{
+ if (SwigPyPacked_Check(obj)) {
+ SwigPyPacked *sobj = (SwigPyPacked *)obj;
+ if (sobj->size != size) return 0;
+ memcpy(ptr, sobj->pack, size);
+ return sobj->ty;
+ } else {
+ return 0;
+ }
+}
+
+/* -----------------------------------------------------------------------------
+ * pointers/data manipulation
+ * ----------------------------------------------------------------------------- */
+
+SWIGRUNTIMEINLINE PyObject *
+_SWIG_This(void)
+{
+ return SWIG_Python_str_FromChar("this");
+}
+
+SWIGRUNTIME PyObject *
+SWIG_This(void)
+{
+ static PyObject *SWIG_STATIC_POINTER(swig_this) = _SWIG_This();
+ return swig_this;
+}
+
+/* #define SWIG_PYTHON_SLOW_GETSET_THIS */
+
+/* TODO: I don't know how to implement the fast getset in Python 3 right now */
+#if PY_VERSION_HEX>=0x03000000
+#define SWIG_PYTHON_SLOW_GETSET_THIS
+#endif
+
+SWIGRUNTIME SwigPyObject *
+SWIG_Python_GetSwigThis(PyObject *pyobj)
+{
+ if (SwigPyObject_Check(pyobj)) {
+ return (SwigPyObject *) pyobj;
+ } else {
+ PyObject *obj = 0;
+#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
+ if (PyInstance_Check(pyobj)) {
+ obj = _PyInstance_Lookup(pyobj, SWIG_This());
+ } else {
+ PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
+ if (dictptr != NULL) {
+ PyObject *dict = *dictptr;
+ obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
+ } else {
+#ifdef PyWeakref_CheckProxy
+ if (PyWeakref_CheckProxy(pyobj)) {
+ PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
+ return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
+ }
+#endif
+ obj = PyObject_GetAttr(pyobj,SWIG_This());
+ if (obj) {
+ Py_DECREF(obj);
+ } else {
+ if (PyErr_Occurred()) PyErr_Clear();
+ return 0;
+ }
+ }
+ }
+#else
+ obj = PyObject_GetAttr(pyobj,SWIG_This());
+ if (obj) {
+ Py_DECREF(obj);
+ } else {
+ if (PyErr_Occurred()) PyErr_Clear();
+ return 0;
+ }
+#endif
+ if (obj && !SwigPyObject_Check(obj)) {
+ /* a PyObject is called 'this', try to get the 'real this'
+ SwigPyObject from it */
+ return SWIG_Python_GetSwigThis(obj);
+ }
+ return (SwigPyObject *)obj;
+ }
+}
+
+/* Acquire a pointer value */
+
+SWIGRUNTIME int
+SWIG_Python_AcquirePtr(PyObject *obj, int own) {
+ if (own == SWIG_POINTER_OWN) {
+ SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
+ if (sobj) {
+ int oldown = sobj->own;
+ sobj->own = own;
+ return oldown;
+ }
+ }
+ return 0;
+}
+
+/* Convert a pointer value */
+
+SWIGRUNTIME int
+SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
+ if (!obj) return SWIG_ERROR;
+ if (obj == Py_None) {
+ if (ptr) *ptr = 0;
+ return SWIG_OK;
+ } else {
+ SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
+ if (own)
+ *own = 0;
+ while (sobj) {
+ void *vptr = sobj->ptr;
+ if (ty) {
+ swig_type_info *to = sobj->ty;
+ if (to == ty) {
+ /* no type cast needed */
+ if (ptr) *ptr = vptr;
+ break;
+ } else {
+ swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
+ if (!tc) {
+ sobj = (SwigPyObject *)sobj->next;
+ } else {
+ if (ptr) {
+ int newmemory = 0;
+ *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
+ if (newmemory == SWIG_CAST_NEW_MEMORY) {
+ assert(own);
+ if (own)
+ *own = *own | SWIG_CAST_NEW_MEMORY;
+ }
+ }
+ break;
+ }
+ }
+ } else {
+ if (ptr) *ptr = vptr;
+ break;
+ }
+ }
+ if (sobj) {
+ if (own)
+ *own = *own | sobj->own;
+ if (flags & SWIG_POINTER_DISOWN) {
+ sobj->own = 0;
+ }
+ return SWIG_OK;
+ } else {
+ int res = SWIG_ERROR;
+ if (flags & SWIG_POINTER_IMPLICIT_CONV) {
+ SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
+ if (data && !data->implicitconv) {
+ PyObject *klass = data->klass;
+ if (klass) {
+ PyObject *impconv;
+ data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
+ impconv = SWIG_Python_CallFunctor(klass, obj);
+ data->implicitconv = 0;
+ if (PyErr_Occurred()) {
+ PyErr_Clear();
+ impconv = 0;
+ }
+ if (impconv) {
+ SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
+ if (iobj) {
+ void *vptr;
+ res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
+ if (SWIG_IsOK(res)) {
+ if (ptr) {
+ *ptr = vptr;
+ /* transfer the ownership to 'ptr' */
+ iobj->own = 0;
+ res = SWIG_AddCast(res);
+ res = SWIG_AddNewMask(res);
+ } else {
+ res = SWIG_AddCast(res);
+ }
+ }
+ }
+ Py_DECREF(impconv);
+ }
+ }
+ }
+ }
+ return res;
+ }
+ }
+}
+
+/* Convert a function ptr value */
+
+SWIGRUNTIME int
+SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
+ if (!PyCFunction_Check(obj)) {
+ return SWIG_ConvertPtr(obj, ptr, ty, 0);
+ } else {
+ void *vptr = 0;
+
+ /* here we get the method pointer for callbacks */
+ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
+ const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
+ if (desc)
+ desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
+ if (!desc)
+ return SWIG_ERROR;
+ if (ty) {
+ swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
+ if (tc) {
+ int newmemory = 0;
+ *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
+ assert(!newmemory); /* newmemory handling not yet implemented */
+ } else {
+ return SWIG_ERROR;
+ }
+ } else {
+ *ptr = vptr;
+ }
+ return SWIG_OK;
+ }
+}
+
+/* Convert a packed value value */
+
+SWIGRUNTIME int
+SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
+ swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
+ if (!to) return SWIG_ERROR;
+ if (ty) {
+ if (to != ty) {
+ /* check type cast? */
+ swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
+ if (!tc) return SWIG_ERROR;
+ }
+ }
+ return SWIG_OK;
+}
+
+/* -----------------------------------------------------------------------------
+ * Create a new pointer object
+ * ----------------------------------------------------------------------------- */
+
+/*
+ Create a new instance object, without calling __init__, and set the
+ 'this' attribute.
+*/
+
+SWIGRUNTIME PyObject*
+SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
+{
+#if (PY_VERSION_HEX >= 0x02020000)
+ PyObject *inst = 0;
+ PyObject *newraw = data->newraw;
+ if (newraw) {
+ inst = PyObject_Call(newraw, data->newargs, NULL);
+ if (inst) {
+#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
+ PyObject **dictptr = _PyObject_GetDictPtr(inst);
+ if (dictptr != NULL) {
+ PyObject *dict = *dictptr;
+ if (dict == NULL) {
+ dict = PyDict_New();
+ *dictptr = dict;
+ PyDict_SetItem(dict, SWIG_This(), swig_this);
+ }
+ }
+#else
+ PyObject *key = SWIG_This();
+ PyObject_SetAttr(inst, key, swig_this);
+#endif
+ }
+ } else {
+#if PY_VERSION_HEX >= 0x03000000
+ inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
+ PyObject_SetAttr(inst, SWIG_This(), swig_this);
+ Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
+#else
+ PyObject *dict = PyDict_New();
+ PyDict_SetItem(dict, SWIG_This(), swig_this);
+ inst = PyInstance_NewRaw(data->newargs, dict);
+ Py_DECREF(dict);
+#endif
+ }
+ return inst;
+#else
+#if (PY_VERSION_HEX >= 0x02010000)
+ PyObject *inst;
+ PyObject *dict = PyDict_New();
+ PyDict_SetItem(dict, SWIG_This(), swig_this);
+ inst = PyInstance_NewRaw(data->newargs, dict);
+ Py_DECREF(dict);
+ return (PyObject *) inst;
+#else
+ PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
+ if (inst == NULL) {
+ return NULL;
+ }
+ inst->in_class = (PyClassObject *)data->newargs;
+ Py_INCREF(inst->in_class);
+ inst->in_dict = PyDict_New();
+ if (inst->in_dict == NULL) {
+ Py_DECREF(inst);
+ return NULL;
+ }
+#ifdef Py_TPFLAGS_HAVE_WEAKREFS
+ inst->in_weakreflist = NULL;
+#endif
+#ifdef Py_TPFLAGS_GC
+ PyObject_GC_Init(inst);
+#endif
+ PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
+ return (PyObject *) inst;
+#endif
+#endif
+}
+
+SWIGRUNTIME void
+SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
+{
+ PyObject *dict;
+#if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
+ PyObject **dictptr = _PyObject_GetDictPtr(inst);
+ if (dictptr != NULL) {
+ dict = *dictptr;
+ if (dict == NULL) {
+ dict = PyDict_New();
+ *dictptr = dict;
+ }
+ PyDict_SetItem(dict, SWIG_This(), swig_this);
+ return;
+ }
+#endif
+ dict = PyObject_GetAttrString(inst, (char*)"__dict__");
+ PyDict_SetItem(dict, SWIG_This(), swig_this);
+ Py_DECREF(dict);
+}
+
+
+SWIGINTERN PyObject *
+SWIG_Python_InitShadowInstance(PyObject *args) {
+ PyObject *obj[2];
+ if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) {
+ return NULL;
+ } else {
+ SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
+ if (sthis) {
+ SwigPyObject_append((PyObject*) sthis, obj[1]);
+ } else {
+ SWIG_Python_SetSwigThis(obj[0], obj[1]);
+ }
+ return SWIG_Py_Void();
+ }
+}
+
+/* Create a new pointer object */
+
+SWIGRUNTIME PyObject *
+SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
+ if (!ptr) {
+ return SWIG_Py_Void();
+ } else {
+ int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
+ PyObject *robj = SwigPyObject_New(ptr, type, own);
+ SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
+ if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
+ PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
+ if (inst) {
+ Py_DECREF(robj);
+ robj = inst;
+ }
+ }
+ return robj;
+ }
+}
+
+/* Create a new packed object */
+
+SWIGRUNTIMEINLINE PyObject *
+SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
+ return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
+}
+
+/* -----------------------------------------------------------------------------*
+ * Get type list
+ * -----------------------------------------------------------------------------*/
+
+#ifdef SWIG_LINK_RUNTIME
+void *SWIG_ReturnGlobalTypeList(void *);
+#endif
+
+SWIGRUNTIME swig_module_info *
+SWIG_Python_GetModule(void) {
+ static void *type_pointer = (void *)0;
+ /* first check if module already created */
+ if (!type_pointer) {
+#ifdef SWIG_LINK_RUNTIME
+ type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
+#else
+ type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
+ (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
+ if (PyErr_Occurred()) {
+ PyErr_Clear();
+ type_pointer = (void *)0;
+ }
+#endif
+ }
+ return (swig_module_info *) type_pointer;
+}
+
+#if PY_MAJOR_VERSION < 2
+/* PyModule_AddObject function was introduced in Python 2.0. The following function
+ is copied out of Python/modsupport.c in python version 2.3.4 */
+SWIGINTERN int
+PyModule_AddObject(PyObject *m, char *name, PyObject *o)
+{
+ PyObject *dict;
+ if (!PyModule_Check(m)) {
+ PyErr_SetString(PyExc_TypeError,
+ "PyModule_AddObject() needs module as first arg");
+ return SWIG_ERROR;
+ }
+ if (!o) {
+ PyErr_SetString(PyExc_TypeError,
+ "PyModule_AddObject() needs non-NULL value");
+ return SWIG_ERROR;
+ }
+
+ dict = PyModule_GetDict(m);
+ if (dict == NULL) {
+ /* Internal error -- modules must have a dict! */
+ PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
+ PyModule_GetName(m));
+ return SWIG_ERROR;
+ }
+ if (PyDict_SetItemString(dict, name, o))
+ return SWIG_ERROR;
+ Py_DECREF(o);
+ return SWIG_OK;
+}
+#endif
+
+SWIGRUNTIME void
+SWIG_Python_DestroyModule(void *vptr)
+{
+ swig_module_info *swig_module = (swig_module_info *) vptr;
+ swig_type_info **types = swig_module->types;
+ size_t i;
+ for (i =0; i < swig_module->size; ++i) {
+ swig_type_info *ty = types[i];
+ if (ty->owndata) {
+ SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
+ if (data) SwigPyClientData_Del(data);
+ }
+ }
+ Py_DECREF(SWIG_This());
+}
+
+SWIGRUNTIME void
+SWIG_Python_SetModule(swig_module_info *swig_module) {
+ static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
+
+#if PY_VERSION_HEX >= 0x03000000
+ /* Add a dummy module object into sys.modules */
+ PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
+#else
+ PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
+ swig_empty_runtime_method_table);
+#endif
+ PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
+ if (pointer && module) {
+ PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
+ } else {
+ Py_XDECREF(pointer);
+ }
+}
+
+/* The python cached type query */
+SWIGRUNTIME PyObject *
+SWIG_Python_TypeCache(void) {
+ static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
+ return cache;
+}
+
+SWIGRUNTIME swig_type_info *
+SWIG_Python_TypeQuery(const char *type)
+{
+ PyObject *cache = SWIG_Python_TypeCache();
+ PyObject *key = SWIG_Python_str_FromChar(type);
+ PyObject *obj = PyDict_GetItem(cache, key);
+ swig_type_info *descriptor;
+ if (obj) {
+ descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
+ } else {
+ swig_module_info *swig_module = SWIG_Python_GetModule();
+ descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
+ if (descriptor) {
+ obj = PyCObject_FromVoidPtr(descriptor, NULL);
+ PyDict_SetItem(cache, key, obj);
+ Py_DECREF(obj);
+ }
+ }
+ Py_DECREF(key);
+ return descriptor;
+}
+
+/*
+ For backward compatibility only
+*/
+#define SWIG_POINTER_EXCEPTION 0
+#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg)
+#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
+
+SWIGRUNTIME int
+SWIG_Python_AddErrMesg(const char* mesg, int infront)
+{
+ if (PyErr_Occurred()) {
+ PyObject *type = 0;
+ PyObject *value = 0;
+ PyObject *traceback = 0;
+ PyErr_Fetch(&type, &value, &traceback);
+ if (value) {
+ char *tmp;
+ PyObject *old_str = PyObject_Str(value);
+ Py_XINCREF(type);
+ PyErr_Clear();
+ if (infront) {
+ PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
+ } else {
+ PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
+ }
+ SWIG_Python_str_DelForPy3(tmp);
+ Py_DECREF(old_str);
+ }
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+SWIGRUNTIME int
+SWIG_Python_ArgFail(int argnum)
+{
+ if (PyErr_Occurred()) {
+ /* add information about failing argument */
+ char mesg[256];
+ PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
+ return SWIG_Python_AddErrMesg(mesg, 1);
+ } else {
+ return 0;
+ }
+}
+
+SWIGRUNTIMEINLINE const char *
+SwigPyObject_GetDesc(PyObject *self)
+{
+ SwigPyObject *v = (SwigPyObject *)self;
+ swig_type_info *ty = v ? v->ty : 0;
+ return ty ? ty->str : (char*)"";
+}
+
+SWIGRUNTIME void
+SWIG_Python_TypeError(const char *type, PyObject *obj)
+{
+ if (type) {
+#if defined(SWIG_COBJECT_TYPES)
+ if (obj && SwigPyObject_Check(obj)) {
+ const char *otype = (const char *) SwigPyObject_GetDesc(obj);
+ if (otype) {
+ PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
+ type, otype);
+ return;
+ }
+ } else
+#endif
+ {
+ const char *otype = (obj ? obj->ob_type->tp_name : 0);
+ if (otype) {
+ PyObject *str = PyObject_Str(obj);
+ const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
+ if (cstr) {
+ PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
+ type, otype, cstr);
+ SWIG_Python_str_DelForPy3(cstr);
+ } else {
+ PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
+ type, otype);
+ }
+ Py_XDECREF(str);
+ return;
+ }
+ }
+ PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
+ } else {
+ PyErr_Format(PyExc_TypeError, "unexpected type is received");
+ }
+}
+
+
+/* Convert a pointer value, signal an exception on a type mismatch */
+SWIGRUNTIME void *
+SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) {
+ void *result;
+ if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
+ PyErr_Clear();
+#if SWIG_POINTER_EXCEPTION
+ if (flags) {
+ SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
+ SWIG_Python_ArgFail(argnum);
+ }
+#endif
+ }
+ return result;
+}
+
+
+#ifdef __cplusplus
+#if 0
+{ /* cc-mode */
+#endif
+}
+#endif
+
+
+
+#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
+
+#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
+
+
+
+ #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0)
+
+
+/* -------- TYPES TABLE (BEGIN) -------- */
+
+#define SWIGTYPE_p_AGILe__Generator swig_types[0]
+#define SWIGTYPE_p_AGILe__Log swig_types[1]
+#define SWIGTYPE_p_AGILe__Run swig_types[2]
+#define SWIGTYPE_p_ColorCodes swig_types[3]
+#define SWIGTYPE_p_HepMC__GenEvent swig_types[4]
+#define SWIGTYPE_p_LevelMap swig_types[5]
+#define SWIGTYPE_p_LogMap swig_types[6]
+#define SWIGTYPE_p_allocator_type swig_types[7]
+#define SWIGTYPE_p_char swig_types[8]
+#define SWIGTYPE_p_difference_type swig_types[9]
+#define SWIGTYPE_p_f_p_AGILe__Generator__void swig_types[10]
+#define SWIGTYPE_p_int swig_types[11]
+#define SWIGTYPE_p_key_type swig_types[12]
+#define SWIGTYPE_p_mapped_type swig_types[13]
+#define SWIGTYPE_p_p_PyObject swig_types[14]
+#define SWIGTYPE_p_size_type swig_types[15]
+#define SWIGTYPE_p_std__invalid_argument swig_types[16]
+#define SWIGTYPE_p_std__lessT_std__string_t swig_types[17]
+#define SWIGTYPE_p_std__mapT_std__string_const_int_std__lessT_std__string_const_t_std__allocatorT_std__pairT_std__string_const_const_int_t_t_t swig_types[18]
+#define SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t swig_types[19]
+#define SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t__allocator_type swig_types[20]
+#define SWIGTYPE_p_std__ostream swig_types[21]
+#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[22]
+#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t__allocator_type swig_types[23]
+#define SWIGTYPE_p_swig__SwigPyIterator swig_types[24]
+#define SWIGTYPE_p_value_type swig_types[25]
+static swig_type_info *swig_types[27];
+static swig_module_info swig_module = {swig_types, 26, 0, 0, 0, 0};
+#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
+#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
+
+/* -------- TYPES TABLE (END) -------- */
+
+#if (PY_VERSION_HEX <= 0x02000000)
+# if !defined(SWIG_PYTHON_CLASSIC)
+# error "This python version requires swig to be run with the '-classic' option"
+# endif
+#endif
+
+/*-----------------------------------------------
+ @(target):= _AGILe.so
+ ------------------------------------------------*/
+#if PY_VERSION_HEX >= 0x03000000
+# define SWIG_init PyInit__AGILe
+
+#else
+# define SWIG_init init_AGILe
+
+#endif
+#define SWIG_name "_AGILe"
+
+#define SWIGVERSION 0x010340
+#define SWIG_VERSION SWIGVERSION
+
+
+#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
+#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
+
+
+#include <stdexcept>
+
+
+namespace swig {
+ class SwigPtr_PyObject {
+ protected:
+ PyObject *_obj;
+
+ public:
+ SwigPtr_PyObject() :_obj(0)
+ {
+ }
+
+ SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj)
+ {
+ Py_XINCREF(_obj);
+ }
+
+ SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
+ {
+ if (initial_ref) {
+ Py_XINCREF(_obj);
+ }
+ }
+
+ SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item)
+ {
+ Py_XINCREF(item._obj);
+ Py_XDECREF(_obj);
+ _obj = item._obj;
+ return *this;
+ }
+
+ ~SwigPtr_PyObject()
+ {
+ Py_XDECREF(_obj);
+ }
+
+ operator PyObject *() const
+ {
+ return _obj;
+ }
+
+ PyObject *operator->() const
+ {
+ return _obj;
+ }
+ };
+}
+
+
+namespace swig {
+ struct SwigVar_PyObject : SwigPtr_PyObject {
+ SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
+
+ SwigVar_PyObject & operator = (PyObject* obj)
+ {
+ Py_XDECREF(_obj);
+ _obj = obj;
+ return *this;
+ }
+ };
+}
+
+
+ #define SWIG_FILE_WITH_INIT
+ #include "AGILe/Loader.hh"
+ #include "AGILe/Generator.hh"
+ #include "AGILe/Run.hh"
+ #include "AGILe/Tools/Logging.hh"
+
+
+#include <string>
+
+
+#include <iostream>
+
+
+#include <stdexcept>
+
+
+#if defined(__GNUC__)
+# if __GNUC__ == 2 && __GNUC_MINOR <= 96
+# define SWIG_STD_NOMODERN_STL
+# endif
+#endif
+
+
+#include <string>
+#include <stdexcept>
+
+
+namespace swig {
+ struct stop_iteration {
+ };
+
+ struct SwigPyIterator {
+ private:
+ SwigPtr_PyObject _seq;
+
+ protected:
+ SwigPyIterator(PyObject *seq) : _seq(seq)
+ {
+ }
+
+ public:
+ virtual ~SwigPyIterator() {}
+
+ // Access iterator method, required by Python
+ virtual PyObject *value() const = 0;
+
+ // Forward iterator method, required by Python
+ virtual SwigPyIterator *incr(size_t n = 1) = 0;
+
+ // Backward iterator method, very common in C++, but not required in Python
+ virtual SwigPyIterator *decr(size_t /*n*/ = 1)
+ {
+ throw stop_iteration();
+ }
+
+ // Random access iterator methods, but not required in Python
+ virtual ptrdiff_t distance(const SwigPyIterator &/*x*/) const
+ {
+ throw std::invalid_argument("operation not supported");
+ }
+
+ virtual bool equal (const SwigPyIterator &/*x*/) const
+ {
+ throw std::invalid_argument("operation not supported");
+ }
+
+ // C++ common/needed methods
+ virtual SwigPyIterator *copy() const = 0;
+
+ PyObject *next()
+ {
+ SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads
+ PyObject *obj = value();
+ incr();
+ SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads
+ return obj;
+ }
+
+ /* Make an alias for Python 3.x */
+ PyObject *__next__()
+ {
+ return next();
+ }
+
+ PyObject *previous()
+ {
+ SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads
+ decr();
+ PyObject *obj = value();
+ SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads
+ return obj;
+ }
+
+ SwigPyIterator *advance(ptrdiff_t n)
+ {
+ return (n > 0) ? incr(n) : decr(-n);
+ }
+
+ bool operator == (const SwigPyIterator& x) const
+ {
+ return equal(x);
+ }
+
+ bool operator != (const SwigPyIterator& x) const
+ {
+ return ! operator==(x);
+ }
+
+ SwigPyIterator& operator += (ptrdiff_t n)
+ {
+ return *advance(n);
+ }
+
+ SwigPyIterator& operator -= (ptrdiff_t n)
+ {
+ return *advance(-n);
+ }
+
+ SwigPyIterator* operator + (ptrdiff_t n) const
+ {
+ return copy()->advance(n);
+ }
+
+ SwigPyIterator* operator - (ptrdiff_t n) const
+ {
+ return copy()->advance(-n);
+ }
+
+ ptrdiff_t operator - (const SwigPyIterator& x) const
+ {
+ return x.distance(*this);
+ }
+
+ static swig_type_info* descriptor() {
+ static int init = 0;
+ static swig_type_info* desc = 0;
+ if (!init) {
+ desc = SWIG_TypeQuery("swig::SwigPyIterator *");
+ init = 1;
+ }
+ return desc;
+ }
+ };
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_double (PyObject *obj, double *val)
+{
+ int res = SWIG_TypeError;
+ if (PyFloat_Check(obj)) {
+ if (val) *val = PyFloat_AsDouble(obj);
+ return SWIG_OK;
+ } else if (PyInt_Check(obj)) {
+ if (val) *val = PyInt_AsLong(obj);
+ return SWIG_OK;
+ } else if (PyLong_Check(obj)) {
+ double v = PyLong_AsDouble(obj);
+ if (!PyErr_Occurred()) {
+ if (val) *val = v;
+ return SWIG_OK;
+ } else {
+ PyErr_Clear();
+ }
+ }
+#ifdef SWIG_PYTHON_CAST_MODE
+ {
+ int dispatch = 0;
+ double d = PyFloat_AsDouble(obj);
+ if (!PyErr_Occurred()) {
+ if (val) *val = d;
+ return SWIG_AddCast(SWIG_OK);
+ } else {
+ PyErr_Clear();
+ }
+ if (!dispatch) {
+ long v = PyLong_AsLong(obj);
+ if (!PyErr_Occurred()) {
+ if (val) *val = v;
+ return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
+ } else {
+ PyErr_Clear();
+ }
+ }
+ }
+#endif
+ return res;
+}
+
+
+#include <float.h>
+
+
+#include <math.h>
+
+
+SWIGINTERNINLINE int
+SWIG_CanCastAsInteger(double *d, double min, double max) {
+ double x = *d;
+ if ((min <= x && x <= max)) {
+ double fx = floor(x);
+ double cx = ceil(x);
+ double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
+ if ((errno == EDOM) || (errno == ERANGE)) {
+ errno = 0;
+ } else {
+ double summ, reps, diff;
+ if (rd < x) {
+ diff = x - rd;
+ } else if (rd > x) {
+ diff = rd - x;
+ } else {
+ return 1;
+ }
+ summ = rd + x;
+ reps = diff/summ;
+ if (reps < 8*DBL_EPSILON) {
+ *d = rd;
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
+{
+ if (PyInt_Check(obj)) {
+ long v = PyInt_AsLong(obj);
+ if (v >= 0) {
+ if (val) *val = v;
+ return SWIG_OK;
+ } else {
+ return SWIG_OverflowError;
+ }
+ } else if (PyLong_Check(obj)) {
+ unsigned long v = PyLong_AsUnsignedLong(obj);
+ if (!PyErr_Occurred()) {
+ if (val) *val = v;
+ return SWIG_OK;
+ } else {
+ PyErr_Clear();
+ }
+ }
+#ifdef SWIG_PYTHON_CAST_MODE
+ {
+ int dispatch = 0;
+ unsigned long v = PyLong_AsUnsignedLong(obj);
+ if (!PyErr_Occurred()) {
+ if (val) *val = v;
+ return SWIG_AddCast(SWIG_OK);
+ } else {
+ PyErr_Clear();
+ }
+ if (!dispatch) {
+ double d;
+ int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
+ if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
+ if (val) *val = (unsigned long)(d);
+ return res;
+ }
+ }
+ }
+#endif
+ return SWIG_TypeError;
+}
+
+
+SWIGINTERNINLINE int
+SWIG_AsVal_size_t (PyObject * obj, size_t *val)
+{
+ unsigned long v;
+ int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
+ if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
+ return res;
+}
+
+
+ #define SWIG_From_long PyInt_FromLong
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_From_ptrdiff_t (ptrdiff_t value)
+{
+ return SWIG_From_long (static_cast< long >(value));
+}
+
+
+SWIGINTERNINLINE PyObject*
+ SWIG_From_bool (bool value)
+{
+ return PyBool_FromLong(value ? 1 : 0);
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_long (PyObject *obj, long* val)
+{
+ if (PyInt_Check(obj)) {
+ if (val) *val = PyInt_AsLong(obj);
+ return SWIG_OK;
+ } else if (PyLong_Check(obj)) {
+ long v = PyLong_AsLong(obj);
+ if (!PyErr_Occurred()) {
+ if (val) *val = v;
+ return SWIG_OK;
+ } else {
+ PyErr_Clear();
+ }
+ }
+#ifdef SWIG_PYTHON_CAST_MODE
+ {
+ int dispatch = 0;
+ long v = PyInt_AsLong(obj);
+ if (!PyErr_Occurred()) {
+ if (val) *val = v;
+ return SWIG_AddCast(SWIG_OK);
+ } else {
+ PyErr_Clear();
+ }
+ if (!dispatch) {
+ double d;
+ int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
+ if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
+ if (val) *val = (long)(d);
+ return res;
+ }
+ }
+ }
+#endif
+ return SWIG_TypeError;
+}
+
+
+SWIGINTERNINLINE int
+SWIG_AsVal_ptrdiff_t (PyObject * obj, ptrdiff_t *val)
+{
+ long v;
+ int res = SWIG_AsVal_long (obj, val ? &v : 0);
+ if (SWIG_IsOK(res) && val) *val = static_cast< ptrdiff_t >(v);
+ return res;
+}
+
+
+#include <stdexcept>
+
+
+#include <algorithm>
+
+
+#include <vector>
+
+
+#include <utility>
+
+
+#include <map>
+#include <algorithm>
+#include <stdexcept>
+
+
+namespace swig {
+ template <class Type>
+ struct noconst_traits {
+ typedef Type noconst_type;
+ };
+
+ template <class Type>
+ struct noconst_traits<const Type> {
+ typedef Type noconst_type;
+ };
+
+ /*
+ type categories
+ */
+ struct pointer_category { };
+ struct value_category { };
+
+ /*
+ General traits that provides type_name and type_info
+ */
+ template <class Type> struct traits { };
+
+ template <class Type>
+ inline const char* type_name() {
+ return traits<typename noconst_traits<Type >::noconst_type >::type_name();
+ }
+
+ template <class Type>
+ struct traits_info {
+ static swig_type_info *type_query(std::string name) {
+ name += " *";
+ return SWIG_TypeQuery(name.c_str());
+ }
+ static swig_type_info *type_info() {
+ static swig_type_info *info = type_query(type_name<Type>());
+ return info;
+ }
+ };
+
+ template <class Type>
+ inline swig_type_info *type_info() {
+ return traits_info<Type>::type_info();
+ }
+
+ /*
+ Partial specialization for pointers
+ */
+ template <class Type> struct traits <Type *> {
+ typedef pointer_category category;
+ static std::string make_ptr_name(const char* name) {
+ std::string ptrname = name;
+ ptrname += " *";
+ return ptrname;
+ }
+ static const char* type_name() {
+ static std::string name = make_ptr_name(swig::type_name<Type>());
+ return name.c_str();
+ }
+ };
+
+ template <class Type, class Category>
+ struct traits_as { };
+
+ template <class Type, class Category>
+ struct traits_check { };
+
+}
+
+
+namespace swig {
+ /*
+ Traits that provides the from method
+ */
+ template <class Type> struct traits_from_ptr {
+ static PyObject *from(Type *val, int owner = 0) {
+ return SWIG_NewPointerObj(val, type_info<Type>(), owner);
+ }
+ };
+
+ template <class Type> struct traits_from {
+ static PyObject *from(const Type& val) {
+ return traits_from_ptr<Type>::from(new Type(val), 1);
+ }
+ };
+
+ template <class Type> struct traits_from<Type *> {
+ static PyObject *from(Type* val) {
+ return traits_from_ptr<Type>::from(val, 0);
+ }
+ };
+
+ template <class Type> struct traits_from<const Type *> {
+ static PyObject *from(const Type* val) {
+ return traits_from_ptr<Type>::from(const_cast<Type*>(val), 0);
+ }
+ };
+
+
+ template <class Type>
+ inline PyObject *from(const Type& val) {
+ return traits_from<Type>::from(val);
+ }
+
+ template <class Type>
+ inline PyObject *from_ptr(Type* val, int owner) {
+ return traits_from_ptr<Type>::from(val, owner);
+ }
+
+ /*
+ Traits that provides the asval/as/check method
+ */
+ template <class Type>
+ struct traits_asptr {
+ static int asptr(PyObject *obj, Type **val) {
+ Type *p;
+ int res = SWIG_ConvertPtr(obj, (void**)&p, type_info<Type>(), 0);
+ if (SWIG_IsOK(res)) {
+ if (val) *val = p;
+ }
+ return res;
+ }
+ };
+
+ template <class Type>
+ inline int asptr(PyObject *obj, Type **vptr) {
+ return traits_asptr<Type>::asptr(obj, vptr);
+ }
+
+ template <class Type>
+ struct traits_asval {
+ static int asval(PyObject *obj, Type *val) {
+ if (val) {
+ Type *p = 0;
+ int res = traits_asptr<Type>::asptr(obj, &p);
+ if (!SWIG_IsOK(res)) return res;
+ if (p) {
+ typedef typename noconst_traits<Type>::noconst_type noconst_type;
+ *(const_cast<noconst_type*>(val)) = *p;
+ if (SWIG_IsNewObj(res)){
+ delete p;
+ res = SWIG_DelNewMask(res);
+ }
+ return res;
+ } else {
+ return SWIG_ERROR;
+ }
+ } else {
+ return traits_asptr<Type>::asptr(obj, (Type **)(0));
+ }
+ }
+ };
+
+ template <class Type> struct traits_asval<Type*> {
+ static int asval(PyObject *obj, Type **val) {
+ if (val) {
+ typedef typename noconst_traits<Type>::noconst_type noconst_type;
+ noconst_type *p = 0;
+ int res = traits_asptr<noconst_type>::asptr(obj, &p);
+ if (SWIG_IsOK(res)) {
+ *(const_cast<noconst_type**>(val)) = p;
+ }
+ return res;
+ } else {
+ return traits_asptr<Type>::asptr(obj, (Type **)(0));
+ }
+ }
+ };
+
+ template <class Type>
+ inline int asval(PyObject *obj, Type *val) {
+ return traits_asval<Type>::asval(obj, val);
+ }
+
+ template <class Type>
+ struct traits_as<Type, value_category> {
+ static Type as(PyObject *obj, bool throw_error) {
+ Type v;
+ int res = asval(obj, &v);
+ if (!obj || !SWIG_IsOK(res)) {
+ if (!PyErr_Occurred()) {
+ ::SWIG_Error(SWIG_TypeError, swig::type_name<Type>());
+ }
+ if (throw_error) throw std::invalid_argument("bad type");
+ }
+ return v;
+ }
+ };
+
+ template <class Type>
+ struct traits_as<Type, pointer_category> {
+ static Type as(PyObject *obj, bool throw_error) {
+ Type *v = 0;
+ int res = (obj ? traits_asptr<Type>::asptr(obj, &v) : SWIG_ERROR);
+ if (SWIG_IsOK(res) && v) {
+ if (SWIG_IsNewObj(res)) {
+ Type r(*v);
+ delete v;
+ return r;
+ } else {
+ return *v;
+ }
+ } else {
+ // Uninitialized return value, no Type() constructor required.
+ static Type *v_def = (Type*) malloc(sizeof(Type));
+ if (!PyErr_Occurred()) {
+ SWIG_Error(SWIG_TypeError, swig::type_name<Type>());
+ }
+ if (throw_error) throw std::invalid_argument("bad type");
+ memset(v_def,0,sizeof(Type));
+ return *v_def;
+ }
+ }
+ };
+
+ template <class Type>
+ struct traits_as<Type*, pointer_category> {
+ static Type* as(PyObject *obj, bool throw_error) {
+ Type *v = 0;
+ int res = (obj ? traits_asptr<Type>::asptr(obj, &v) : SWIG_ERROR);
+ if (SWIG_IsOK(res)) {
+ return v;
+ } else {
+ if (!PyErr_Occurred()) {
+ SWIG_Error(SWIG_TypeError, swig::type_name<Type>());
+ }
+ if (throw_error) throw std::invalid_argument("bad type");
+ return 0;
+ }
+ }
+ };
+
+ template <class Type>
+ inline Type as(PyObject *obj, bool te = false) {
+ return traits_as<Type, typename traits<Type>::category>::as(obj, te);
+ }
+
+ template <class Type>
+ struct traits_check<Type, value_category> {
+ static bool check(PyObject *obj) {
+ int res = obj ? asval(obj, (Type *)(0)) : SWIG_ERROR;
+ return SWIG_IsOK(res) ? true : false;
+ }
+ };
+
+ template <class Type>
+ struct traits_check<Type, pointer_category> {
+ static bool check(PyObject *obj) {
+ int res = obj ? asptr(obj, (Type **)(0)) : SWIG_ERROR;
+ return SWIG_IsOK(res) ? true : false;
+ }
+ };
+
+ template <class Type>
+ inline bool check(PyObject *obj) {
+ return traits_check<Type, typename traits<Type>::category>::check(obj);
+ }
+}
+
+
+#include <functional>
+
+namespace std {
+ template <>
+ struct less <PyObject *>: public binary_function<PyObject *, PyObject *, bool>
+ {
+ bool
+ operator()(PyObject * v, PyObject *w) const
+ {
+ bool res;
+ SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+ res = PyObject_RichCompareBool(v, w, Py_LT) ? true : false;
+ /* This may fall into a case of inconsistent
+ eg. ObjA > ObjX > ObjB
+ but ObjA < ObjB
+ */
+ if( PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_TypeError) )
+ {
+ /* Objects can't be compared, this mostly occurred in Python 3.0 */
+ /* Compare their ptr directly for a workaround */
+ res = (v < w);
+ PyErr_Clear();
+ }
+ SWIG_PYTHON_THREAD_END_BLOCK;
+ return res;
+ }
+ };
+
+ template <>
+ struct less <swig::SwigPtr_PyObject>: public binary_function<swig::SwigPtr_PyObject, swig::SwigPtr_PyObject, bool>
+ {
+ bool
+ operator()(const swig::SwigPtr_PyObject& v, const swig::SwigPtr_PyObject& w) const
+ {
+ return std::less<PyObject *>()(v, w);
+ }
+ };
+
+ template <>
+ struct less <swig::SwigVar_PyObject>: public binary_function<swig::SwigVar_PyObject, swig::SwigVar_PyObject, bool>
+ {
+ bool
+ operator()(const swig::SwigVar_PyObject& v, const swig::SwigVar_PyObject& w) const
+ {
+ return std::less<PyObject *>()(v, w);
+ }
+ };
+
+}
+
+namespace swig {
+ template <> struct traits<PyObject *> {
+ typedef value_category category;
+ static const char* type_name() { return "PyObject *"; }
+ };
+
+ template <> struct traits_asval<PyObject * > {
+ typedef PyObject * value_type;
+ static int asval(PyObject *obj, value_type *val) {
+ if (val) *val = obj;
+ return SWIG_OK;
+ }
+ };
+
+ template <>
+ struct traits_check<PyObject *, value_category> {
+ static bool check(PyObject *) {
+ return true;
+ }
+ };
+
+ template <> struct traits_from<PyObject *> {
+ typedef PyObject * value_type;
+ static PyObject *from(const value_type& val) {
+ Py_XINCREF(val);
+ return val;
+ }
+ };
+
+}
+
+namespace swig {
+ inline size_t
+ check_index(ptrdiff_t i, size_t size, bool insert = false) {
+ if ( i < 0 ) {
+ if ((size_t) (-i) <= size)
+ return (size_t) (i + size);
+ } else if ( (size_t) i < size ) {
+ return (size_t) i;
+ } else if (insert && ((size_t) i == size)) {
+ return size;
+ }
+
+ throw std::out_of_range("index out of range");
+ }
+
+ inline size_t
+ slice_index(ptrdiff_t i, size_t size) {
+ if ( i < 0 ) {
+ if ((size_t) (-i) <= size) {
+ return (size_t) (i + size);
+ } else {
+ throw std::out_of_range("index out of range");
+ }
+ } else {
+ return ( (size_t) i < size ) ? ((size_t) i) : size;
+ }
+ }
+
+ template <class Sequence, class Difference>
+ inline typename Sequence::iterator
+ getpos(Sequence* self, Difference i) {
+ typename Sequence::iterator pos = self->begin();
+ std::advance(pos, check_index(i,self->size()));
+ return pos;
+ }
+
+ template <class Sequence, class Difference>
+ inline typename Sequence::const_iterator
+ cgetpos(const Sequence* self, Difference i) {
+ typename Sequence::const_iterator pos = self->begin();
+ std::advance(pos, check_index(i,self->size()));
+ return pos;
+ }
+
+ template <class Sequence, class Difference>
+ inline Sequence*
+ getslice(const Sequence* self, Difference i, Difference j) {
+ typename Sequence::size_type size = self->size();
+ typename Sequence::size_type ii = swig::check_index(i, size);
+ typename Sequence::size_type jj = swig::slice_index(j, size);
+
+ if (jj > ii) {
+ typename Sequence::const_iterator vb = self->begin();
+ typename Sequence::const_iterator ve = self->begin();
+ std::advance(vb,ii);
+ std::advance(ve,jj);
+ return new Sequence(vb, ve);
+ } else {
+ return new Sequence();
+ }
+ }
+
+ template <class Sequence, class Difference, class InputSeq>
+ inline void
+ setslice(Sequence* self, Difference i, Difference j, const InputSeq& v) {
+ typename Sequence::size_type size = self->size();
+ typename Sequence::size_type ii = swig::check_index(i, size, true);
+ typename Sequence::size_type jj = swig::slice_index(j, size);
+ if (jj < ii) jj = ii;
+ size_t ssize = jj - ii;
+ if (ssize <= v.size()) {
+ typename Sequence::iterator sb = self->begin();
+ typename InputSeq::const_iterator vmid = v.begin();
+ std::advance(sb,ii);
+ std::advance(vmid, jj - ii);
+ self->insert(std::copy(v.begin(), vmid, sb), vmid, v.end());
+ } else {
+ typename Sequence::iterator sb = self->begin();
+ typename Sequence::iterator se = self->begin();
+ std::advance(sb,ii);
+ std::advance(se,jj);
+ self->erase(sb,se);
+ self->insert(sb, v.begin(), v.end());
+ }
+ }
+
+ template <class Sequence, class Difference>
+ inline void
+ delslice(Sequence* self, Difference i, Difference j) {
+ typename Sequence::size_type size = self->size();
+ typename Sequence::size_type ii = swig::check_index(i, size, true);
+ typename Sequence::size_type jj = swig::slice_index(j, size);
+ if (jj > ii) {
+ typename Sequence::iterator sb = self->begin();
+ typename Sequence::iterator se = self->begin();
+ std::advance(sb,ii);
+ std::advance(se,jj);
+ self->erase(sb,se);
+ }
+ }
+}
+
+
+#if defined(__SUNPRO_CC) && defined(_RWSTD_VER)
+# if !defined(SWIG_NO_STD_NOITERATOR_TRAITS_STL)
+# define SWIG_STD_NOITERATOR_TRAITS_STL
+# endif
+#endif
+
+#if !defined(SWIG_STD_NOITERATOR_TRAITS_STL)
+#include <iterator>
+#else
+namespace std {
+ template <class Iterator>
+ struct iterator_traits {
+ typedef ptrdiff_t difference_type;
+ typedef typename Iterator::value_type value_type;
+ };
+
+ template <class Iterator, class Category,class T, class Reference, class Pointer, class Distance>
+ struct iterator_traits<__reverse_bi_iterator<Iterator,Category,T,Reference,Pointer,Distance> > {
+ typedef Distance difference_type;
+ typedef T value_type;
+ };
+
+ template <class T>
+ struct iterator_traits<T*> {
+ typedef T value_type;
+ typedef ptrdiff_t difference_type;
+ };
+
+ template<typename _InputIterator>
+ inline typename iterator_traits<_InputIterator>::difference_type
+ distance(_InputIterator __first, _InputIterator __last)
+ {
+ typename iterator_traits<_InputIterator>::difference_type __n = 0;
+ while (__first != __last) {
+ ++__first; ++__n;
+ }
+ return __n;
+ }
+}
+#endif
+
+
+namespace swig {
+ template<typename OutIterator>
+ class SwigPyIterator_T : public SwigPyIterator
+ {
+ public:
+ typedef OutIterator out_iterator;
+ typedef typename std::iterator_traits<out_iterator>::value_type value_type;
+ typedef SwigPyIterator_T<out_iterator> self_type;
+
+ SwigPyIterator_T(out_iterator curr, PyObject *seq)
+ : SwigPyIterator(seq), current(curr)
+ {
+ }
+
+ const out_iterator& get_current() const
+ {
+ return current;
+ }
+
+
+ bool equal (const SwigPyIterator &iter) const
+ {
+ const self_type *iters = dynamic_cast<const self_type *>(&iter);
+ if (iters) {
+ return (current == iters->get_current());
+ } else {
+ throw std::invalid_argument("bad iterator type");
+ }
+ }
+
+ ptrdiff_t distance(const SwigPyIterator &iter) const
+ {
+ const self_type *iters = dynamic_cast<const self_type *>(&iter);
+ if (iters) {
+ return std::distance(current, iters->get_current());
+ } else {
+ throw std::invalid_argument("bad iterator type");
+ }
+ }
+
+ protected:
+ out_iterator current;
+ };
+
+ template <class ValueType>
+ struct from_oper
+ {
+ typedef const ValueType& argument_type;
+ typedef PyObject *result_type;
+ result_type operator()(argument_type v) const
+ {
+ return swig::from(v);
+ }
+ };
+
+ template<typename OutIterator,
+ typename ValueType = typename std::iterator_traits<OutIterator>::value_type,
+ typename FromOper = from_oper<ValueType> >
+ class SwigPyIteratorOpen_T : public SwigPyIterator_T<OutIterator>
+ {
+ public:
+ FromOper from;
+ typedef OutIterator out_iterator;
+ typedef ValueType value_type;
+ typedef SwigPyIterator_T<out_iterator> base;
+ typedef SwigPyIteratorOpen_T<OutIterator, ValueType, FromOper> self_type;
+
+ SwigPyIteratorOpen_T(out_iterator curr, PyObject *seq)
+ : SwigPyIterator_T<OutIterator>(curr, seq)
+ {
+ }
+
+ PyObject *value() const {
+ return from(static_cast<const value_type&>(*(base::current)));
+ }
+
+ SwigPyIterator *copy() const
+ {
+ return new self_type(*this);
+ }
+
+ SwigPyIterator *incr(size_t n = 1)
+ {
+ while (n--) {
+ ++base::current;
+ }
+ return this;
+ }
+
+ SwigPyIterator *decr(size_t n = 1)
+ {
+ while (n--) {
+ --base::current;
+ }
+ return this;
+ }
+ };
+
+ template<typename OutIterator,
+ typename ValueType = typename std::iterator_traits<OutIterator>::value_type,
+ typename FromOper = from_oper<ValueType> >
+ class SwigPyIteratorClosed_T : public SwigPyIterator_T<OutIterator>
+ {
+ public:
+ FromOper from;
+ typedef OutIterator out_iterator;
+ typedef ValueType value_type;
+ typedef SwigPyIterator_T<out_iterator> base;
+ typedef SwigPyIteratorClosed_T<OutIterator, ValueType, FromOper> self_type;
+
+ SwigPyIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, PyObject *seq)
+ : SwigPyIterator_T<OutIterator>(curr, seq), begin(first), end(last)
+ {
+ }
+
+ PyObject *value() const {
+ if (base::current == end) {
+ throw stop_iteration();
+ } else {
+ return from(static_cast<const value_type&>(*(base::current)));
+ }
+ }
+
+ SwigPyIterator *copy() const
+ {
+ return new self_type(*this);
+ }
+
+ SwigPyIterator *incr(size_t n = 1)
+ {
+ while (n--) {
+ if (base::current == end) {
+ throw stop_iteration();
+ } else {
+ ++base::current;
+ }
+ }
+ return this;
+ }
+
+ SwigPyIterator *decr(size_t n = 1)
+ {
+ while (n--) {
+ if (base::current == begin) {
+ throw stop_iteration();
+ } else {
+ --base::current;
+ }
+ }
+ return this;
+ }
+
+ private:
+ out_iterator begin;
+ out_iterator end;
+ };
+
+ template<typename OutIter>
+ inline SwigPyIterator*
+ make_output_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, PyObject *seq = 0)
+ {
+ return new SwigPyIteratorClosed_T<OutIter>(current, begin, end, seq);
+ }
+
+ template<typename OutIter>
+ inline SwigPyIterator*
+ make_output_iterator(const OutIter& current, PyObject *seq = 0)
+ {
+ return new SwigPyIteratorOpen_T<OutIter>(current, seq);
+ }
+}
+
+
+namespace swig
+{
+ template <class T>
+ struct SwigPySequence_Ref
+ {
+ SwigPySequence_Ref(PyObject* seq, int index)
+ : _seq(seq), _index(index)
+ {
+ }
+
+ operator T () const
+ {
+ swig::SwigVar_PyObject item = PySequence_GetItem(_seq, _index);
+ try {
+ return swig::as<T>(item, true);
+ } catch (std::exception& e) {
+ char msg[1024];
+ sprintf(msg, "in sequence element %d ", _index);
+ if (!PyErr_Occurred()) {
+ ::SWIG_Error(SWIG_TypeError, swig::type_name<T>());
+ }
+ SWIG_Python_AddErrorMsg(msg);
+ SWIG_Python_AddErrorMsg(e.what());
+ throw;
+ }
+ }
+
+ SwigPySequence_Ref& operator=(const T& v)
+ {
+ PySequence_SetItem(_seq, _index, swig::from<T>(v));
+ return *this;
+ }
+
+ private:
+ PyObject* _seq;
+ int _index;
+ };
+
+ template <class T>
+ struct SwigPySequence_ArrowProxy
+ {
+ SwigPySequence_ArrowProxy(const T& x): m_value(x) {}
+ const T* operator->() const { return &m_value; }
+ operator const T*() const { return &m_value; }
+ T m_value;
+ };
+
+ template <class T, class Reference >
+ struct SwigPySequence_InputIterator
+ {
+ typedef SwigPySequence_InputIterator<T, Reference > self;
+
+ typedef std::random_access_iterator_tag iterator_category;
+ typedef Reference reference;
+ typedef T value_type;
+ typedef T* pointer;
+ typedef int difference_type;
+
+ SwigPySequence_InputIterator()
+ {
+ }
+
+ SwigPySequence_InputIterator(PyObject* seq, int index)
+ : _seq(seq), _index(index)
+ {
+ }
+
+ reference operator*() const
+ {
+ return reference(_seq, _index);
+ }
+
+ SwigPySequence_ArrowProxy<T>
+ operator->() const {
+ return SwigPySequence_ArrowProxy<T>(operator*());
+ }
+
+ bool operator==(const self& ri) const
+ {
+ return (_index == ri._index) && (_seq == ri._seq);
+ }
+
+ bool operator!=(const self& ri) const
+ {
+ return !(operator==(ri));
+ }
+
+ self& operator ++ ()
+ {
+ ++_index;
+ return *this;
+ }
+
+ self& operator -- ()
+ {
+ --_index;
+ return *this;
+ }
+
+ self& operator += (difference_type n)
+ {
+ _index += n;
+ return *this;
+ }
+
+ self operator +(difference_type n) const
+ {
+ return self(_seq, _index + n);
+ }
+
+ self& operator -= (difference_type n)
+ {
+ _index -= n;
+ return *this;
+ }
+
+ self operator -(difference_type n) const
+ {
+ return self(_seq, _index - n);
+ }
+
+ difference_type operator - (const self& ri) const
+ {
+ return _index - ri._index;
+ }
+
+ bool operator < (const self& ri) const
+ {
+ return _index < ri._index;
+ }
+
+ reference
+ operator[](difference_type n) const
+ {
+ return reference(_seq, _index + n);
+ }
+
+ private:
+ PyObject* _seq;
+ difference_type _index;
+ };
+
+ template <class T>
+ struct SwigPySequence_Cont
+ {
+ typedef SwigPySequence_Ref<T> reference;
+ typedef const SwigPySequence_Ref<T> const_reference;
+ typedef T value_type;
+ typedef T* pointer;
+ typedef int difference_type;
+ typedef int size_type;
+ typedef const pointer const_pointer;
+ typedef SwigPySequence_InputIterator<T, reference> iterator;
+ typedef SwigPySequence_InputIterator<T, const_reference> const_iterator;
+
+ SwigPySequence_Cont(PyObject* seq) : _seq(0)
+ {
+ if (!PySequence_Check(seq)) {
+ throw std::invalid_argument("a sequence is expected");
+ }
+ _seq = seq;
+ Py_INCREF(_seq);
+ }
+
+ ~SwigPySequence_Cont()
+ {
+ Py_XDECREF(_seq);
+ }
+
+ size_type size() const
+ {
+ return static_cast<size_type>(PySequence_Size(_seq));
+ }
+
+ bool empty() const
+ {
+ return size() == 0;
+ }
+
+ iterator begin()
+ {
+ return iterator(_seq, 0);
+ }
+
+ const_iterator begin() const
+ {
+ return const_iterator(_seq, 0);
+ }
+
+ iterator end()
+ {
+ return iterator(_seq, size());
+ }
+
+ const_iterator end() const
+ {
+ return const_iterator(_seq, size());
+ }
+
+ reference operator[](difference_type n)
+ {
+ return reference(_seq, n);
+ }
+
+ const_reference operator[](difference_type n) const
+ {
+ return const_reference(_seq, n);
+ }
+
+ bool check(bool set_err = true) const
+ {
+ int s = size();
+ for (int i = 0; i < s; ++i) {
+ swig::SwigVar_PyObject item = PySequence_GetItem(_seq, i);
+ if (!swig::check<value_type>(item)) {
+ if (set_err) {
+ char msg[1024];
+ sprintf(msg, "in sequence element %d", i);
+ SWIG_Error(SWIG_RuntimeError, msg);
+ }
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private:
+ PyObject* _seq;
+ };
+
+}
+
+
+SWIGINTERN swig_type_info*
+SWIG_pchar_descriptor(void)
+{
+ static int init = 0;
+ static swig_type_info* info = 0;
+ if (!init) {
+ info = SWIG_TypeQuery("_p_char");
+ init = 1;
+ }
+ return info;
+}
+
+
+SWIGINTERN int
+SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
+{
+#if PY_VERSION_HEX>=0x03000000
+ if (PyUnicode_Check(obj))
+#else
+ if (PyString_Check(obj))
+#endif
+ {
+ char *cstr; Py_ssize_t len;
+#if PY_VERSION_HEX>=0x03000000
+ if (!alloc && cptr) {
+ /* We can't allow converting without allocation, since the internal
+ representation of string in Python 3 is UCS-2/UCS-4 but we require
+ a UTF-8 representation.
+ TODO(bhy) More detailed explanation */
+ return SWIG_RuntimeError;
+ }
+ obj = PyUnicode_AsUTF8String(obj);
+ PyBytes_AsStringAndSize(obj, &cstr, &len);
+ if(alloc) *alloc = SWIG_NEWOBJ;
+#else
+ PyString_AsStringAndSize(obj, &cstr, &len);
+#endif
+ if (cptr) {
+ if (alloc) {
+ /*
+ In python the user should not be able to modify the inner
+ string representation. To warranty that, if you define
+ SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string
+ buffer is always returned.
+
+ The default behavior is just to return the pointer value,
+ so, be careful.
+ */
+#if defined(SWIG_PYTHON_SAFE_CSTRINGS)
+ if (*alloc != SWIG_OLDOBJ)
+#else
+ if (*alloc == SWIG_NEWOBJ)
+#endif
+ {
+ *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1)));
+ *alloc = SWIG_NEWOBJ;
+ }
+ else {
+ *cptr = cstr;
+ *alloc = SWIG_OLDOBJ;
+ }
+ } else {
+ #if PY_VERSION_HEX>=0x03000000
+ assert(0); /* Should never reach here in Python 3 */
+ #endif
+ *cptr = SWIG_Python_str_AsChar(obj);
+ }
+ }
+ if (psize) *psize = len + 1;
+#if PY_VERSION_HEX>=0x03000000
+ Py_XDECREF(obj);
+#endif
+ return SWIG_OK;
+ } else {
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+ if (pchar_descriptor) {
+ void* vptr = 0;
+ if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
+ if (cptr) *cptr = (char *) vptr;
+ if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
+ if (alloc) *alloc = SWIG_OLDOBJ;
+ return SWIG_OK;
+ }
+ }
+ }
+ return SWIG_TypeError;
+}
+
+
+SWIGINTERN int
+SWIG_AsPtr_std_string (PyObject * obj, std::string **val)
+{
+ char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ;
+ if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) {
+ if (buf) {
+ if (val) *val = new std::string(buf, size - 1);
+ if (alloc == SWIG_NEWOBJ) delete[] buf;
+ return SWIG_NEWOBJ;
+ } else {
+ if (val) *val = 0;
+ return SWIG_OLDOBJ;
+ }
+ } else {
+ static int init = 0;
+ static swig_type_info* descriptor = 0;
+ if (!init) {
+ descriptor = SWIG_TypeQuery("std::string" " *");
+ init = 1;
+ }
+ if (descriptor) {
+ std::string *vptr;
+ int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0);
+ if (SWIG_IsOK(res) && val) *val = vptr;
+ return res;
+ }
+ }
+ return SWIG_ERROR;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_std_string (PyObject * obj, std::string *val)
+{
+ std::string* v = (std::string *) 0;
+ int res = SWIG_AsPtr_std_string (obj, &v);
+ if (!SWIG_IsOK(res)) return res;
+ if (v) {
+ if (val) *val = *v;
+ if (SWIG_IsNewObj(res)) {
+ delete v;
+ res = SWIG_DelNewMask(res);
+ }
+ return res;
+ }
+ return SWIG_ERROR;
+}
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_FromCharPtrAndSize(const char* carray, size_t size)
+{
+ if (carray) {
+ if (size > INT_MAX) {
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+ return pchar_descriptor ?
+ SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
+ } else {
+#if PY_VERSION_HEX >= 0x03000000
+ return PyUnicode_FromStringAndSize(carray, static_cast< int >(size));
+#else
+ return PyString_FromStringAndSize(carray, static_cast< int >(size));
+#endif
+ }
+ } else {
+ return SWIG_Py_Void();
+ }
+}
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_From_std_string (const std::string& s)
+{
+ if (s.size()) {
+ return SWIG_FromCharPtrAndSize(s.data(), s.size());
+ } else {
+ return SWIG_FromCharPtrAndSize(s.c_str(), 0);
+ }
+}
+
+
+namespace swig {
+ template <> struct traits<std::string > {
+ typedef value_category category;
+ static const char* type_name() { return"std::string"; }
+ };
+ template <> struct traits_asval<std::string > {
+ typedef std::string value_type;
+ static int asval(PyObject *obj, value_type *val) {
+ return SWIG_AsVal_std_string (obj, val);
+ }
+ };
+ template <> struct traits_from<std::string > {
+ typedef std::string value_type;
+ static PyObject *from(const value_type& val) {
+ return SWIG_From_std_string (val);
+ }
+ };
+}
+
+
+namespace swig {
+ template <class SwigPySeq, class Seq>
+ inline void
+ assign(const SwigPySeq& swigpyseq, Seq* seq) {
+ // seq->assign(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented
+ typedef typename SwigPySeq::value_type value_type;
+ typename SwigPySeq::const_iterator it = swigpyseq.begin();
+ for (;it != swigpyseq.end(); ++it) {
+ seq->insert(seq->end(),(value_type)(*it));
+ }
+ }
+
+ template <class Seq, class T = typename Seq::value_type >
+ struct traits_asptr_stdseq {
+ typedef Seq sequence;
+ typedef T value_type;
+
+ static int asptr(PyObject *obj, sequence **seq) {
+ if (obj == Py_None || SWIG_Python_GetSwigThis(obj)) {
+ sequence *p;
+ if (::SWIG_ConvertPtr(obj,(void**)&p,
+ swig::type_info<sequence>(),0) == SWIG_OK) {
+ if (seq) *seq = p;
+ return SWIG_OLDOBJ;
+ }
+ } else if (PySequence_Check(obj)) {
+ try {
+ SwigPySequence_Cont<value_type> swigpyseq(obj);
+ if (seq) {
+ sequence *pseq = new sequence();
+ assign(swigpyseq, pseq);
+ *seq = pseq;
+ return SWIG_NEWOBJ;
+ } else {
+ return swigpyseq.check() ? SWIG_OK : SWIG_ERROR;
+ }
+ } catch (std::exception& e) {
+ if (seq) {
+ if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError, e.what());
+ }
+ }
+ return SWIG_ERROR;
+ }
+ }
+ return SWIG_ERROR;
+ }
+ };
+
+ template <class Seq, class T = typename Seq::value_type >
+ struct traits_from_stdseq {
+ typedef Seq sequence;
+ typedef T value_type;
+ typedef typename Seq::size_type size_type;
+ typedef typename sequence::const_iterator const_iterator;
+
+ static PyObject *from(const sequence& seq) {
+#ifdef SWIG_PYTHON_EXTRA_NATIVE_CONTAINERS
+ swig_type_info *desc = swig::type_info<sequence>();
+ if (desc && desc->clientdata) {
+ return SWIG_NewPointerObj(new sequence(seq), desc, SWIG_POINTER_OWN);
+ }
+#endif
+ size_type size = seq.size();
+ if (size <= (size_type)INT_MAX) {
+ PyObject *obj = PyTuple_New((int)size);
+ int i = 0;
+ for (const_iterator it = seq.begin();
+ it != seq.end(); ++it, ++i) {
+ PyTuple_SetItem(obj,i,swig::from<value_type>(*it));
+ }
+ return obj;
+ } else {
+ PyErr_SetString(PyExc_OverflowError,"sequence size not valid in python");
+ return NULL;
+ }
+ }
+ };
+}
+
+
+ namespace swig {
+ template <class T>
+ struct traits_asptr<std::vector<T> > {
+ static int asptr(PyObject *obj, std::vector<T> **vec) {
+ return traits_asptr_stdseq<std::vector<T> >::asptr(obj, vec);
+ }
+ };
+
+ template <class T>
+ struct traits_from<std::vector<T> > {
+ static PyObject *from(const std::vector<T>& vec) {
+ return traits_from_stdseq<std::vector<T> >::from(vec);
+ }
+ };
+ }
+
+
+ namespace swig {
+ template <> struct traits<std::vector<std::string, std::allocator< std::string > > > {
+ typedef pointer_category category;
+ static const char* type_name() {
+ return "std::vector<" "std::string" "," "std::allocator< std::string >" " >";
+ }
+ };
+ }
+
+SWIGINTERN swig::SwigPyIterator *std_vector_Sl_std_string_Sg__iterator(std::vector< std::string > *self,PyObject **PYTHON_SELF){
+ return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+ }
+SWIGINTERN bool std_vector_Sl_std_string_Sg____nonzero__(std::vector< std::string > const *self){
+ return !(self->empty());
+ }
+SWIGINTERN bool std_vector_Sl_std_string_Sg____bool__(std::vector< std::string > const *self){
+ return !(self->empty());
+ }
+SWIGINTERN std::vector< std::string >::size_type std_vector_Sl_std_string_Sg____len__(std::vector< std::string > const *self){
+ return self->size();
+ }
+
+SWIGINTERNINLINE PyObject*
+SWIG_From_unsigned_SS_long (unsigned long value)
+{
+ return (value > LONG_MAX) ?
+ PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value));
+}
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_From_size_t (size_t value)
+{
+ return SWIG_From_unsigned_SS_long (static_cast< unsigned long >(value));
+}
+
+SWIGINTERN std::vector< std::string >::value_type std_vector_Sl_std_string_Sg__pop(std::vector< std::string > *self){
+ if (self->size() == 0)
+ throw std::out_of_range("pop from empty container");
+ std::vector<std::string,std::allocator< std::string > >::value_type x = self->back();
+ self->pop_back();
+ return x;
+ }
+SWIGINTERN std::vector< std::string,std::allocator< std::string > > *std_vector_Sl_std_string_Sg____getslice__(std::vector< std::string > *self,std::vector< std::string >::difference_type i,std::vector< std::string >::difference_type j){
+ return swig::getslice(self, i, j);
+ }
+SWIGINTERN void std_vector_Sl_std_string_Sg____setslice__(std::vector< std::string > *self,std::vector< std::string >::difference_type i,std::vector< std::string >::difference_type j,std::vector< std::string,std::allocator< std::string > > const &v){
+ swig::setslice(self, i, j, v);
+ }
+SWIGINTERN void std_vector_Sl_std_string_Sg____delslice__(std::vector< std::string > *self,std::vector< std::string >::difference_type i,std::vector< std::string >::difference_type j){
+ swig::delslice(self, i, j);
+ }
+SWIGINTERN void std_vector_Sl_std_string_Sg____delitem____SWIG_0(std::vector< std::string > *self,std::vector< std::string >::difference_type i){
+ self->erase(swig::getpos(self,i));
+ }
+SWIGINTERN std::vector< std::string,std::allocator< std::string > > *std_vector_Sl_std_string_Sg____getitem____SWIG_0(std::vector< std::string > *self,PySliceObject *slice){
+ Py_ssize_t i, j, step;
+ if( !PySlice_Check(slice) ) {
+ SWIG_Error(SWIG_TypeError, "Slice object expected.");
+ return NULL;
+ }
+ PySlice_GetIndices(slice, self->size(), &i, &j, &step);
+ return swig::getslice(self, i, j);
+ }
+SWIGINTERN void std_vector_Sl_std_string_Sg____setitem____SWIG_0(std::vector< std::string > *self,PySliceObject *slice,std::vector< std::string,std::allocator< std::string > > const &v){
+ Py_ssize_t i, j, step;
+ if( !PySlice_Check(slice) ) {
+ SWIG_Error(SWIG_TypeError, "Slice object expected.");
+ return;
+ }
+ PySlice_GetIndices(slice, self->size(), &i, &j, &step);
+ swig::setslice(self, i, j, v);
+ }
+SWIGINTERN void std_vector_Sl_std_string_Sg____delitem____SWIG_1(std::vector< std::string > *self,PySliceObject *slice){
+ Py_ssize_t i, j, step;
+ if( !PySlice_Check(slice) ) {
+ SWIG_Error(SWIG_TypeError, "Slice object expected.");
+ return;
+ }
+ PySlice_GetIndices(slice, self->size(), &i, &j, &step);
+ swig::delslice(self, i,j);
+ }
+SWIGINTERN std::vector< std::string >::value_type const &std_vector_Sl_std_string_Sg____getitem____SWIG_1(std::vector< std::string > const *self,std::vector< std::string >::difference_type i){
+ return *(swig::cgetpos(self, i));
+ }
+SWIGINTERN void std_vector_Sl_std_string_Sg____setitem____SWIG_1(std::vector< std::string > *self,std::vector< std::string >::difference_type i,std::vector< std::string >::value_type const &x){
+ *(swig::getpos(self,i)) = x;
+ }
+SWIGINTERN void std_vector_Sl_std_string_Sg__append(std::vector< std::string > *self,std::vector< std::string >::value_type const &x){
+ self->push_back(x);
+ }
+
+#include <limits.h>
+#if !defined(SWIG_NO_LLONG_MAX)
+# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
+# define LLONG_MAX __LONG_LONG_MAX__
+# define LLONG_MIN (-LLONG_MAX - 1LL)
+# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+# endif
+#endif
+
+
+SWIGINTERN int
+SWIG_AsVal_int (PyObject * obj, int *val)
+{
+ long v;
+ int res = SWIG_AsVal_long (obj, &v);
+ if (SWIG_IsOK(res)) {
+ if ((v < INT_MIN || v > INT_MAX)) {
+ return SWIG_OverflowError;
+ } else {
+ if (val) *val = static_cast< int >(v);
+ }
+ }
+ return res;
+}
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_From_int (int value)
+{
+ return SWIG_From_long (value);
+}
+
+
+namespace swig {
+ template <> struct traits<int > {
+ typedef value_category category;
+ static const char* type_name() { return"int"; }
+ };
+ template <> struct traits_asval<int > {
+ typedef int value_type;
+ static int asval(PyObject *obj, value_type *val) {
+ return SWIG_AsVal_int (obj, val);
+ }
+ };
+ template <> struct traits_from<int > {
+ typedef int value_type;
+ static PyObject *from(const value_type& val) {
+ return SWIG_From_int (val);
+ }
+ };
+}
+
+
+ namespace swig {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template <class T, class U >
+ struct traits_asptr<std::pair<T,U> > {
+ typedef std::pair<T,U> value_type;
+
+ static int get_pair(PyObject* first, PyObject* second,
+ std::pair<T,U> **val)
+ {
+ if (val) {
+ value_type *vp = (new std::pair<T,U>);
+ T *pfirst = &(vp->first);
+ int res1 = swig::asval((PyObject*)first, pfirst);
+ if (!SWIG_IsOK(res1)) return res1;
+ U *psecond = &(vp->second);
+ int res2 = swig::asval((PyObject*)second, psecond);
+ if (!SWIG_IsOK(res2)) return res2;
+ *val = vp;
+ return SWIG_AddNewMask(res1 > res2 ? res1 : res2);
+ } else {
+ T *pfirst = 0;
+ int res1 = swig::asval((PyObject*)first, pfirst);
+ if (!SWIG_IsOK(res1)) return res1;
+ U *psecond = 0;
+ int res2 = swig::asval((PyObject*)second, psecond);
+ if (!SWIG_IsOK(res2)) return res2;
+ return res1 > res2 ? res1 : res2;
+ }
+ }
+
+ static int asptr(PyObject *obj, std::pair<T,U> **val) {
+ int res = SWIG_ERROR;
+ if (PyTuple_Check(obj)) {
+ if (PyTuple_GET_SIZE(obj) == 2) {
+ res = get_pair(PyTuple_GET_ITEM(obj,0),PyTuple_GET_ITEM(obj,1), val);
+ }
+ } else if (PySequence_Check(obj)) {
+ if (PySequence_Size(obj) == 2) {
+ swig::SwigVar_PyObject first = PySequence_GetItem(obj,0);
+ swig::SwigVar_PyObject second = PySequence_GetItem(obj,1);
+ res = get_pair(first, second, val);
+ }
+ } else {
+ value_type *p;
+ res = SWIG_ConvertPtr(obj,(void**)&p,swig::type_info<value_type>(),0);
+ if (SWIG_IsOK(res) && val) *val = p;
+ }
+ return res;
+ }
+ };
+
+
+ template <class T, class U >
+ struct traits_from<std::pair<T,U> > {
+ static PyObject *from(const std::pair<T,U>& val) {
+ PyObject* obj = PyTuple_New(2);
+ PyTuple_SetItem(obj,0,swig::from(val.first));
+ PyTuple_SetItem(obj,1,swig::from(val.second));
+ return obj;
+ }
+ };
+ }
+
+
+ namespace swig {
+ template <> struct traits<std::pair< std::string, int > > {
+ typedef pointer_category category;
+ static const char* type_name() {
+ return "std::pair<" "std::string" "," "int" " >";
+ }
+ };
+ }
+
+
+ namespace swig {
+ template <class SwigPySeq, class K, class T >
+ inline void
+ assign(const SwigPySeq& swigpyseq, std::map<K,T > *map) {
+ typedef typename std::map<K,T>::value_type value_type;
+ typename SwigPySeq::const_iterator it = swigpyseq.begin();
+ for (;it != swigpyseq.end(); ++it) {
+ map->insert(value_type(it->first, it->second));
+ }
+ }
+
+ template <class K, class T>
+ struct traits_asptr<std::map<K,T> > {
+ typedef std::map<K,T> map_type;
+ static int asptr(PyObject *obj, map_type **val) {
+ int res = SWIG_ERROR;
+ SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+ if (PyDict_Check(obj)) {
+ SwigVar_PyObject items = PyObject_CallMethod(obj,(char *)"items",NULL);
+#if PY_VERSION_HEX >= 0x03000000
+ /* In Python 3.x the ".items()" method returns a dict_items object */
+ items = PySequence_Fast(items, ".items() didn't return a sequence!");
+#endif
+ res = traits_asptr_stdseq<std::map<K,T>, std::pair<K, T> >::asptr(items, val);
+ } else {
+ map_type *p;
+ res = SWIG_ConvertPtr(obj,(void**)&p,swig::type_info<map_type>(),0);
+ if (SWIG_IsOK(res) && val) *val = p;
+ }
+ SWIG_PYTHON_THREAD_END_BLOCK;
+ return res;
+ }
+ };
+
+ template <class K, class T >
+ struct traits_from<std::map<K,T> > {
+ typedef std::map<K,T> map_type;
+ typedef typename map_type::const_iterator const_iterator;
+ typedef typename map_type::size_type size_type;
+
+ static PyObject *from(const map_type& map) {
+ swig_type_info *desc = swig::type_info<map_type>();
+ if (desc && desc->clientdata) {
+ return SWIG_NewPointerObj(new map_type(map), desc, SWIG_POINTER_OWN);
+ } else {
+ SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+ size_type size = map.size();
+ int pysize = (size <= (size_type) INT_MAX) ? (int) size : -1;
+ if (pysize < 0) {
+ PyErr_SetString(PyExc_OverflowError,
+ "map size not valid in python");
+ SWIG_PYTHON_THREAD_END_BLOCK;
+ return NULL;
+ }
+ PyObject *obj = PyDict_New();
+ for (const_iterator i= map.begin(); i!= map.end(); ++i) {
+ swig::SwigVar_PyObject key = swig::from(i->first);
+ swig::SwigVar_PyObject val = swig::from(i->second);
+ PyDict_SetItem(obj, key, val);
+ }
+ SWIG_PYTHON_THREAD_END_BLOCK;
+ return obj;
+ }
+ }
+ };
+
+ template <class ValueType>
+ struct from_key_oper
+ {
+ typedef const ValueType& argument_type;
+ typedef PyObject *result_type;
+ result_type operator()(argument_type v) const
+ {
+ return swig::from(v.first);
+ }
+ };
+
+ template <class ValueType>
+ struct from_value_oper
+ {
+ typedef const ValueType& argument_type;
+ typedef PyObject *result_type;
+ result_type operator()(argument_type v) const
+ {
+ return swig::from(v.second);
+ }
+ };
+
+ template<class OutIterator, class FromOper, class ValueType = typename OutIterator::value_type>
+ struct SwigPyMapIterator_T : SwigPyIteratorClosed_T<OutIterator, ValueType, FromOper>
+ {
+ SwigPyMapIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq)
+ : SwigPyIteratorClosed_T<OutIterator,ValueType,FromOper>(curr, first, last, seq)
+ {
+ }
+ };
+
+
+ template<class OutIterator,
+ class FromOper = from_key_oper<typename OutIterator::value_type> >
+ struct SwigPyMapKeyIterator_T : SwigPyMapIterator_T<OutIterator, FromOper>
+ {
+ SwigPyMapKeyIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq)
+ : SwigPyMapIterator_T<OutIterator, FromOper>(curr, first, last, seq)
+ {
+ }
+ };
+
+ template<typename OutIter>
+ inline SwigPyIterator*
+ make_output_key_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, PyObject *seq = 0)
+ {
+ return new SwigPyMapKeyIterator_T<OutIter>(current, begin, end, seq);
+ }
+
+ template<class OutIterator,
+ class FromOper = from_value_oper<typename OutIterator::value_type> >
+ struct SwigPyMapValueITerator_T : SwigPyMapIterator_T<OutIterator, FromOper>
+ {
+ SwigPyMapValueITerator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq)
+ : SwigPyMapIterator_T<OutIterator, FromOper>(curr, first, last, seq)
+ {
+ }
+ };
+
+
+ template<typename OutIter>
+ inline SwigPyIterator*
+ make_output_value_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, PyObject *seq = 0)
+ {
+ return new SwigPyMapValueITerator_T<OutIter>(current, begin, end, seq);
+ }
+ }
+
+
+ namespace swig {
+ template <> struct traits<std::map<std::string, int, std::less< std::string >, std::allocator< std::pair< std::string const,int > > > > {
+ typedef pointer_category category;
+ static const char* type_name() {
+ return "std::map<" "std::string" "," "int" "," "std::less< std::string >" "," "std::allocator< std::pair< std::string const,int > >" " >";
+ }
+ };
+ }
+
+SWIGINTERN swig::SwigPyIterator *std_map_Sl_std_string_Sc_int_Sg__iterator(std::map< std::string,int > *self,PyObject **PYTHON_SELF){
+ return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+ }
+SWIGINTERN bool std_map_Sl_std_string_Sc_int_Sg____nonzero__(std::map< std::string,int > const *self){
+ return !(self->empty());
+ }
+SWIGINTERN bool std_map_Sl_std_string_Sc_int_Sg____bool__(std::map< std::string,int > const *self){
+ return !(self->empty());
+ }
+SWIGINTERN std::map< std::string,int >::size_type std_map_Sl_std_string_Sc_int_Sg____len__(std::map< std::string,int > const *self){
+ return self->size();
+ }
+SWIGINTERN std::map< std::string,int >::mapped_type std_map_Sl_std_string_Sc_int_Sg____getitem__(std::map< std::string,int > const *self,std::map< std::string,int >::key_type const &key){
+ std::map<std::string,int,std::less< std::string >,std::allocator< std::pair< std::string const,int > > >::const_iterator i = self->find(key);
+ if (i != self->end())
+ return i->second;
+ else
+ throw std::out_of_range("key not found");
+ }
+SWIGINTERN void std_map_Sl_std_string_Sc_int_Sg____delitem__(std::map< std::string,int > *self,std::map< std::string,int >::key_type const &key){
+ std::map<std::string,int,std::less< std::string >,std::allocator< std::pair< std::string const,int > > >::iterator i = self->find(key);
+ if (i != self->end())
+ self->erase(i);
+ else
+ throw std::out_of_range("key not found");
+ }
+SWIGINTERN bool std_map_Sl_std_string_Sc_int_Sg__has_key(std::map< std::string,int > const *self,std::map< std::string,int >::key_type const &key){
+ std::map<std::string,int,std::less< std::string >,std::allocator< std::pair< std::string const,int > > >::const_iterator i = self->find(key);
+ return i != self->end();
+ }
+SWIGINTERN PyObject *std_map_Sl_std_string_Sc_int_Sg__keys(std::map< std::string,int > *self){
+ std::map<std::string,int,std::less< std::string >,std::allocator< std::pair< std::string const,int > > >::size_type size = self->size();
+ int pysize = (size <= (std::map<std::string,int,std::less< std::string >,std::allocator< std::pair< std::string const,int > > >::size_type) INT_MAX) ? (int) size : -1;
+ SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+ if (pysize < 0) {
+ PyErr_SetString(PyExc_OverflowError,
+ "map size not valid in python");
+ SWIG_PYTHON_THREAD_END_BLOCK;
+ return NULL;
+ }
+ PyObject* keyList = PyList_New(pysize);
+ std::map<std::string,int,std::less< std::string >,std::allocator< std::pair< std::string const,int > > >::const_iterator i = self->begin();
+ for (int j = 0; j < pysize; ++i, ++j) {
+ PyList_SET_ITEM(keyList, j, swig::from(i->first));
+ }
+ SWIG_PYTHON_THREAD_END_BLOCK;
+ return keyList;
+ }
+SWIGINTERN PyObject *std_map_Sl_std_string_Sc_int_Sg__values(std::map< std::string,int > *self){
+ std::map<std::string,int,std::less< std::string >,std::allocator< std::pair< std::string const,int > > >::size_type size = self->size();
+ int pysize = (size <= (std::map<std::string,int,std::less< std::string >,std::allocator< std::pair< std::string const,int > > >::size_type) INT_MAX) ? (int) size : -1;
+ SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+ if (pysize < 0) {
+ PyErr_SetString(PyExc_OverflowError,
+ "map size not valid in python");
+ SWIG_PYTHON_THREAD_END_BLOCK;
+ return NULL;
+ }
+ PyObject* valList = PyList_New(pysize);
+ std::map<std::string,int,std::less< std::string >,std::allocator< std::pair< std::string const,int > > >::const_iterator i = self->begin();
+ for (int j = 0; j < pysize; ++i, ++j) {
+ PyList_SET_ITEM(valList, j, swig::from(i->second));
+ }
+ SWIG_PYTHON_THREAD_END_BLOCK;
+ return valList;
+ }
+SWIGINTERN PyObject *std_map_Sl_std_string_Sc_int_Sg__items(std::map< std::string,int > *self){
+ std::map<std::string,int,std::less< std::string >,std::allocator< std::pair< std::string const,int > > >::size_type size = self->size();
+ int pysize = (size <= (std::map<std::string,int,std::less< std::string >,std::allocator< std::pair< std::string const,int > > >::size_type) INT_MAX) ? (int) size : -1;
+ SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+ if (pysize < 0) {
+ PyErr_SetString(PyExc_OverflowError,
+ "map size not valid in python");
+ SWIG_PYTHON_THREAD_END_BLOCK;
+ return NULL;
+ }
+ PyObject* itemList = PyList_New(pysize);
+ std::map<std::string,int,std::less< std::string >,std::allocator< std::pair< std::string const,int > > >::const_iterator i = self->begin();
+ for (int j = 0; j < pysize; ++i, ++j) {
+ PyList_SET_ITEM(itemList, j, swig::from(*i));
+ }
+ SWIG_PYTHON_THREAD_END_BLOCK;
+ return itemList;
+ }
+SWIGINTERN bool std_map_Sl_std_string_Sc_int_Sg____contains__(std::map< std::string,int > *self,std::map< std::string,int >::key_type const &key){
+ return self->find(key) != self->end();
+ }
+SWIGINTERN swig::SwigPyIterator *std_map_Sl_std_string_Sc_int_Sg__key_iterator(std::map< std::string,int > *self,PyObject **PYTHON_SELF){
+ return swig::make_output_key_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+ }
+SWIGINTERN swig::SwigPyIterator *std_map_Sl_std_string_Sc_int_Sg__value_iterator(std::map< std::string,int > *self,PyObject **PYTHON_SELF){
+ return swig::make_output_value_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+ }
+SWIGINTERN void std_map_Sl_std_string_Sc_int_Sg____setitem__(std::map< std::string,int > *self,std::map< std::string,int >::key_type const &key,std::map< std::string,int >::mapped_type const &x){
+ (*self)[key] = x;
+ }
+
+SWIGINTERN int
+SWIG_AsVal_bool (PyObject *obj, bool *val)
+{
+ int r = PyObject_IsTrue(obj);
+ if (r == -1)
+ return SWIG_ERROR;
+ if (val) *val = r ? true : false;
+ return SWIG_OK;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val)
+{
+ unsigned long v;
+ int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
+ if (SWIG_IsOK(res)) {
+ if ((v > UINT_MAX)) {
+ return SWIG_OverflowError;
+ } else {
+ if (val) *val = static_cast< unsigned int >(v);
+ }
+ }
+ return res;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_float (PyObject * obj, float *val)
+{
+ double v;
+ int res = SWIG_AsVal_double (obj, &v);
+ if (SWIG_IsOK(res)) {
+ if ((v < -FLT_MAX || v > FLT_MAX)) {
+ return SWIG_OverflowError;
+ } else {
+ if (val) *val = static_cast< float >(v);
+ }
+ }
+ return res;
+}
+
+
+ #define SWIG_From_double PyFloat_FromDouble
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+SWIGINTERN PyObject *_wrap_delete_SwigPyIterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:delete_SwigPyIterator",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SwigPyIterator" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
+ }
+ arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+ delete arg1;
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_value",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_value" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
+ }
+ arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+ try {
+ result = (PyObject *)((swig::SwigPyIterator const *)arg1)->value();
+ }
+ catch(swig::stop_iteration &_e) {
+ {
+ (void)_e;
+ SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+ SWIG_fail;
+ }
+ }
+
+ resultobj = result;
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+ size_t arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ size_t val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ swig::SwigPyIterator *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_incr",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_incr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
+ }
+ arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+ ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_incr" "', argument " "2"" of type '" "size_t""'");
+ }
+ arg2 = static_cast< size_t >(val2);
+ try {
+ result = (swig::SwigPyIterator *)(arg1)->incr(arg2);
+ }
+ catch(swig::stop_iteration &_e) {
+ {
+ (void)_e;
+ SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+ SWIG_fail;
+ }
+ }
+
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ swig::SwigPyIterator *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_incr",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_incr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
+ }
+ arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+ try {
+ result = (swig::SwigPyIterator *)(arg1)->incr();
+ }
+ catch(swig::stop_iteration &_e) {
+ {
+ (void)_e;
+ SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+ SWIG_fail;
+ }
+ }
+
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_incr(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[3];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 2); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 1) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_SwigPyIterator_incr__SWIG_1(self, args);
+ }
+ }
+ if (argc == 2) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_size_t(argv[1], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_SwigPyIterator_incr__SWIG_0(self, args);
+ }
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'SwigPyIterator_incr'.\n"
+ " Possible C/C++ prototypes are:\n"
+ " incr(swig::SwigPyIterator *,size_t)\n"
+ " incr(swig::SwigPyIterator *)\n");
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+ size_t arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ size_t val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ swig::SwigPyIterator *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_decr",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_decr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
+ }
+ arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+ ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_decr" "', argument " "2"" of type '" "size_t""'");
+ }
+ arg2 = static_cast< size_t >(val2);
+ try {
+ result = (swig::SwigPyIterator *)(arg1)->decr(arg2);
+ }
+ catch(swig::stop_iteration &_e) {
+ {
+ (void)_e;
+ SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+ SWIG_fail;
+ }
+ }
+
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ swig::SwigPyIterator *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_decr",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_decr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
+ }
+ arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+ try {
+ result = (swig::SwigPyIterator *)(arg1)->decr();
+ }
+ catch(swig::stop_iteration &_e) {
+ {
+ (void)_e;
+ SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+ SWIG_fail;
+ }
+ }
+
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_decr(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[3];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 2); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 1) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_SwigPyIterator_decr__SWIG_1(self, args);
+ }
+ }
+ if (argc == 2) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_size_t(argv[1], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_SwigPyIterator_decr__SWIG_0(self, args);
+ }
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'SwigPyIterator_decr'.\n"
+ " Possible C/C++ prototypes are:\n"
+ " decr(swig::SwigPyIterator *,size_t)\n"
+ " decr(swig::SwigPyIterator *)\n");
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_distance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+ swig::SwigPyIterator *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ ptrdiff_t result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_distance",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_distance" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
+ }
+ arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator_distance" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
+ }
+ if (!argp2) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator_distance" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
+ }
+ arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
+ try {
+ result = ((swig::SwigPyIterator const *)arg1)->distance((swig::SwigPyIterator const &)*arg2);
+ }
+ catch(std::invalid_argument &_e) {
+ SWIG_Python_Raise(SWIG_NewPointerObj((new std::invalid_argument(static_cast< const std::invalid_argument& >(_e))),SWIGTYPE_p_std__invalid_argument,SWIG_POINTER_OWN), "std::invalid_argument", SWIGTYPE_p_std__invalid_argument); SWIG_fail;
+ }
+
+ resultobj = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_equal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+ swig::SwigPyIterator *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_equal",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_equal" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
+ }
+ arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator_equal" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
+ }
+ if (!argp2) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator_equal" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
+ }
+ arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
+ try {
+ result = (bool)((swig::SwigPyIterator const *)arg1)->equal((swig::SwigPyIterator const &)*arg2);
+ }
+ catch(std::invalid_argument &_e) {
+ SWIG_Python_Raise(SWIG_NewPointerObj((new std::invalid_argument(static_cast< const std::invalid_argument& >(_e))),SWIGTYPE_p_std__invalid_argument,SWIG_POINTER_OWN), "std::invalid_argument", SWIGTYPE_p_std__invalid_argument); SWIG_fail;
+ }
+
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ swig::SwigPyIterator *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_copy",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_copy" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
+ }
+ arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+ result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->copy();
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_next",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_next" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
+ }
+ arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+ try {
+ result = (PyObject *)(arg1)->next();
+ }
+ catch(swig::stop_iteration &_e) {
+ {
+ (void)_e;
+ SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+ SWIG_fail;
+ }
+ }
+
+ resultobj = result;
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___next__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator___next__",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___next__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
+ }
+ arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+ try {
+ result = (PyObject *)(arg1)->__next__();
+ }
+ catch(swig::stop_iteration &_e) {
+ {
+ (void)_e;
+ SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+ SWIG_fail;
+ }
+ }
+
+ resultobj = result;
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_previous(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_previous",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_previous" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
+ }
+ arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+ try {
+ result = (PyObject *)(arg1)->previous();
+ }
+ catch(swig::stop_iteration &_e) {
+ {
+ (void)_e;
+ SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+ SWIG_fail;
+ }
+ }
+
+ resultobj = result;
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_advance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+ ptrdiff_t arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ ptrdiff_t val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ swig::SwigPyIterator *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_advance",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_advance" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
+ }
+ arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+ ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_advance" "', argument " "2"" of type '" "ptrdiff_t""'");
+ }
+ arg2 = static_cast< ptrdiff_t >(val2);
+ try {
+ result = (swig::SwigPyIterator *)(arg1)->advance(arg2);
+ }
+ catch(swig::stop_iteration &_e) {
+ {
+ (void)_e;
+ SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+ SWIG_fail;
+ }
+ }
+
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+ swig::SwigPyIterator *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___eq__",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___eq__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
+ }
+ arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___eq__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
+ }
+ if (!argp2) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___eq__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
+ }
+ arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
+ result = (bool)((swig::SwigPyIterator const *)arg1)->operator ==((swig::SwigPyIterator const &)*arg2);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___ne__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+ swig::SwigPyIterator *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___ne__",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___ne__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
+ }
+ arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___ne__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
+ }
+ if (!argp2) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___ne__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
+ }
+ arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
+ result = (bool)((swig::SwigPyIterator const *)arg1)->operator !=((swig::SwigPyIterator const &)*arg2);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___iadd__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+ ptrdiff_t arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ ptrdiff_t val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ swig::SwigPyIterator *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___iadd__",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___iadd__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
+ }
+ arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+ ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___iadd__" "', argument " "2"" of type '" "ptrdiff_t""'");
+ }
+ arg2 = static_cast< ptrdiff_t >(val2);
+ try {
+ result = (swig::SwigPyIterator *) &(arg1)->operator +=(arg2);
+ }
+ catch(swig::stop_iteration &_e) {
+ {
+ (void)_e;
+ SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+ SWIG_fail;
+ }
+ }
+
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___isub__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+ ptrdiff_t arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ ptrdiff_t val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ swig::SwigPyIterator *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___isub__",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___isub__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
+ }
+ arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+ ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___isub__" "', argument " "2"" of type '" "ptrdiff_t""'");
+ }
+ arg2 = static_cast< ptrdiff_t >(val2);
+ try {
+ result = (swig::SwigPyIterator *) &(arg1)->operator -=(arg2);
+ }
+ catch(swig::stop_iteration &_e) {
+ {
+ (void)_e;
+ SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+ SWIG_fail;
+ }
+ }
+
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___add__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+ ptrdiff_t arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ ptrdiff_t val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ swig::SwigPyIterator *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___add__",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___add__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
+ }
+ arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+ ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___add__" "', argument " "2"" of type '" "ptrdiff_t""'");
+ }
+ arg2 = static_cast< ptrdiff_t >(val2);
+ try {
+ result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->operator +(arg2);
+ }
+ catch(swig::stop_iteration &_e) {
+ {
+ (void)_e;
+ SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+ SWIG_fail;
+ }
+ }
+
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+ ptrdiff_t arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ ptrdiff_t val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ swig::SwigPyIterator *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___sub__",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___sub__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
+ }
+ arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+ ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "ptrdiff_t""'");
+ }
+ arg2 = static_cast< ptrdiff_t >(val2);
+ try {
+ result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->operator -(arg2);
+ }
+ catch(swig::stop_iteration &_e) {
+ {
+ (void)_e;
+ SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+ SWIG_fail;
+ }
+ }
+
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+ swig::SwigPyIterator *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ ptrdiff_t result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___sub__",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___sub__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
+ }
+ arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
+ }
+ if (!argp2) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
+ }
+ arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
+ result = ((swig::SwigPyIterator const *)arg1)->operator -((swig::SwigPyIterator const &)*arg2);
+ resultobj = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___sub__(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[3];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 2); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 2) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_swig__SwigPyIterator, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_SwigPyIterator___sub____SWIG_1(self, args);
+ }
+ }
+ }
+ if (argc == 2) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_SwigPyIterator___sub____SWIG_0(self, args);
+ }
+ }
+ }
+
+fail:
+ Py_INCREF(Py_NotImplemented);
+ return Py_NotImplemented;
+}
+
+
+SWIGINTERN PyObject *SwigPyIterator_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *obj;
+ if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+ SWIG_TypeNewClientData(SWIGTYPE_p_swig__SwigPyIterator, SWIG_NewClientData(obj));
+ return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_StrList_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ PyObject **arg2 = (PyObject **) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ swig::SwigPyIterator *result = 0 ;
+
+ arg2 = &obj0;
+ if (!PyArg_ParseTuple(args,(char *)"O:StrList_iterator",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_iterator" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ result = (swig::SwigPyIterator *)std_vector_Sl_std_string_Sg__iterator(arg1,arg2);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:StrList___nonzero__",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList___nonzero__" "', argument " "1"" of type '" "std::vector< std::string > const *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ result = (bool)std_vector_Sl_std_string_Sg____nonzero__((std::vector< std::string > const *)arg1);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList___bool__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:StrList___bool__",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList___bool__" "', argument " "1"" of type '" "std::vector< std::string > const *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ result = (bool)std_vector_Sl_std_string_Sg____bool__((std::vector< std::string > const *)arg1);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::vector< std::string >::size_type result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:StrList___len__",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList___len__" "', argument " "1"" of type '" "std::vector< std::string > const *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ result = std_vector_Sl_std_string_Sg____len__((std::vector< std::string > const *)arg1);
+ resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_pop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::vector< std::string >::value_type result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:StrList_pop",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_pop" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ try {
+ result = std_vector_Sl_std_string_Sg__pop(arg1);
+ }
+ catch(std::out_of_range &_e) {
+ SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+ }
+
+ resultobj = SWIG_From_std_string(static_cast< std::string >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList___getslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ std::vector< std::string >::difference_type arg2 ;
+ std::vector< std::string >::difference_type arg3 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ ptrdiff_t val2 ;
+ int ecode2 = 0 ;
+ ptrdiff_t val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ std::vector< std::string,std::allocator< std::string > > *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:StrList___getslice__",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList___getslice__" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StrList___getslice__" "', argument " "2"" of type '" "std::vector< std::string >::difference_type""'");
+ }
+ arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+ ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "StrList___getslice__" "', argument " "3"" of type '" "std::vector< std::string >::difference_type""'");
+ }
+ arg3 = static_cast< std::vector< std::string >::difference_type >(val3);
+ try {
+ result = (std::vector< std::string,std::allocator< std::string > > *)std_vector_Sl_std_string_Sg____getslice__(arg1,arg2,arg3);
+ }
+ catch(std::out_of_range &_e) {
+ SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+ }
+
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_OWN | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList___setslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ std::vector< std::string >::difference_type arg2 ;
+ std::vector< std::string >::difference_type arg3 ;
+ std::vector< std::string,std::allocator< std::string > > *arg4 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ ptrdiff_t val2 ;
+ int ecode2 = 0 ;
+ ptrdiff_t val3 ;
+ int ecode3 = 0 ;
+ int res4 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOOO:StrList___setslice__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList___setslice__" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StrList___setslice__" "', argument " "2"" of type '" "std::vector< std::string >::difference_type""'");
+ }
+ arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+ ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "StrList___setslice__" "', argument " "3"" of type '" "std::vector< std::string >::difference_type""'");
+ }
+ arg3 = static_cast< std::vector< std::string >::difference_type >(val3);
+ {
+ std::vector<std::string,std::allocator< std::string > > *ptr = (std::vector<std::string,std::allocator< std::string > > *)0;
+ res4 = swig::asptr(obj3, &ptr);
+ if (!SWIG_IsOK(res4)) {
+ SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "StrList___setslice__" "', argument " "4"" of type '" "std::vector< std::string,std::allocator< std::string > > const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StrList___setslice__" "', argument " "4"" of type '" "std::vector< std::string,std::allocator< std::string > > const &""'");
+ }
+ arg4 = ptr;
+ }
+ try {
+ std_vector_Sl_std_string_Sg____setslice__(arg1,arg2,arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4);
+ }
+ catch(std::out_of_range &_e) {
+ SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+ }
+ catch(std::invalid_argument &_e) {
+ SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+ }
+
+ resultobj = SWIG_Py_Void();
+ if (SWIG_IsNewObj(res4)) delete arg4;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res4)) delete arg4;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList___delslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ std::vector< std::string >::difference_type arg2 ;
+ std::vector< std::string >::difference_type arg3 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ ptrdiff_t val2 ;
+ int ecode2 = 0 ;
+ ptrdiff_t val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:StrList___delslice__",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList___delslice__" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StrList___delslice__" "', argument " "2"" of type '" "std::vector< std::string >::difference_type""'");
+ }
+ arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+ ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "StrList___delslice__" "', argument " "3"" of type '" "std::vector< std::string >::difference_type""'");
+ }
+ arg3 = static_cast< std::vector< std::string >::difference_type >(val3);
+ try {
+ std_vector_Sl_std_string_Sg____delslice__(arg1,arg2,arg3);
+ }
+ catch(std::out_of_range &_e) {
+ SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+ }
+
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList___delitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ std::vector< std::string >::difference_type arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ ptrdiff_t val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:StrList___delitem__",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList___delitem__" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StrList___delitem__" "', argument " "2"" of type '" "std::vector< std::string >::difference_type""'");
+ }
+ arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+ try {
+ std_vector_Sl_std_string_Sg____delitem____SWIG_0(arg1,arg2);
+ }
+ catch(std::out_of_range &_e) {
+ SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+ }
+
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList___getitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ PySliceObject *arg2 = (PySliceObject *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ std::vector< std::string,std::allocator< std::string > > *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:StrList___getitem__",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList___getitem__" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ {
+ arg2 = (PySliceObject *) obj1;
+ }
+ try {
+ result = (std::vector< std::string,std::allocator< std::string > > *)std_vector_Sl_std_string_Sg____getitem____SWIG_0(arg1,arg2);
+ }
+ catch(std::out_of_range &_e) {
+ SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+ }
+
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList___setitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ PySliceObject *arg2 = (PySliceObject *) 0 ;
+ std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res3 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:StrList___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList___setitem__" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ {
+ arg2 = (PySliceObject *) obj1;
+ }
+ {
+ std::vector<std::string,std::allocator< std::string > > *ptr = (std::vector<std::string,std::allocator< std::string > > *)0;
+ res3 = swig::asptr(obj2, &ptr);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "StrList___setitem__" "', argument " "3"" of type '" "std::vector< std::string,std::allocator< std::string > > const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StrList___setitem__" "', argument " "3"" of type '" "std::vector< std::string,std::allocator< std::string > > const &""'");
+ }
+ arg3 = ptr;
+ }
+ try {
+ std_vector_Sl_std_string_Sg____setitem____SWIG_0(arg1,arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3);
+ }
+ catch(std::out_of_range &_e) {
+ SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+ }
+ catch(std::invalid_argument &_e) {
+ SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+ }
+
+ resultobj = SWIG_Py_Void();
+ if (SWIG_IsNewObj(res3)) delete arg3;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res3)) delete arg3;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList___delitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ PySliceObject *arg2 = (PySliceObject *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:StrList___delitem__",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList___delitem__" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ {
+ arg2 = (PySliceObject *) obj1;
+ }
+ try {
+ std_vector_Sl_std_string_Sg____delitem____SWIG_1(arg1,arg2);
+ }
+ catch(std::out_of_range &_e) {
+ SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+ }
+
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList___delitem__(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[3];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 2); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 2) {
+ int _v;
+ int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ _v = PySlice_Check(argv[1]);
+ }
+ if (_v) {
+ return _wrap_StrList___delitem____SWIG_1(self, args);
+ }
+ }
+ }
+ if (argc == 2) {
+ int _v;
+ int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_StrList___delitem____SWIG_0(self, args);
+ }
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'StrList___delitem__'.\n"
+ " Possible C/C++ prototypes are:\n"
+ " __delitem__(std::vector< std::string > *,std::vector< std::string >::difference_type)\n"
+ " __delitem__(std::vector< std::string > *,PySliceObject *)\n");
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList___getitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ std::vector< std::string >::difference_type arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ ptrdiff_t val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ std::vector< std::string >::value_type *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:StrList___getitem__",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList___getitem__" "', argument " "1"" of type '" "std::vector< std::string > const *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StrList___getitem__" "', argument " "2"" of type '" "std::vector< std::string >::difference_type""'");
+ }
+ arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+ try {
+ result = (std::vector< std::string >::value_type *) &std_vector_Sl_std_string_Sg____getitem____SWIG_1((std::vector< std::string > const *)arg1,arg2);
+ }
+ catch(std::out_of_range &_e) {
+ SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+ }
+
+ resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList___getitem__(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[3];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 2); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 2) {
+ int _v;
+ int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ _v = PySlice_Check(argv[1]);
+ }
+ if (_v) {
+ return _wrap_StrList___getitem____SWIG_0(self, args);
+ }
+ }
+ }
+ if (argc == 2) {
+ int _v;
+ int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_StrList___getitem____SWIG_1(self, args);
+ }
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'StrList___getitem__'.\n"
+ " Possible C/C++ prototypes are:\n"
+ " __getitem__(std::vector< std::string > *,PySliceObject *)\n"
+ " __getitem__(std::vector< std::string > const *,std::vector< std::string >::difference_type)\n");
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList___setitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ std::vector< std::string >::difference_type arg2 ;
+ std::vector< std::string >::value_type *arg3 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ ptrdiff_t val2 ;
+ int ecode2 = 0 ;
+ int res3 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:StrList___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList___setitem__" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StrList___setitem__" "', argument " "2"" of type '" "std::vector< std::string >::difference_type""'");
+ }
+ arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+ {
+ std::string *ptr = (std::string *)0;
+ res3 = SWIG_AsPtr_std_string(obj2, &ptr);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "StrList___setitem__" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StrList___setitem__" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'");
+ }
+ arg3 = ptr;
+ }
+ try {
+ std_vector_Sl_std_string_Sg____setitem____SWIG_1(arg1,arg2,(std::string const &)*arg3);
+ }
+ catch(std::out_of_range &_e) {
+ SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+ }
+
+ resultobj = SWIG_Py_Void();
+ if (SWIG_IsNewObj(res3)) delete arg3;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res3)) delete arg3;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList___setitem__(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[4];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 3); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 3) {
+ int _v;
+ int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ _v = PySlice_Check(argv[1]);
+ }
+ if (_v) {
+ int res = swig::asptr(argv[2], (std::vector<std::string,std::allocator< std::string > >**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_StrList___setitem____SWIG_0(self, args);
+ }
+ }
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_StrList___setitem____SWIG_1(self, args);
+ }
+ }
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'StrList___setitem__'.\n"
+ " Possible C/C++ prototypes are:\n"
+ " __setitem__(std::vector< std::string > *,PySliceObject *,std::vector< std::string,std::allocator< std::string > > const &)\n"
+ " __setitem__(std::vector< std::string > *,std::vector< std::string >::difference_type,std::vector< std::string >::value_type const &)\n");
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ std::vector< std::string >::value_type *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:StrList_append",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_append" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "StrList_append" "', argument " "2"" of type '" "std::vector< std::string >::value_type const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StrList_append" "', argument " "2"" of type '" "std::vector< std::string >::value_type const &""'");
+ }
+ arg2 = ptr;
+ }
+ std_vector_Sl_std_string_Sg__append(arg1,(std::string const &)*arg2);
+ resultobj = SWIG_Py_Void();
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_StrList__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)":new_StrList")) SWIG_fail;
+ result = (std::vector< std::string > *)new std::vector< std::string >();
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_NEW | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_StrList__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = 0 ;
+ int res1 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ std::vector< std::string > *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:new_StrList",&obj0)) SWIG_fail;
+ {
+ std::vector<std::string,std::allocator< std::string > > *ptr = (std::vector<std::string,std::allocator< std::string > > *)0;
+ res1 = swig::asptr(obj0, &ptr);
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_StrList" "', argument " "1"" of type '" "std::vector< std::string > const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_StrList" "', argument " "1"" of type '" "std::vector< std::string > const &""'");
+ }
+ arg1 = ptr;
+ }
+ result = (std::vector< std::string > *)new std::vector< std::string >((std::vector< std::string > const &)*arg1);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_NEW | 0 );
+ if (SWIG_IsNewObj(res1)) delete arg1;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res1)) delete arg1;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:StrList_empty",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_empty" "', argument " "1"" of type '" "std::vector< std::string > const *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ result = (bool)((std::vector< std::string > const *)arg1)->empty();
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::vector< std::string >::size_type result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:StrList_size",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_size" "', argument " "1"" of type '" "std::vector< std::string > const *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ result = ((std::vector< std::string > const *)arg1)->size();
+ resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:StrList_clear",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_clear" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ (arg1)->clear();
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ std::vector< std::string > *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:StrList_swap",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_swap" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 );
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "StrList_swap" "', argument " "2"" of type '" "std::vector< std::string > &""'");
+ }
+ if (!argp2) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StrList_swap" "', argument " "2"" of type '" "std::vector< std::string > &""'");
+ }
+ arg2 = reinterpret_cast< std::vector< std::string > * >(argp2);
+ (arg1)->swap(*arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ SwigValueWrapper< std::allocator< std::string > > result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:StrList_get_allocator",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_get_allocator" "', argument " "1"" of type '" "std::vector< std::string > const *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ result = ((std::vector< std::string > const *)arg1)->get_allocator();
+ resultobj = SWIG_NewPointerObj((new std::vector< std::string >::allocator_type(static_cast< const std::vector< std::string >::allocator_type& >(result))), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t__allocator_type, SWIG_POINTER_OWN | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_begin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::vector< std::string >::const_iterator result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:StrList_begin",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_begin" "', argument " "1"" of type '" "std::vector< std::string > const *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ result = ((std::vector< std::string > const *)arg1)->begin();
+ resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::const_iterator & >(result)),
+ swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_end(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::vector< std::string >::const_iterator result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:StrList_end",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_end" "', argument " "1"" of type '" "std::vector< std::string > const *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ result = ((std::vector< std::string > const *)arg1)->end();
+ resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::const_iterator & >(result)),
+ swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_rbegin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::vector< std::string >::const_reverse_iterator result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:StrList_rbegin",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_rbegin" "', argument " "1"" of type '" "std::vector< std::string > const *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ result = ((std::vector< std::string > const *)arg1)->rbegin();
+ resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::const_reverse_iterator & >(result)),
+ swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_rend(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::vector< std::string >::const_reverse_iterator result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:StrList_rend",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_rend" "', argument " "1"" of type '" "std::vector< std::string > const *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ result = ((std::vector< std::string > const *)arg1)->rend();
+ resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::const_reverse_iterator & >(result)),
+ swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_StrList__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string >::size_type arg1 ;
+ size_t val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::vector< std::string > *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:new_StrList",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_size_t(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_StrList" "', argument " "1"" of type '" "std::vector< std::string >::size_type""'");
+ }
+ arg1 = static_cast< std::vector< std::string >::size_type >(val1);
+ result = (std::vector< std::string > *)new std::vector< std::string >(arg1);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_NEW | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_pop_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:StrList_pop_back",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_pop_back" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ (arg1)->pop_back();
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_resize__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ std::vector< std::string >::size_type arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ size_t val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:StrList_resize",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_resize" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StrList_resize" "', argument " "2"" of type '" "std::vector< std::string >::size_type""'");
+ }
+ arg2 = static_cast< std::vector< std::string >::size_type >(val2);
+ (arg1)->resize(arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ std::vector< std::string >::iterator arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ swig::SwigPyIterator *iter2 = 0 ;
+ int res2 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ std::vector< std::string >::iterator result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:StrList_erase",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_erase" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+ if (!SWIG_IsOK(res2) || !iter2) {
+ SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StrList_erase" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'");
+ } else {
+ swig::SwigPyIterator_T<std::vector< std::string >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter2);
+ if (iter_t) {
+ arg2 = iter_t->get_current();
+ } else {
+ SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StrList_erase" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'");
+ }
+ }
+ result = (arg1)->erase(arg2);
+ resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::iterator & >(result)),
+ swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ std::vector< std::string >::iterator arg2 ;
+ std::vector< std::string >::iterator arg3 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ swig::SwigPyIterator *iter2 = 0 ;
+ int res2 ;
+ swig::SwigPyIterator *iter3 = 0 ;
+ int res3 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ std::vector< std::string >::iterator result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:StrList_erase",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_erase" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+ if (!SWIG_IsOK(res2) || !iter2) {
+ SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StrList_erase" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'");
+ } else {
+ swig::SwigPyIterator_T<std::vector< std::string >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter2);
+ if (iter_t) {
+ arg2 = iter_t->get_current();
+ } else {
+ SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StrList_erase" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'");
+ }
+ }
+ res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::SwigPyIterator::descriptor(), 0);
+ if (!SWIG_IsOK(res3) || !iter3) {
+ SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StrList_erase" "', argument " "3"" of type '" "std::vector< std::string >::iterator""'");
+ } else {
+ swig::SwigPyIterator_T<std::vector< std::string >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter3);
+ if (iter_t) {
+ arg3 = iter_t->get_current();
+ } else {
+ SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StrList_erase" "', argument " "3"" of type '" "std::vector< std::string >::iterator""'");
+ }
+ }
+ result = (arg1)->erase(arg2,arg3);
+ resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::iterator & >(result)),
+ swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_erase(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[4];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 3); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 2) {
+ int _v;
+ int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ swig::SwigPyIterator *iter = 0;
+ int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+ _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter) != 0));
+ if (_v) {
+ return _wrap_StrList_erase__SWIG_0(self, args);
+ }
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ swig::SwigPyIterator *iter = 0;
+ int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+ _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter) != 0));
+ if (_v) {
+ swig::SwigPyIterator *iter = 0;
+ int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+ _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter) != 0));
+ if (_v) {
+ return _wrap_StrList_erase__SWIG_1(self, args);
+ }
+ }
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'StrList_erase'.\n"
+ " Possible C/C++ prototypes are:\n"
+ " erase(std::vector< std::string > *,std::vector< std::string >::iterator)\n"
+ " erase(std::vector< std::string > *,std::vector< std::string >::iterator,std::vector< std::string >::iterator)\n");
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_StrList__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string >::size_type arg1 ;
+ std::vector< std::string >::value_type *arg2 = 0 ;
+ size_t val1 ;
+ int ecode1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ std::vector< std::string > *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:new_StrList",&obj0,&obj1)) SWIG_fail;
+ ecode1 = SWIG_AsVal_size_t(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_StrList" "', argument " "1"" of type '" "std::vector< std::string >::size_type""'");
+ }
+ arg1 = static_cast< std::vector< std::string >::size_type >(val1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_StrList" "', argument " "2"" of type '" "std::vector< std::string >::value_type const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_StrList" "', argument " "2"" of type '" "std::vector< std::string >::value_type const &""'");
+ }
+ arg2 = ptr;
+ }
+ result = (std::vector< std::string > *)new std::vector< std::string >(arg1,(std::vector< std::string >::value_type const &)*arg2);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_NEW | 0 );
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_StrList(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[3];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 2); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 0) {
+ return _wrap_new_StrList__SWIG_0(self, args);
+ }
+ if (argc == 1) {
+ int _v;
+ {
+ int res = SWIG_AsVal_size_t(argv[0], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_new_StrList__SWIG_2(self, args);
+ }
+ }
+ if (argc == 1) {
+ int _v;
+ int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_new_StrList__SWIG_1(self, args);
+ }
+ }
+ if (argc == 2) {
+ int _v;
+ {
+ int res = SWIG_AsVal_size_t(argv[0], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_new_StrList__SWIG_3(self, args);
+ }
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_StrList'.\n"
+ " Possible C/C++ prototypes are:\n"
+ " std::vector< std::string >()\n"
+ " std::vector< std::string >(std::vector< std::string > const &)\n"
+ " std::vector< std::string >(std::vector< std::string >::size_type)\n"
+ " std::vector< std::string >(std::vector< std::string >::size_type,std::vector< std::string >::value_type const &)\n");
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ std::vector< std::string >::value_type *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:StrList_push_back",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_push_back" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "StrList_push_back" "', argument " "2"" of type '" "std::vector< std::string >::value_type const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StrList_push_back" "', argument " "2"" of type '" "std::vector< std::string >::value_type const &""'");
+ }
+ arg2 = ptr;
+ }
+ (arg1)->push_back((std::vector< std::string >::value_type const &)*arg2);
+ resultobj = SWIG_Py_Void();
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_front(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::vector< std::string >::value_type *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:StrList_front",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_front" "', argument " "1"" of type '" "std::vector< std::string > const *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ result = (std::vector< std::string >::value_type *) &((std::vector< std::string > const *)arg1)->front();
+ resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::vector< std::string >::value_type *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:StrList_back",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_back" "', argument " "1"" of type '" "std::vector< std::string > const *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ result = (std::vector< std::string >::value_type *) &((std::vector< std::string > const *)arg1)->back();
+ resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ std::vector< std::string >::size_type arg2 ;
+ std::vector< std::string >::value_type *arg3 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ size_t val2 ;
+ int ecode2 = 0 ;
+ int res3 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:StrList_assign",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_assign" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StrList_assign" "', argument " "2"" of type '" "std::vector< std::string >::size_type""'");
+ }
+ arg2 = static_cast< std::vector< std::string >::size_type >(val2);
+ {
+ std::string *ptr = (std::string *)0;
+ res3 = SWIG_AsPtr_std_string(obj2, &ptr);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "StrList_assign" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StrList_assign" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'");
+ }
+ arg3 = ptr;
+ }
+ (arg1)->assign(arg2,(std::vector< std::string >::value_type const &)*arg3);
+ resultobj = SWIG_Py_Void();
+ if (SWIG_IsNewObj(res3)) delete arg3;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res3)) delete arg3;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_resize__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ std::vector< std::string >::size_type arg2 ;
+ std::vector< std::string >::value_type *arg3 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ size_t val2 ;
+ int ecode2 = 0 ;
+ int res3 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:StrList_resize",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_resize" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StrList_resize" "', argument " "2"" of type '" "std::vector< std::string >::size_type""'");
+ }
+ arg2 = static_cast< std::vector< std::string >::size_type >(val2);
+ {
+ std::string *ptr = (std::string *)0;
+ res3 = SWIG_AsPtr_std_string(obj2, &ptr);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "StrList_resize" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StrList_resize" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'");
+ }
+ arg3 = ptr;
+ }
+ (arg1)->resize(arg2,(std::vector< std::string >::value_type const &)*arg3);
+ resultobj = SWIG_Py_Void();
+ if (SWIG_IsNewObj(res3)) delete arg3;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res3)) delete arg3;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_resize(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[4];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 3); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 2) {
+ int _v;
+ int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_size_t(argv[1], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_StrList_resize__SWIG_0(self, args);
+ }
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_size_t(argv[1], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_StrList_resize__SWIG_1(self, args);
+ }
+ }
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'StrList_resize'.\n"
+ " Possible C/C++ prototypes are:\n"
+ " resize(std::vector< std::string > *,std::vector< std::string >::size_type)\n"
+ " resize(std::vector< std::string > *,std::vector< std::string >::size_type,std::vector< std::string >::value_type const &)\n");
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ std::vector< std::string >::iterator arg2 ;
+ std::vector< std::string >::value_type *arg3 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ swig::SwigPyIterator *iter2 = 0 ;
+ int res2 ;
+ int res3 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ std::vector< std::string >::iterator result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:StrList_insert",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_insert" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+ if (!SWIG_IsOK(res2) || !iter2) {
+ SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StrList_insert" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'");
+ } else {
+ swig::SwigPyIterator_T<std::vector< std::string >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter2);
+ if (iter_t) {
+ arg2 = iter_t->get_current();
+ } else {
+ SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StrList_insert" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'");
+ }
+ }
+ {
+ std::string *ptr = (std::string *)0;
+ res3 = SWIG_AsPtr_std_string(obj2, &ptr);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "StrList_insert" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StrList_insert" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'");
+ }
+ arg3 = ptr;
+ }
+ result = (arg1)->insert(arg2,(std::vector< std::string >::value_type const &)*arg3);
+ resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::iterator & >(result)),
+ swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+ if (SWIG_IsNewObj(res3)) delete arg3;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res3)) delete arg3;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_insert__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ std::vector< std::string >::iterator arg2 ;
+ std::vector< std::string >::size_type arg3 ;
+ std::vector< std::string >::value_type *arg4 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ swig::SwigPyIterator *iter2 = 0 ;
+ int res2 ;
+ size_t val3 ;
+ int ecode3 = 0 ;
+ int res4 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOOO:StrList_insert",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_insert" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+ if (!SWIG_IsOK(res2) || !iter2) {
+ SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StrList_insert" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'");
+ } else {
+ swig::SwigPyIterator_T<std::vector< std::string >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter2);
+ if (iter_t) {
+ arg2 = iter_t->get_current();
+ } else {
+ SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StrList_insert" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'");
+ }
+ }
+ ecode3 = SWIG_AsVal_size_t(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "StrList_insert" "', argument " "3"" of type '" "std::vector< std::string >::size_type""'");
+ }
+ arg3 = static_cast< std::vector< std::string >::size_type >(val3);
+ {
+ std::string *ptr = (std::string *)0;
+ res4 = SWIG_AsPtr_std_string(obj3, &ptr);
+ if (!SWIG_IsOK(res4)) {
+ SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "StrList_insert" "', argument " "4"" of type '" "std::vector< std::string >::value_type const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StrList_insert" "', argument " "4"" of type '" "std::vector< std::string >::value_type const &""'");
+ }
+ arg4 = ptr;
+ }
+ (arg1)->insert(arg2,arg3,(std::vector< std::string >::value_type const &)*arg4);
+ resultobj = SWIG_Py_Void();
+ if (SWIG_IsNewObj(res4)) delete arg4;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res4)) delete arg4;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_insert(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[5];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 4); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 3) {
+ int _v;
+ int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ swig::SwigPyIterator *iter = 0;
+ int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+ _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter) != 0));
+ if (_v) {
+ int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_StrList_insert__SWIG_0(self, args);
+ }
+ }
+ }
+ }
+ if (argc == 4) {
+ int _v;
+ int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ swig::SwigPyIterator *iter = 0;
+ int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+ _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter) != 0));
+ if (_v) {
+ {
+ int res = SWIG_AsVal_size_t(argv[2], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ int res = SWIG_AsPtr_std_string(argv[3], (std::string**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_StrList_insert__SWIG_1(self, args);
+ }
+ }
+ }
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'StrList_insert'.\n"
+ " Possible C/C++ prototypes are:\n"
+ " insert(std::vector< std::string > *,std::vector< std::string >::iterator,std::vector< std::string >::value_type const &)\n"
+ " insert(std::vector< std::string > *,std::vector< std::string >::iterator,std::vector< std::string >::size_type,std::vector< std::string >::value_type const &)\n");
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_reserve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ std::vector< std::string >::size_type arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ size_t val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:StrList_reserve",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_reserve" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StrList_reserve" "', argument " "2"" of type '" "std::vector< std::string >::size_type""'");
+ }
+ arg2 = static_cast< std::vector< std::string >::size_type >(val2);
+ (arg1)->reserve(arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StrList_capacity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::vector< std::string >::size_type result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:StrList_capacity",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StrList_capacity" "', argument " "1"" of type '" "std::vector< std::string > const *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ result = ((std::vector< std::string > const *)arg1)->capacity();
+ resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_StrList(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:delete_StrList",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_DISOWN | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_StrList" "', argument " "1"" of type '" "std::vector< std::string > *""'");
+ }
+ arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+ delete arg1;
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *StrList_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *obj;
+ if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+ SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_NewClientData(obj));
+ return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_LogLevelMap__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::less< std::string > *arg1 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::map< std::string,int > *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:new_LogLevelMap",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_std__lessT_std__string_t, 0 | 0);
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_LogLevelMap" "', argument " "1"" of type '" "std::less< std::string > const &""'");
+ }
+ if (!argp1) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_LogLevelMap" "', argument " "1"" of type '" "std::less< std::string > const &""'");
+ }
+ arg1 = reinterpret_cast< std::less< std::string > * >(argp1);
+ result = (std::map< std::string,int > *)new std::map< std::string,int >((std::less< std::string > const &)*arg1);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, SWIG_POINTER_NEW | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ PyObject **arg2 = (PyObject **) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ swig::SwigPyIterator *result = 0 ;
+
+ arg2 = &obj0;
+ if (!PyArg_ParseTuple(args,(char *)"O:LogLevelMap_iterator",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_iterator" "', argument " "1"" of type '" "std::map< std::string,int > *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ result = (swig::SwigPyIterator *)std_map_Sl_std_string_Sc_int_Sg__iterator(arg1,arg2);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:LogLevelMap___nonzero__",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap___nonzero__" "', argument " "1"" of type '" "std::map< std::string,int > const *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ result = (bool)std_map_Sl_std_string_Sc_int_Sg____nonzero__((std::map< std::string,int > const *)arg1);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap___bool__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:LogLevelMap___bool__",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap___bool__" "', argument " "1"" of type '" "std::map< std::string,int > const *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ result = (bool)std_map_Sl_std_string_Sc_int_Sg____bool__((std::map< std::string,int > const *)arg1);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::map< std::string,int >::size_type result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:LogLevelMap___len__",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap___len__" "', argument " "1"" of type '" "std::map< std::string,int > const *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ result = std_map_Sl_std_string_Sc_int_Sg____len__((std::map< std::string,int > const *)arg1);
+ resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ std::map< std::string,int >::key_type *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ std::map< std::string,int >::mapped_type result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:LogLevelMap___getitem__",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap___getitem__" "', argument " "1"" of type '" "std::map< std::string,int > const *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LogLevelMap___getitem__" "', argument " "2"" of type '" "std::map< std::string,int >::key_type const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "LogLevelMap___getitem__" "', argument " "2"" of type '" "std::map< std::string,int >::key_type const &""'");
+ }
+ arg2 = ptr;
+ }
+ try {
+ result = (std::map< std::string,int >::mapped_type)std_map_Sl_std_string_Sc_int_Sg____getitem__((std::map< std::string,int > const *)arg1,(std::string const &)*arg2);
+ }
+ catch(std::out_of_range &_e) {
+ SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+ }
+
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap___delitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ std::map< std::string,int >::key_type *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:LogLevelMap___delitem__",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap___delitem__" "', argument " "1"" of type '" "std::map< std::string,int > *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LogLevelMap___delitem__" "', argument " "2"" of type '" "std::map< std::string,int >::key_type const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "LogLevelMap___delitem__" "', argument " "2"" of type '" "std::map< std::string,int >::key_type const &""'");
+ }
+ arg2 = ptr;
+ }
+ try {
+ std_map_Sl_std_string_Sc_int_Sg____delitem__(arg1,(std::string const &)*arg2);
+ }
+ catch(std::out_of_range &_e) {
+ SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+ }
+
+ resultobj = SWIG_Py_Void();
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_has_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ std::map< std::string,int >::key_type *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:LogLevelMap_has_key",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_has_key" "', argument " "1"" of type '" "std::map< std::string,int > const *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LogLevelMap_has_key" "', argument " "2"" of type '" "std::map< std::string,int >::key_type const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "LogLevelMap_has_key" "', argument " "2"" of type '" "std::map< std::string,int >::key_type const &""'");
+ }
+ arg2 = ptr;
+ }
+ result = (bool)std_map_Sl_std_string_Sc_int_Sg__has_key((std::map< std::string,int > const *)arg1,(std::string const &)*arg2);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_keys(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:LogLevelMap_keys",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_keys" "', argument " "1"" of type '" "std::map< std::string,int > *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ result = (PyObject *)std_map_Sl_std_string_Sc_int_Sg__keys(arg1);
+ resultobj = result;
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_values(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:LogLevelMap_values",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_values" "', argument " "1"" of type '" "std::map< std::string,int > *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ result = (PyObject *)std_map_Sl_std_string_Sc_int_Sg__values(arg1);
+ resultobj = result;
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_items(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:LogLevelMap_items",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_items" "', argument " "1"" of type '" "std::map< std::string,int > *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ result = (PyObject *)std_map_Sl_std_string_Sc_int_Sg__items(arg1);
+ resultobj = result;
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap___contains__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ std::map< std::string,int >::key_type *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:LogLevelMap___contains__",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap___contains__" "', argument " "1"" of type '" "std::map< std::string,int > *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LogLevelMap___contains__" "', argument " "2"" of type '" "std::map< std::string,int >::key_type const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "LogLevelMap___contains__" "', argument " "2"" of type '" "std::map< std::string,int >::key_type const &""'");
+ }
+ arg2 = ptr;
+ }
+ result = (bool)std_map_Sl_std_string_Sc_int_Sg____contains__(arg1,(std::string const &)*arg2);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_key_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ PyObject **arg2 = (PyObject **) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ swig::SwigPyIterator *result = 0 ;
+
+ arg2 = &obj0;
+ if (!PyArg_ParseTuple(args,(char *)"O:LogLevelMap_key_iterator",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_key_iterator" "', argument " "1"" of type '" "std::map< std::string,int > *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ result = (swig::SwigPyIterator *)std_map_Sl_std_string_Sc_int_Sg__key_iterator(arg1,arg2);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_value_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ PyObject **arg2 = (PyObject **) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ swig::SwigPyIterator *result = 0 ;
+
+ arg2 = &obj0;
+ if (!PyArg_ParseTuple(args,(char *)"O:LogLevelMap_value_iterator",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_value_iterator" "', argument " "1"" of type '" "std::map< std::string,int > *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ result = (swig::SwigPyIterator *)std_map_Sl_std_string_Sc_int_Sg__value_iterator(arg1,arg2);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap___setitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ std::map< std::string,int >::key_type *arg2 = 0 ;
+ std::map< std::string,int >::mapped_type *arg3 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ std::map< std::string,int >::mapped_type temp3 ;
+ int val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:LogLevelMap___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap___setitem__" "', argument " "1"" of type '" "std::map< std::string,int > *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LogLevelMap___setitem__" "', argument " "2"" of type '" "std::map< std::string,int >::key_type const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "LogLevelMap___setitem__" "', argument " "2"" of type '" "std::map< std::string,int >::key_type const &""'");
+ }
+ arg2 = ptr;
+ }
+ ecode3 = SWIG_AsVal_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "LogLevelMap___setitem__" "', argument " "3"" of type '" "std::map< std::string,int >::mapped_type""'");
+ }
+ temp3 = static_cast< std::map< std::string,int >::mapped_type >(val3);
+ arg3 = &temp3;
+ try {
+ std_map_Sl_std_string_Sc_int_Sg____setitem__(arg1,(std::string const &)*arg2,(int const &)*arg3);
+ }
+ catch(std::out_of_range &_e) {
+ SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+ }
+
+ resultobj = SWIG_Py_Void();
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_LogLevelMap__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)":new_LogLevelMap")) SWIG_fail;
+ result = (std::map< std::string,int > *)new std::map< std::string,int >();
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, SWIG_POINTER_NEW | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_LogLevelMap__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = 0 ;
+ int res1 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ std::map< std::string,int > *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:new_LogLevelMap",&obj0)) SWIG_fail;
+ {
+ std::map<std::string,int,std::less< std::string >,std::allocator< std::pair< std::string const,int > > > *ptr = (std::map<std::string,int,std::less< std::string >,std::allocator< std::pair< std::string const,int > > > *)0;
+ res1 = swig::asptr(obj0, &ptr);
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_LogLevelMap" "', argument " "1"" of type '" "std::map< std::string,int > const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_LogLevelMap" "', argument " "1"" of type '" "std::map< std::string,int > const &""'");
+ }
+ arg1 = ptr;
+ }
+ result = (std::map< std::string,int > *)new std::map< std::string,int >((std::map< std::string,int > const &)*arg1);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, SWIG_POINTER_NEW | 0 );
+ if (SWIG_IsNewObj(res1)) delete arg1;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res1)) delete arg1;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_LogLevelMap(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[2];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 1); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 0) {
+ return _wrap_new_LogLevelMap__SWIG_1(self, args);
+ }
+ if (argc == 1) {
+ int _v;
+ int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_std__lessT_std__string_t, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_new_LogLevelMap__SWIG_0(self, args);
+ }
+ }
+ if (argc == 1) {
+ int _v;
+ int res = swig::asptr(argv[0], (std::map<std::string,int,std::less< std::string >,std::allocator< std::pair< std::string const,int > > >**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_new_LogLevelMap__SWIG_2(self, args);
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_LogLevelMap'.\n"
+ " Possible C/C++ prototypes are:\n"
+ " std::map< std::string,int >(std::less< std::string > const &)\n"
+ " std::map< std::string,int >()\n"
+ " std::map< std::string,int >(std::map< std::string,int > const &)\n");
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:LogLevelMap_empty",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_empty" "', argument " "1"" of type '" "std::map< std::string,int > const *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ result = (bool)((std::map< std::string,int > const *)arg1)->empty();
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::map< std::string,int >::size_type result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:LogLevelMap_size",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_size" "', argument " "1"" of type '" "std::map< std::string,int > const *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ result = ((std::map< std::string,int > const *)arg1)->size();
+ resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:LogLevelMap_clear",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_clear" "', argument " "1"" of type '" "std::map< std::string,int > *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ (arg1)->clear();
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ std::map< std::string,int > *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:LogLevelMap_swap",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_swap" "', argument " "1"" of type '" "std::map< std::string,int > *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 );
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LogLevelMap_swap" "', argument " "2"" of type '" "std::map< std::string,int > &""'");
+ }
+ if (!argp2) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "LogLevelMap_swap" "', argument " "2"" of type '" "std::map< std::string,int > &""'");
+ }
+ arg2 = reinterpret_cast< std::map< std::string,int > * >(argp2);
+ (arg1)->swap(*arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ SwigValueWrapper< std::allocator< std::pair< std::string const,int > > > result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:LogLevelMap_get_allocator",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_get_allocator" "', argument " "1"" of type '" "std::map< std::string,int > const *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ result = ((std::map< std::string,int > const *)arg1)->get_allocator();
+ resultobj = SWIG_NewPointerObj((new std::map< std::string,int >::allocator_type(static_cast< const std::map< std::string,int >::allocator_type& >(result))), SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t__allocator_type, SWIG_POINTER_OWN | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_begin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::map< std::string,int >::const_iterator result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:LogLevelMap_begin",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_begin" "', argument " "1"" of type '" "std::map< std::string,int > const *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ result = ((std::map< std::string,int > const *)arg1)->begin();
+ resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< std::string,int >::const_iterator & >(result)),
+ swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_end(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::map< std::string,int >::const_iterator result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:LogLevelMap_end",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_end" "', argument " "1"" of type '" "std::map< std::string,int > const *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ result = ((std::map< std::string,int > const *)arg1)->end();
+ resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< std::string,int >::const_iterator & >(result)),
+ swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_rbegin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::map< std::string,int >::const_reverse_iterator result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:LogLevelMap_rbegin",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_rbegin" "', argument " "1"" of type '" "std::map< std::string,int > const *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ result = ((std::map< std::string,int > const *)arg1)->rbegin();
+ resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< std::string,int >::const_reverse_iterator & >(result)),
+ swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_rend(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::map< std::string,int >::const_reverse_iterator result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:LogLevelMap_rend",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_rend" "', argument " "1"" of type '" "std::map< std::string,int > const *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ result = ((std::map< std::string,int > const *)arg1)->rend();
+ resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< std::string,int >::const_reverse_iterator & >(result)),
+ swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ std::map< std::string,int >::key_type *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ std::map< std::string,int >::size_type result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:LogLevelMap_erase",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_erase" "', argument " "1"" of type '" "std::map< std::string,int > *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LogLevelMap_erase" "', argument " "2"" of type '" "std::map< std::string,int >::key_type const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "LogLevelMap_erase" "', argument " "2"" of type '" "std::map< std::string,int >::key_type const &""'");
+ }
+ arg2 = ptr;
+ }
+ result = (arg1)->erase((std::map< std::string,int >::key_type const &)*arg2);
+ resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ std::map< std::string,int >::key_type *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ std::map< std::string,int >::size_type result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:LogLevelMap_count",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_count" "', argument " "1"" of type '" "std::map< std::string,int > const *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LogLevelMap_count" "', argument " "2"" of type '" "std::map< std::string,int >::key_type const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "LogLevelMap_count" "', argument " "2"" of type '" "std::map< std::string,int >::key_type const &""'");
+ }
+ arg2 = ptr;
+ }
+ result = ((std::map< std::string,int > const *)arg1)->count((std::map< std::string,int >::key_type const &)*arg2);
+ resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ std::map< std::string,int >::iterator arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ swig::SwigPyIterator *iter2 = 0 ;
+ int res2 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:LogLevelMap_erase",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_erase" "', argument " "1"" of type '" "std::map< std::string,int > *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+ if (!SWIG_IsOK(res2) || !iter2) {
+ SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "LogLevelMap_erase" "', argument " "2"" of type '" "std::map< std::string,int >::iterator""'");
+ } else {
+ swig::SwigPyIterator_T<std::map< std::string,int >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::map< std::string,int >::iterator > *>(iter2);
+ if (iter_t) {
+ arg2 = iter_t->get_current();
+ } else {
+ SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "LogLevelMap_erase" "', argument " "2"" of type '" "std::map< std::string,int >::iterator""'");
+ }
+ }
+ (arg1)->erase(arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_erase__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ std::map< std::string,int >::iterator arg2 ;
+ std::map< std::string,int >::iterator arg3 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ swig::SwigPyIterator *iter2 = 0 ;
+ int res2 ;
+ swig::SwigPyIterator *iter3 = 0 ;
+ int res3 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:LogLevelMap_erase",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_erase" "', argument " "1"" of type '" "std::map< std::string,int > *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+ if (!SWIG_IsOK(res2) || !iter2) {
+ SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "LogLevelMap_erase" "', argument " "2"" of type '" "std::map< std::string,int >::iterator""'");
+ } else {
+ swig::SwigPyIterator_T<std::map< std::string,int >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::map< std::string,int >::iterator > *>(iter2);
+ if (iter_t) {
+ arg2 = iter_t->get_current();
+ } else {
+ SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "LogLevelMap_erase" "', argument " "2"" of type '" "std::map< std::string,int >::iterator""'");
+ }
+ }
+ res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::SwigPyIterator::descriptor(), 0);
+ if (!SWIG_IsOK(res3) || !iter3) {
+ SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "LogLevelMap_erase" "', argument " "3"" of type '" "std::map< std::string,int >::iterator""'");
+ } else {
+ swig::SwigPyIterator_T<std::map< std::string,int >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::map< std::string,int >::iterator > *>(iter3);
+ if (iter_t) {
+ arg3 = iter_t->get_current();
+ } else {
+ SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "LogLevelMap_erase" "', argument " "3"" of type '" "std::map< std::string,int >::iterator""'");
+ }
+ }
+ (arg1)->erase(arg2,arg3);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_erase(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[4];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 3); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 2) {
+ int _v;
+ int res = swig::asptr(argv[0], (std::map<std::string,int,std::less< std::string >,std::allocator< std::pair< std::string const,int > > >**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ swig::SwigPyIterator *iter = 0;
+ int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+ _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::map< std::string,int >::iterator > *>(iter) != 0));
+ if (_v) {
+ return _wrap_LogLevelMap_erase__SWIG_1(self, args);
+ }
+ }
+ }
+ if (argc == 2) {
+ int _v;
+ int res = swig::asptr(argv[0], (std::map<std::string,int,std::less< std::string >,std::allocator< std::pair< std::string const,int > > >**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_LogLevelMap_erase__SWIG_0(self, args);
+ }
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ int res = swig::asptr(argv[0], (std::map<std::string,int,std::less< std::string >,std::allocator< std::pair< std::string const,int > > >**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ swig::SwigPyIterator *iter = 0;
+ int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+ _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::map< std::string,int >::iterator > *>(iter) != 0));
+ if (_v) {
+ swig::SwigPyIterator *iter = 0;
+ int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+ _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::map< std::string,int >::iterator > *>(iter) != 0));
+ if (_v) {
+ return _wrap_LogLevelMap_erase__SWIG_2(self, args);
+ }
+ }
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'LogLevelMap_erase'.\n"
+ " Possible C/C++ prototypes are:\n"
+ " erase(std::map< std::string,int > *,std::map< std::string,int >::key_type const &)\n"
+ " erase(std::map< std::string,int > *,std::map< std::string,int >::iterator)\n"
+ " erase(std::map< std::string,int > *,std::map< std::string,int >::iterator,std::map< std::string,int >::iterator)\n");
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_find(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ std::map< std::string,int >::key_type *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ std::map< std::string,int >::iterator result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:LogLevelMap_find",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_find" "', argument " "1"" of type '" "std::map< std::string,int > *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LogLevelMap_find" "', argument " "2"" of type '" "std::map< std::string,int >::key_type const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "LogLevelMap_find" "', argument " "2"" of type '" "std::map< std::string,int >::key_type const &""'");
+ }
+ arg2 = ptr;
+ }
+ result = (arg1)->find((std::map< std::string,int >::key_type const &)*arg2);
+ resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< std::string,int >::iterator & >(result)),
+ swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_lower_bound(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ std::map< std::string,int >::key_type *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ std::map< std::string,int >::iterator result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:LogLevelMap_lower_bound",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_lower_bound" "', argument " "1"" of type '" "std::map< std::string,int > *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LogLevelMap_lower_bound" "', argument " "2"" of type '" "std::map< std::string,int >::key_type const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "LogLevelMap_lower_bound" "', argument " "2"" of type '" "std::map< std::string,int >::key_type const &""'");
+ }
+ arg2 = ptr;
+ }
+ result = (arg1)->lower_bound((std::map< std::string,int >::key_type const &)*arg2);
+ resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< std::string,int >::iterator & >(result)),
+ swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_LogLevelMap_upper_bound(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ std::map< std::string,int >::key_type *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ std::map< std::string,int >::iterator result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:LogLevelMap_upper_bound",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LogLevelMap_upper_bound" "', argument " "1"" of type '" "std::map< std::string,int > *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "LogLevelMap_upper_bound" "', argument " "2"" of type '" "std::map< std::string,int >::key_type const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "LogLevelMap_upper_bound" "', argument " "2"" of type '" "std::map< std::string,int >::key_type const &""'");
+ }
+ arg2 = ptr;
+ }
+ result = (arg1)->upper_bound((std::map< std::string,int >::key_type const &)*arg2);
+ resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< std::string,int >::iterator & >(result)),
+ swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_LogLevelMap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::map< std::string,int > *arg1 = (std::map< std::string,int > *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:delete_LogLevelMap",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, SWIG_POINTER_DISOWN | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_LogLevelMap" "', argument " "1"" of type '" "std::map< std::string,int > *""'");
+ }
+ arg1 = reinterpret_cast< std::map< std::string,int > * >(argp1);
+ delete arg1;
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *LogLevelMap_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *obj;
+ if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+ SWIG_TypeNewClientData(SWIGTYPE_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, SWIG_NewClientData(obj));
+ return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_Log_setLogLevel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::string *arg1 = 0 ;
+ int arg2 ;
+ int res1 = SWIG_OLDOBJ ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:Log_setLogLevel",&obj0,&obj1)) SWIG_fail;
+ {
+ std::string *ptr = (std::string *)0;
+ res1 = SWIG_AsPtr_std_string(obj0, &ptr);
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Log_setLogLevel" "', argument " "1"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Log_setLogLevel" "', argument " "1"" of type '" "std::string const &""'");
+ }
+ arg1 = ptr;
+ }
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Log_setLogLevel" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = static_cast< int >(val2);
+ AGILe::Log::setLevel((std::string const &)*arg1,arg2);
+ resultobj = SWIG_Py_Void();
+ if (SWIG_IsNewObj(res1)) delete arg1;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res1)) delete arg1;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_setLevels(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Log::LevelMap *arg1 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:Log_setLevels",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_std__mapT_std__string_const_int_std__lessT_std__string_const_t_std__allocatorT_std__pairT_std__string_const_const_int_t_t_t, 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Log_setLevels" "', argument " "1"" of type '" "AGILe::Log::LevelMap &""'");
+ }
+ if (!argp1) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Log_setLevels" "', argument " "1"" of type '" "AGILe::Log::LevelMap &""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Log::LevelMap * >(argp1);
+ AGILe::Log::setLevels(*arg1);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_setShowTimestamp__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ bool arg1 ;
+ bool val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:Log_setShowTimestamp",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_bool(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Log_setShowTimestamp" "', argument " "1"" of type '" "bool""'");
+ }
+ arg1 = static_cast< bool >(val1);
+ AGILe::Log::setShowTimestamp(arg1);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_setShowTimestamp__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+
+ if (!PyArg_ParseTuple(args,(char *)":Log_setShowTimestamp")) SWIG_fail;
+ AGILe::Log::setShowTimestamp();
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_setShowTimestamp(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[2];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 1); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 0) {
+ return _wrap_Log_setShowTimestamp__SWIG_1(self, args);
+ }
+ if (argc == 1) {
+ int _v;
+ {
+ int res = SWIG_AsVal_bool(argv[0], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_Log_setShowTimestamp__SWIG_0(self, args);
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Log_setShowTimestamp'.\n"
+ " Possible C/C++ prototypes are:\n"
+ " setShowTimestamp(bool const)\n"
+ " AGILe::Log::setShowTimestamp()\n");
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_setShowLevel__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ bool arg1 ;
+ bool val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:Log_setShowLevel",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_bool(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Log_setShowLevel" "', argument " "1"" of type '" "bool""'");
+ }
+ arg1 = static_cast< bool >(val1);
+ AGILe::Log::setShowLevel(arg1);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_setShowLevel__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+
+ if (!PyArg_ParseTuple(args,(char *)":Log_setShowLevel")) SWIG_fail;
+ AGILe::Log::setShowLevel();
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_setShowLevel(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[2];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 1); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 0) {
+ return _wrap_Log_setShowLevel__SWIG_1(self, args);
+ }
+ if (argc == 1) {
+ int _v;
+ {
+ int res = SWIG_AsVal_bool(argv[0], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_Log_setShowLevel__SWIG_0(self, args);
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Log_setShowLevel'.\n"
+ " Possible C/C++ prototypes are:\n"
+ " setShowLevel(bool const)\n"
+ " AGILe::Log::setShowLevel()\n");
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_setShowLoggerName__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ bool arg1 ;
+ bool val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:Log_setShowLoggerName",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_bool(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Log_setShowLoggerName" "', argument " "1"" of type '" "bool""'");
+ }
+ arg1 = static_cast< bool >(val1);
+ AGILe::Log::setShowLoggerName(arg1);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_setShowLoggerName__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+
+ if (!PyArg_ParseTuple(args,(char *)":Log_setShowLoggerName")) SWIG_fail;
+ AGILe::Log::setShowLoggerName();
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_setShowLoggerName(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[2];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 1); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 0) {
+ return _wrap_Log_setShowLoggerName__SWIG_1(self, args);
+ }
+ if (argc == 1) {
+ int _v;
+ {
+ int res = SWIG_AsVal_bool(argv[0], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_Log_setShowLoggerName__SWIG_0(self, args);
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Log_setShowLoggerName'.\n"
+ " Possible C/C++ prototypes are:\n"
+ " setShowLoggerName(bool const)\n"
+ " AGILe::Log::setShowLoggerName()\n");
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_setUseColors__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ bool arg1 ;
+ bool val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:Log_setUseColors",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_bool(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Log_setUseColors" "', argument " "1"" of type '" "bool""'");
+ }
+ arg1 = static_cast< bool >(val1);
+ AGILe::Log::setUseColors(arg1);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_setUseColors__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+
+ if (!PyArg_ParseTuple(args,(char *)":Log_setUseColors")) SWIG_fail;
+ AGILe::Log::setUseColors();
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_setUseColors(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[2];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 1); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 0) {
+ return _wrap_Log_setUseColors__SWIG_1(self, args);
+ }
+ if (argc == 1) {
+ int _v;
+ {
+ int res = SWIG_AsVal_bool(argv[0], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_Log_setUseColors__SWIG_0(self, args);
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Log_setUseColors'.\n"
+ " Possible C/C++ prototypes are:\n"
+ " setUseColors(bool const)\n"
+ " AGILe::Log::setUseColors()\n");
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_getLog(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::string *arg1 = 0 ;
+ int res1 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ AGILe::Log *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:Log_getLog",&obj0)) SWIG_fail;
+ {
+ std::string *ptr = (std::string *)0;
+ res1 = SWIG_AsPtr_std_string(obj0, &ptr);
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Log_getLog" "', argument " "1"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Log_getLog" "', argument " "1"" of type '" "std::string const &""'");
+ }
+ arg1 = ptr;
+ }
+ result = (AGILe::Log *) &AGILe::Log::getLog((std::string const &)*arg1);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_AGILe__Log, 0 | 0 );
+ if (SWIG_IsNewObj(res1)) delete arg1;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res1)) delete arg1;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_getLevel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Log *arg1 = (AGILe::Log *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:Log_getLevel",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Log, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Log_getLevel" "', argument " "1"" of type '" "AGILe::Log const *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Log * >(argp1);
+ result = (int)((AGILe::Log const *)arg1)->getLevel();
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_setLevel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Log *arg1 = (AGILe::Log *) 0 ;
+ int arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ AGILe::Log *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:Log_setLevel",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Log, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Log_setLevel" "', argument " "1"" of type '" "AGILe::Log *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Log * >(argp1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Log_setLevel" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = static_cast< int >(val2);
+ result = (AGILe::Log *) &(arg1)->setLevel(arg2);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_AGILe__Log, 0 | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_getLevelFromName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::string *arg1 = 0 ;
+ int res1 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ AGILe::Log::Level result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:Log_getLevelFromName",&obj0)) SWIG_fail;
+ {
+ std::string *ptr = (std::string *)0;
+ res1 = SWIG_AsPtr_std_string(obj0, &ptr);
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Log_getLevelFromName" "', argument " "1"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Log_getLevelFromName" "', argument " "1"" of type '" "std::string const &""'");
+ }
+ arg1 = ptr;
+ }
+ result = (AGILe::Log::Level)AGILe::Log::getLevelFromName((std::string const &)*arg1);
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ if (SWIG_IsNewObj(res1)) delete arg1;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res1)) delete arg1;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_getLevelName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ int arg1 ;
+ int val1 ;
+ int ecode1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::string result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:Log_getLevelName",&obj0)) SWIG_fail;
+ ecode1 = SWIG_AsVal_int(obj0, &val1);
+ if (!SWIG_IsOK(ecode1)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Log_getLevelName" "', argument " "1"" of type '" "int""'");
+ }
+ arg1 = static_cast< int >(val1);
+ result = AGILe::Log::getLevelName(arg1);
+ resultobj = SWIG_From_std_string(static_cast< std::string >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_getName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Log *arg1 = (AGILe::Log *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::string result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:Log_getName",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Log, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Log_getName" "', argument " "1"" of type '" "AGILe::Log const *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Log * >(argp1);
+ result = ((AGILe::Log const *)arg1)->getName();
+ resultobj = SWIG_From_std_string(static_cast< std::string >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_setName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Log *arg1 = (AGILe::Log *) 0 ;
+ std::string *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ AGILe::Log *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:Log_setName",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Log, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Log_setName" "', argument " "1"" of type '" "AGILe::Log *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Log * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Log_setName" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Log_setName" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ arg2 = ptr;
+ }
+ result = (AGILe::Log *) &(arg1)->setName((std::string const &)*arg2);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_AGILe__Log, 0 | 0 );
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_isActive(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Log *arg1 = (AGILe::Log *) 0 ;
+ int arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:Log_isActive",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Log, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Log_isActive" "', argument " "1"" of type '" "AGILe::Log const *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Log * >(argp1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Log_isActive" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = static_cast< int >(val2);
+ result = (bool)((AGILe::Log const *)arg1)->isActive(arg2);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_trace(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Log *arg1 = (AGILe::Log *) 0 ;
+ std::string *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:Log_trace",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Log, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Log_trace" "', argument " "1"" of type '" "AGILe::Log *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Log * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Log_trace" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Log_trace" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ arg2 = ptr;
+ }
+ (arg1)->trace((std::string const &)*arg2);
+ resultobj = SWIG_Py_Void();
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_debug(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Log *arg1 = (AGILe::Log *) 0 ;
+ std::string *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:Log_debug",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Log, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Log_debug" "', argument " "1"" of type '" "AGILe::Log *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Log * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Log_debug" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Log_debug" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ arg2 = ptr;
+ }
+ (arg1)->debug((std::string const &)*arg2);
+ resultobj = SWIG_Py_Void();
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_info(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Log *arg1 = (AGILe::Log *) 0 ;
+ std::string *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:Log_info",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Log, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Log_info" "', argument " "1"" of type '" "AGILe::Log *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Log * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Log_info" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Log_info" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ arg2 = ptr;
+ }
+ (arg1)->info((std::string const &)*arg2);
+ resultobj = SWIG_Py_Void();
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_warn(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Log *arg1 = (AGILe::Log *) 0 ;
+ std::string *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:Log_warn",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Log, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Log_warn" "', argument " "1"" of type '" "AGILe::Log *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Log * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Log_warn" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Log_warn" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ arg2 = ptr;
+ }
+ (arg1)->warn((std::string const &)*arg2);
+ resultobj = SWIG_Py_Void();
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_error(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Log *arg1 = (AGILe::Log *) 0 ;
+ std::string *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:Log_error",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Log, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Log_error" "', argument " "1"" of type '" "AGILe::Log *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Log * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Log_error" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Log_error" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ arg2 = ptr;
+ }
+ (arg1)->error((std::string const &)*arg2);
+ resultobj = SWIG_Py_Void();
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log_always(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Log *arg1 = (AGILe::Log *) 0 ;
+ std::string *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:Log_always",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Log, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Log_always" "', argument " "1"" of type '" "AGILe::Log *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Log * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Log_always" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Log_always" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ arg2 = ptr;
+ }
+ (arg1)->always((std::string const &)*arg2);
+ resultobj = SWIG_Py_Void();
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Log__nostream_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Log *arg1 = (AGILe::Log *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::ostream *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:Log__nostream_get",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Log, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Log__nostream_get" "', argument " "1"" of type '" "AGILe::Log *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Log * >(argp1);
+ result = (std::ostream *)(std::ostream *) ((arg1)->_nostream);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__ostream, 0 | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_Log(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Log *arg1 = (AGILe::Log *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:delete_Log",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Log, SWIG_POINTER_DISOWN | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Log" "', argument " "1"" of type '" "AGILe::Log *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Log * >(argp1);
+ delete arg1;
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *Log_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *obj;
+ if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+ SWIG_TypeNewClientData(SWIGTYPE_p_AGILe__Log, SWIG_NewClientData(obj));
+ return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap___lshift__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Log *arg1 = 0 ;
+ int arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ std::ostream *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:__lshift__",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_AGILe__Log, 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "__lshift__" "', argument " "1"" of type '" "AGILe::Log &""'");
+ }
+ if (!argp1) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "__lshift__" "', argument " "1"" of type '" "AGILe::Log &""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Log * >(argp1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "__lshift__" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = static_cast< int >(val2);
+ result = (std::ostream *) &AGILe::operator <<(*arg1,arg2);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__ostream, 0 | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_Generator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:delete_Generator",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, SWIG_POINTER_DISOWN | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Generator" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ delete arg1;
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_setInitialState__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ int arg2 ;
+ double arg3 ;
+ int arg4 ;
+ double arg5 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ double val3 ;
+ int ecode3 = 0 ;
+ int val4 ;
+ int ecode4 = 0 ;
+ double val5 ;
+ int ecode5 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+ PyObject * obj4 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOOOO:Generator_setInitialState",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_setInitialState" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Generator_setInitialState" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = static_cast< int >(val2);
+ ecode3 = SWIG_AsVal_double(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Generator_setInitialState" "', argument " "3"" of type '" "double""'");
+ }
+ arg3 = static_cast< double >(val3);
+ ecode4 = SWIG_AsVal_int(obj3, &val4);
+ if (!SWIG_IsOK(ecode4)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Generator_setInitialState" "', argument " "4"" of type '" "int""'");
+ }
+ arg4 = static_cast< int >(val4);
+ ecode5 = SWIG_AsVal_double(obj4, &val5);
+ if (!SWIG_IsOK(ecode5)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Generator_setInitialState" "', argument " "5"" of type '" "double""'");
+ }
+ arg5 = static_cast< double >(val5);
+ (arg1)->setInitialState(arg2,arg3,arg4,arg5);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_setInitialState__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ int arg2 ;
+ double arg3 ;
+ int arg4 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ double val3 ;
+ int ecode3 = 0 ;
+ int val4 ;
+ int ecode4 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOOO:Generator_setInitialState",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_setInitialState" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Generator_setInitialState" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = static_cast< int >(val2);
+ ecode3 = SWIG_AsVal_double(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Generator_setInitialState" "', argument " "3"" of type '" "double""'");
+ }
+ arg3 = static_cast< double >(val3);
+ ecode4 = SWIG_AsVal_int(obj3, &val4);
+ if (!SWIG_IsOK(ecode4)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Generator_setInitialState" "', argument " "4"" of type '" "int""'");
+ }
+ arg4 = static_cast< int >(val4);
+ (arg1)->setInitialState(arg2,arg3,arg4);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_setInitialState__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ int arg2 ;
+ double arg3 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ double val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:Generator_setInitialState",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_setInitialState" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Generator_setInitialState" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = static_cast< int >(val2);
+ ecode3 = SWIG_AsVal_double(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Generator_setInitialState" "', argument " "3"" of type '" "double""'");
+ }
+ arg3 = static_cast< double >(val3);
+ (arg1)->setInitialState(arg2,arg3);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_setInitialState__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ int arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:Generator_setInitialState",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_setInitialState" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Generator_setInitialState" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = static_cast< int >(val2);
+ (arg1)->setInitialState(arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_setInitialState__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:Generator_setInitialState",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_setInitialState" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ (arg1)->setInitialState();
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_setInitialState(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[6];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 5); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 1) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_AGILe__Generator, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_Generator_setInitialState__SWIG_4(self, args);
+ }
+ }
+ if (argc == 2) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_AGILe__Generator, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_int(argv[1], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_Generator_setInitialState__SWIG_3(self, args);
+ }
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_AGILe__Generator, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_int(argv[1], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ {
+ int res = SWIG_AsVal_double(argv[2], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_Generator_setInitialState__SWIG_2(self, args);
+ }
+ }
+ }
+ }
+ if (argc == 4) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_AGILe__Generator, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_int(argv[1], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ {
+ int res = SWIG_AsVal_double(argv[2], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ {
+ int res = SWIG_AsVal_int(argv[3], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_Generator_setInitialState__SWIG_1(self, args);
+ }
+ }
+ }
+ }
+ }
+ if (argc == 5) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_AGILe__Generator, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_int(argv[1], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ {
+ int res = SWIG_AsVal_double(argv[2], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ {
+ int res = SWIG_AsVal_int(argv[3], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ {
+ int res = SWIG_AsVal_double(argv[4], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_Generator_setInitialState__SWIG_0(self, args);
+ }
+ }
+ }
+ }
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Generator_setInitialState'.\n"
+ " Possible C/C++ prototypes are:\n"
+ " setInitialState(AGILe::Generator *,int,double,int,double)\n"
+ " setInitialState(AGILe::Generator *,int,double,int)\n"
+ " setInitialState(AGILe::Generator *,int,double)\n"
+ " setInitialState(AGILe::Generator *,int)\n"
+ " setInitialState(AGILe::Generator *)\n");
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_getName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::string result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:Generator_getName",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_getName" "', argument " "1"" of type '" "AGILe::Generator const *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ result = ((AGILe::Generator const *)arg1)->getName();
+ resultobj = SWIG_From_std_string(static_cast< std::string >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_setVersion(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ std::string *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:Generator_setVersion",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_setVersion" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Generator_setVersion" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Generator_setVersion" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ arg2 = ptr;
+ }
+ (arg1)->setVersion((std::string const &)*arg2);
+ resultobj = SWIG_Py_Void();
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_getVersion(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::string result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:Generator_getVersion",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_getVersion" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ result = (arg1)->getVersion();
+ resultobj = SWIG_From_std_string(static_cast< std::string >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_getPDFSet(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ AGILe::PdgCode arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ std::string result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:Generator_getPDFSet",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_getPDFSet" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Generator_getPDFSet" "', argument " "2"" of type '" "AGILe::PdgCode""'");
+ }
+ arg2 = static_cast< AGILe::PdgCode >(val2);
+ result = (arg1)->getPDFSet(arg2);
+ resultobj = SWIG_From_std_string(static_cast< std::string >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_getPDFMember(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ AGILe::PdgCode arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ int result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:Generator_getPDFMember",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_getPDFMember" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Generator_getPDFMember" "', argument " "2"" of type '" "AGILe::PdgCode""'");
+ }
+ arg2 = static_cast< AGILe::PdgCode >(val2);
+ result = (int)(arg1)->getPDFMember(arg2);
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_getPDFScheme(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ AGILe::PdgCode arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ std::string result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:Generator_getPDFScheme",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_getPDFScheme" "', argument " "1"" of type '" "AGILe::Generator const *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Generator_getPDFScheme" "', argument " "2"" of type '" "AGILe::PdgCode""'");
+ }
+ arg2 = static_cast< AGILe::PdgCode >(val2);
+ result = ((AGILe::Generator const *)arg1)->getPDFScheme(arg2);
+ resultobj = SWIG_From_std_string(static_cast< std::string >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_setSeed(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ int arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:Generator_setSeed",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_setSeed" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ ecode2 = SWIG_AsVal_int(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Generator_setSeed" "', argument " "2"" of type '" "int""'");
+ }
+ arg2 = static_cast< int >(val2);
+ (arg1)->setSeed(arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_setParam__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ std::string *arg2 = 0 ;
+ int *arg3 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ int temp3 ;
+ int val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:Generator_setParam",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_setParam" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Generator_setParam" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Generator_setParam" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ arg2 = ptr;
+ }
+ ecode3 = SWIG_AsVal_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Generator_setParam" "', argument " "3"" of type '" "int""'");
+ }
+ temp3 = static_cast< int >(val3);
+ arg3 = &temp3;
+ result = (bool)(arg1)->setParam((std::string const &)*arg2,(int const &)*arg3);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_setParam__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ std::string *arg2 = 0 ;
+ unsigned int *arg3 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ unsigned int temp3 ;
+ unsigned int val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:Generator_setParam",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_setParam" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Generator_setParam" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Generator_setParam" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ arg2 = ptr;
+ }
+ ecode3 = SWIG_AsVal_unsigned_SS_int(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Generator_setParam" "', argument " "3"" of type '" "unsigned int""'");
+ }
+ temp3 = static_cast< unsigned int >(val3);
+ arg3 = &temp3;
+ result = (bool)(arg1)->setParam((std::string const &)*arg2,(unsigned int const &)*arg3);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_setParam__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ std::string *arg2 = 0 ;
+ long *arg3 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ long temp3 ;
+ long val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:Generator_setParam",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_setParam" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Generator_setParam" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Generator_setParam" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ arg2 = ptr;
+ }
+ ecode3 = SWIG_AsVal_long(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Generator_setParam" "', argument " "3"" of type '" "long""'");
+ }
+ temp3 = static_cast< long >(val3);
+ arg3 = &temp3;
+ result = (bool)(arg1)->setParam((std::string const &)*arg2,(long const &)*arg3);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_setParam__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ std::string *arg2 = 0 ;
+ unsigned long *arg3 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ unsigned long temp3 ;
+ unsigned long val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:Generator_setParam",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_setParam" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Generator_setParam" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Generator_setParam" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ arg2 = ptr;
+ }
+ ecode3 = SWIG_AsVal_unsigned_SS_long(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Generator_setParam" "', argument " "3"" of type '" "unsigned long""'");
+ }
+ temp3 = static_cast< unsigned long >(val3);
+ arg3 = &temp3;
+ result = (bool)(arg1)->setParam((std::string const &)*arg2,(unsigned long const &)*arg3);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_setParam__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ std::string *arg2 = 0 ;
+ double *arg3 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ double temp3 ;
+ double val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:Generator_setParam",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_setParam" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Generator_setParam" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Generator_setParam" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ arg2 = ptr;
+ }
+ ecode3 = SWIG_AsVal_double(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Generator_setParam" "', argument " "3"" of type '" "double""'");
+ }
+ temp3 = static_cast< double >(val3);
+ arg3 = &temp3;
+ result = (bool)(arg1)->setParam((std::string const &)*arg2,(double const &)*arg3);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_setParam__SWIG_5(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ std::string *arg2 = 0 ;
+ float *arg3 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ float temp3 ;
+ float val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:Generator_setParam",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_setParam" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Generator_setParam" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Generator_setParam" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ arg2 = ptr;
+ }
+ ecode3 = SWIG_AsVal_float(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Generator_setParam" "', argument " "3"" of type '" "float""'");
+ }
+ temp3 = static_cast< float >(val3);
+ arg3 = &temp3;
+ result = (bool)(arg1)->setParam((std::string const &)*arg2,(float const &)*arg3);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_setParam__SWIG_6(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ std::string *arg2 = 0 ;
+ bool *arg3 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ bool temp3 ;
+ bool val3 ;
+ int ecode3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:Generator_setParam",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_setParam" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Generator_setParam" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Generator_setParam" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ arg2 = ptr;
+ }
+ ecode3 = SWIG_AsVal_bool(obj2, &val3);
+ if (!SWIG_IsOK(ecode3)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Generator_setParam" "', argument " "3"" of type '" "bool""'");
+ }
+ temp3 = static_cast< bool >(val3);
+ arg3 = &temp3;
+ result = (bool)(arg1)->setParam((std::string const &)*arg2,(bool const &)*arg3);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_setParam__SWIG_7(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ std::string *arg2 = 0 ;
+ std::string *arg3 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ int res3 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"OOO:Generator_setParam",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_setParam" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Generator_setParam" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Generator_setParam" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ arg2 = ptr;
+ }
+ {
+ std::string *ptr = (std::string *)0;
+ res3 = SWIG_AsPtr_std_string(obj2, &ptr);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Generator_setParam" "', argument " "3"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Generator_setParam" "', argument " "3"" of type '" "std::string const &""'");
+ }
+ arg3 = ptr;
+ }
+ result = (bool)(arg1)->setParam((std::string const &)*arg2,(std::string const &)*arg3);
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ if (SWIG_IsNewObj(res3)) delete arg3;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ if (SWIG_IsNewObj(res3)) delete arg3;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_setParam(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[4];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 3); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 3) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_AGILe__Generator, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_unsigned_SS_int(argv[2], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_Generator_setParam__SWIG_1(self, args);
+ }
+ }
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_AGILe__Generator, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_int(argv[2], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_Generator_setParam__SWIG_0(self, args);
+ }
+ }
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_AGILe__Generator, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_unsigned_SS_long(argv[2], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_Generator_setParam__SWIG_3(self, args);
+ }
+ }
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_AGILe__Generator, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_long(argv[2], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_Generator_setParam__SWIG_2(self, args);
+ }
+ }
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_AGILe__Generator, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_float(argv[2], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_Generator_setParam__SWIG_5(self, args);
+ }
+ }
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_AGILe__Generator, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_double(argv[2], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_Generator_setParam__SWIG_4(self, args);
+ }
+ }
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_AGILe__Generator, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_Generator_setParam__SWIG_7(self, args);
+ }
+ }
+ }
+ }
+ if (argc == 3) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_AGILe__Generator, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_bool(argv[2], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_Generator_setParam__SWIG_6(self, args);
+ }
+ }
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Generator_setParam'.\n"
+ " Possible C/C++ prototypes are:\n"
+ " setParam(AGILe::Generator *,std::string const &,int const &)\n"
+ " setParam(AGILe::Generator *,std::string const &,unsigned int const &)\n"
+ " setParam(AGILe::Generator *,std::string const &,long const &)\n"
+ " setParam(AGILe::Generator *,std::string const &,unsigned long const &)\n"
+ " setParam(AGILe::Generator *,std::string const &,double const &)\n"
+ " setParam(AGILe::Generator *,std::string const &,float const &)\n"
+ " setParam(AGILe::Generator *,std::string const &,bool const &)\n"
+ " setParam(AGILe::Generator *,std::string const &,std::string const &)\n");
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_makeEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ HepMC::GenEvent *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:Generator_makeEvent",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_makeEvent" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_HepMC__GenEvent, 0 );
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Generator_makeEvent" "', argument " "2"" of type '" "HepMC::GenEvent &""'");
+ }
+ if (!argp2) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Generator_makeEvent" "', argument " "2"" of type '" "HepMC::GenEvent &""'");
+ }
+ arg2 = reinterpret_cast< HepMC::GenEvent * >(argp2);
+ (arg1)->makeEvent(*arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_getCrossSection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ double result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:Generator_getCrossSection",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_getCrossSection" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ result = (double)(arg1)->getCrossSection();
+ resultobj = SWIG_From_double(static_cast< double >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Generator_finalize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:Generator_finalize",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Generator_finalize" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ (arg1)->finalize();
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *Generator_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *obj;
+ if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+ SWIG_TypeNewClientData(SWIGTYPE_p_AGILe__Generator, SWIG_NewClientData(obj));
+ return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_Run(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = 0 ;
+ std::string *arg2 = 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ AGILe::Run *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:new_Run",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_AGILe__Generator, 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Run" "', argument " "1"" of type '" "AGILe::Generator &""'");
+ }
+ if (!argp1) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Run" "', argument " "1"" of type '" "AGILe::Generator &""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ {
+ std::string *ptr = (std::string *)0;
+ res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_Run" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_Run" "', argument " "2"" of type '" "std::string const &""'");
+ }
+ arg2 = ptr;
+ }
+ result = (AGILe::Run *)new AGILe::Run(*arg1,(std::string const &)*arg2);
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_AGILe__Run, SWIG_POINTER_NEW | 0 );
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res2)) delete arg2;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_Run(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Run *arg1 = (AGILe::Run *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:delete_Run",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Run, SWIG_POINTER_DISOWN | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Run" "', argument " "1"" of type '" "AGILe::Run *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Run * >(argp1);
+ delete arg1;
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Run_doFilter__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Run *arg1 = (AGILe::Run *) 0 ;
+ bool arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ bool val2 ;
+ int ecode2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO:Run_doFilter",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Run, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Run_doFilter" "', argument " "1"" of type '" "AGILe::Run *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Run * >(argp1);
+ ecode2 = SWIG_AsVal_bool(obj1, &val2);
+ if (!SWIG_IsOK(ecode2)) {
+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Run_doFilter" "', argument " "2"" of type '" "bool""'");
+ }
+ arg2 = static_cast< bool >(val2);
+ (arg1)->doFilter(arg2);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Run_doFilter__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Run *arg1 = (AGILe::Run *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:Run_doFilter",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Run, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Run_doFilter" "', argument " "1"" of type '" "AGILe::Run *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Run * >(argp1);
+ (arg1)->doFilter();
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Run_doFilter(PyObject *self, PyObject *args) {
+ int argc;
+ PyObject *argv[3];
+ int ii;
+
+ if (!PyTuple_Check(args)) SWIG_fail;
+ argc = (int)PyObject_Length(args);
+ for (ii = 0; (ii < argc) && (ii < 2); ii++) {
+ argv[ii] = PyTuple_GET_ITEM(args,ii);
+ }
+ if (argc == 1) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_AGILe__Run, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ return _wrap_Run_doFilter__SWIG_1(self, args);
+ }
+ }
+ if (argc == 2) {
+ int _v;
+ void *vptr = 0;
+ int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_AGILe__Run, 0);
+ _v = SWIG_CheckState(res);
+ if (_v) {
+ {
+ int res = SWIG_AsVal_bool(argv[1], NULL);
+ _v = SWIG_CheckState(res);
+ }
+ if (_v) {
+ return _wrap_Run_doFilter__SWIG_0(self, args);
+ }
+ }
+ }
+
+fail:
+ SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Run_doFilter'.\n"
+ " Possible C/C++ prototypes are:\n"
+ " doFilter(AGILe::Run *,bool)\n"
+ " doFilter(AGILe::Run *)\n");
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Run_makeEvent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Run *arg1 = (AGILe::Run *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ bool result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:Run_makeEvent",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Run, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Run_makeEvent" "', argument " "1"" of type '" "AGILe::Run *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Run * >(argp1);
+ result = (bool)(arg1)->makeEvent();
+ resultobj = SWIG_From_bool(static_cast< bool >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Run_eventSummary(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Run *arg1 = (AGILe::Run *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+ std::string result;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:Run_eventSummary",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Run, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Run_eventSummary" "', argument " "1"" of type '" "AGILe::Run const *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Run * >(argp1);
+ result = ((AGILe::Run const *)arg1)->eventSummary();
+ resultobj = SWIG_From_std_string(static_cast< std::string >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *Run_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *obj;
+ if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+ SWIG_TypeNewClientData(SWIGTYPE_p_AGILe__Run, SWIG_NewClientData(obj));
+ return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_initialize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+
+ if (!PyArg_ParseTuple(args,(char *)":initialize")) SWIG_fail;
+ AGILe::Loader::initialize();
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_getAvailableGens(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::vector< std::string,std::allocator< std::string > > result;
+
+ if (!PyArg_ParseTuple(args,(char *)":getAvailableGens")) SWIG_fail;
+ result = AGILe::Loader::getAvailableGens();
+ resultobj = swig::from(static_cast< std::vector<std::string,std::allocator< std::string > > >(result));
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_loadGenLibs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ std::string *arg1 = 0 ;
+ int res1 = SWIG_OLDOBJ ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:loadGenLibs",&obj0)) SWIG_fail;
+ {
+ std::string *ptr = (std::string *)0;
+ res1 = SWIG_AsPtr_std_string(obj0, &ptr);
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "loadGenLibs" "', argument " "1"" of type '" "std::string const &""'");
+ }
+ if (!ptr) {
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "loadGenLibs" "', argument " "1"" of type '" "std::string const &""'");
+ }
+ arg1 = ptr;
+ }
+ AGILe::Loader::loadGenLibs((std::string const &)*arg1);
+ resultobj = SWIG_Py_Void();
+ if (SWIG_IsNewObj(res1)) delete arg1;
+ return resultobj;
+fail:
+ if (SWIG_IsNewObj(res1)) delete arg1;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_createGen(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *result = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)":createGen")) SWIG_fail;
+ result = (AGILe::Generator *)AGILe::Loader::createGen();
+ resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_destroyGen(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ AGILe::Generator *arg1 = (AGILe::Generator *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ PyObject * obj0 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O:destroyGen",&obj0)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AGILe__Generator, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "destroyGen" "', argument " "1"" of type '" "AGILe::Generator *""'");
+ }
+ arg1 = reinterpret_cast< AGILe::Generator * >(argp1);
+ AGILe::Loader::destroyGen(arg1);
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_finalize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+
+ if (!PyArg_ParseTuple(args,(char *)":finalize")) SWIG_fail;
+ AGILe::Loader::finalize();
+ resultobj = SWIG_Py_Void();
+ return resultobj;
+fail:
+ return NULL;
+}
+
+
+static PyMethodDef SwigMethods[] = {
+ { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
+ { (char *)"delete_SwigPyIterator", _wrap_delete_SwigPyIterator, METH_VARARGS, NULL},
+ { (char *)"SwigPyIterator_value", _wrap_SwigPyIterator_value, METH_VARARGS, NULL},
+ { (char *)"SwigPyIterator_incr", _wrap_SwigPyIterator_incr, METH_VARARGS, NULL},
+ { (char *)"SwigPyIterator_decr", _wrap_SwigPyIterator_decr, METH_VARARGS, NULL},
+ { (char *)"SwigPyIterator_distance", _wrap_SwigPyIterator_distance, METH_VARARGS, NULL},
+ { (char *)"SwigPyIterator_equal", _wrap_SwigPyIterator_equal, METH_VARARGS, NULL},
+ { (char *)"SwigPyIterator_copy", _wrap_SwigPyIterator_copy, METH_VARARGS, NULL},
+ { (char *)"SwigPyIterator_next", _wrap_SwigPyIterator_next, METH_VARARGS, NULL},
+ { (char *)"SwigPyIterator___next__", _wrap_SwigPyIterator___next__, METH_VARARGS, NULL},
+ { (char *)"SwigPyIterator_previous", _wrap_SwigPyIterator_previous, METH_VARARGS, NULL},
+ { (char *)"SwigPyIterator_advance", _wrap_SwigPyIterator_advance, METH_VARARGS, NULL},
+ { (char *)"SwigPyIterator___eq__", _wrap_SwigPyIterator___eq__, METH_VARARGS, NULL},
+ { (char *)"SwigPyIterator___ne__", _wrap_SwigPyIterator___ne__, METH_VARARGS, NULL},
+ { (char *)"SwigPyIterator___iadd__", _wrap_SwigPyIterator___iadd__, METH_VARARGS, NULL},
+ { (char *)"SwigPyIterator___isub__", _wrap_SwigPyIterator___isub__, METH_VARARGS, NULL},
+ { (char *)"SwigPyIterator___add__", _wrap_SwigPyIterator___add__, METH_VARARGS, NULL},
+ { (char *)"SwigPyIterator___sub__", _wrap_SwigPyIterator___sub__, METH_VARARGS, NULL},
+ { (char *)"SwigPyIterator_swigregister", SwigPyIterator_swigregister, METH_VARARGS, NULL},
+ { (char *)"StrList_iterator", _wrap_StrList_iterator, METH_VARARGS, NULL},
+ { (char *)"StrList___nonzero__", _wrap_StrList___nonzero__, METH_VARARGS, NULL},
+ { (char *)"StrList___bool__", _wrap_StrList___bool__, METH_VARARGS, NULL},
+ { (char *)"StrList___len__", _wrap_StrList___len__, METH_VARARGS, NULL},
+ { (char *)"StrList_pop", _wrap_StrList_pop, METH_VARARGS, NULL},
+ { (char *)"StrList___getslice__", _wrap_StrList___getslice__, METH_VARARGS, NULL},
+ { (char *)"StrList___setslice__", _wrap_StrList___setslice__, METH_VARARGS, NULL},
+ { (char *)"StrList___delslice__", _wrap_StrList___delslice__, METH_VARARGS, NULL},
+ { (char *)"StrList___delitem__", _wrap_StrList___delitem__, METH_VARARGS, NULL},
+ { (char *)"StrList___getitem__", _wrap_StrList___getitem__, METH_VARARGS, NULL},
+ { (char *)"StrList___setitem__", _wrap_StrList___setitem__, METH_VARARGS, NULL},
+ { (char *)"StrList_append", _wrap_StrList_append, METH_VARARGS, NULL},
+ { (char *)"StrList_empty", _wrap_StrList_empty, METH_VARARGS, NULL},
+ { (char *)"StrList_size", _wrap_StrList_size, METH_VARARGS, NULL},
+ { (char *)"StrList_clear", _wrap_StrList_clear, METH_VARARGS, NULL},
+ { (char *)"StrList_swap", _wrap_StrList_swap, METH_VARARGS, NULL},
+ { (char *)"StrList_get_allocator", _wrap_StrList_get_allocator, METH_VARARGS, NULL},
+ { (char *)"StrList_begin", _wrap_StrList_begin, METH_VARARGS, NULL},
+ { (char *)"StrList_end", _wrap_StrList_end, METH_VARARGS, NULL},
+ { (char *)"StrList_rbegin", _wrap_StrList_rbegin, METH_VARARGS, NULL},
+ { (char *)"StrList_rend", _wrap_StrList_rend, METH_VARARGS, NULL},
+ { (char *)"StrList_pop_back", _wrap_StrList_pop_back, METH_VARARGS, NULL},
+ { (char *)"StrList_erase", _wrap_StrList_erase, METH_VARARGS, NULL},
+ { (char *)"new_StrList", _wrap_new_StrList, METH_VARARGS, NULL},
+ { (char *)"StrList_push_back", _wrap_StrList_push_back, METH_VARARGS, NULL},
+ { (char *)"StrList_front", _wrap_StrList_front, METH_VARARGS, NULL},
+ { (char *)"StrList_back", _wrap_StrList_back, METH_VARARGS, NULL},
+ { (char *)"StrList_assign", _wrap_StrList_assign, METH_VARARGS, NULL},
+ { (char *)"StrList_resize", _wrap_StrList_resize, METH_VARARGS, NULL},
+ { (char *)"StrList_insert", _wrap_StrList_insert, METH_VARARGS, NULL},
+ { (char *)"StrList_reserve", _wrap_StrList_reserve, METH_VARARGS, NULL},
+ { (char *)"StrList_capacity", _wrap_StrList_capacity, METH_VARARGS, NULL},
+ { (char *)"delete_StrList", _wrap_delete_StrList, METH_VARARGS, NULL},
+ { (char *)"StrList_swigregister", StrList_swigregister, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_iterator", _wrap_LogLevelMap_iterator, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap___nonzero__", _wrap_LogLevelMap___nonzero__, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap___bool__", _wrap_LogLevelMap___bool__, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap___len__", _wrap_LogLevelMap___len__, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap___getitem__", _wrap_LogLevelMap___getitem__, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap___delitem__", _wrap_LogLevelMap___delitem__, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_has_key", _wrap_LogLevelMap_has_key, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_keys", _wrap_LogLevelMap_keys, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_values", _wrap_LogLevelMap_values, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_items", _wrap_LogLevelMap_items, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap___contains__", _wrap_LogLevelMap___contains__, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_key_iterator", _wrap_LogLevelMap_key_iterator, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_value_iterator", _wrap_LogLevelMap_value_iterator, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap___setitem__", _wrap_LogLevelMap___setitem__, METH_VARARGS, NULL},
+ { (char *)"new_LogLevelMap", _wrap_new_LogLevelMap, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_empty", _wrap_LogLevelMap_empty, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_size", _wrap_LogLevelMap_size, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_clear", _wrap_LogLevelMap_clear, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_swap", _wrap_LogLevelMap_swap, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_get_allocator", _wrap_LogLevelMap_get_allocator, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_begin", _wrap_LogLevelMap_begin, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_end", _wrap_LogLevelMap_end, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_rbegin", _wrap_LogLevelMap_rbegin, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_rend", _wrap_LogLevelMap_rend, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_count", _wrap_LogLevelMap_count, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_erase", _wrap_LogLevelMap_erase, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_find", _wrap_LogLevelMap_find, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_lower_bound", _wrap_LogLevelMap_lower_bound, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_upper_bound", _wrap_LogLevelMap_upper_bound, METH_VARARGS, NULL},
+ { (char *)"delete_LogLevelMap", _wrap_delete_LogLevelMap, METH_VARARGS, NULL},
+ { (char *)"LogLevelMap_swigregister", LogLevelMap_swigregister, METH_VARARGS, NULL},
+ { (char *)"Log_setLogLevel", _wrap_Log_setLogLevel, METH_VARARGS, NULL},
+ { (char *)"Log_setLevels", _wrap_Log_setLevels, METH_VARARGS, NULL},
+ { (char *)"Log_setShowTimestamp", _wrap_Log_setShowTimestamp, METH_VARARGS, NULL},
+ { (char *)"Log_setShowLevel", _wrap_Log_setShowLevel, METH_VARARGS, NULL},
+ { (char *)"Log_setShowLoggerName", _wrap_Log_setShowLoggerName, METH_VARARGS, NULL},
+ { (char *)"Log_setUseColors", _wrap_Log_setUseColors, METH_VARARGS, NULL},
+ { (char *)"Log_getLog", _wrap_Log_getLog, METH_VARARGS, NULL},
+ { (char *)"Log_getLevel", _wrap_Log_getLevel, METH_VARARGS, NULL},
+ { (char *)"Log_setLevel", _wrap_Log_setLevel, METH_VARARGS, NULL},
+ { (char *)"Log_getLevelFromName", _wrap_Log_getLevelFromName, METH_VARARGS, NULL},
+ { (char *)"Log_getLevelName", _wrap_Log_getLevelName, METH_VARARGS, NULL},
+ { (char *)"Log_getName", _wrap_Log_getName, METH_VARARGS, NULL},
+ { (char *)"Log_setName", _wrap_Log_setName, METH_VARARGS, NULL},
+ { (char *)"Log_isActive", _wrap_Log_isActive, METH_VARARGS, NULL},
+ { (char *)"Log_trace", _wrap_Log_trace, METH_VARARGS, NULL},
+ { (char *)"Log_debug", _wrap_Log_debug, METH_VARARGS, NULL},
+ { (char *)"Log_info", _wrap_Log_info, METH_VARARGS, NULL},
+ { (char *)"Log_warn", _wrap_Log_warn, METH_VARARGS, NULL},
+ { (char *)"Log_error", _wrap_Log_error, METH_VARARGS, NULL},
+ { (char *)"Log_always", _wrap_Log_always, METH_VARARGS, NULL},
+ { (char *)"Log__nostream_get", _wrap_Log__nostream_get, METH_VARARGS, NULL},
+ { (char *)"delete_Log", _wrap_delete_Log, METH_VARARGS, NULL},
+ { (char *)"Log_swigregister", Log_swigregister, METH_VARARGS, NULL},
+ { (char *)"__lshift__", _wrap___lshift__, METH_VARARGS, NULL},
+ { (char *)"delete_Generator", _wrap_delete_Generator, METH_VARARGS, NULL},
+ { (char *)"Generator_setInitialState", _wrap_Generator_setInitialState, METH_VARARGS, NULL},
+ { (char *)"Generator_getName", _wrap_Generator_getName, METH_VARARGS, NULL},
+ { (char *)"Generator_setVersion", _wrap_Generator_setVersion, METH_VARARGS, NULL},
+ { (char *)"Generator_getVersion", _wrap_Generator_getVersion, METH_VARARGS, NULL},
+ { (char *)"Generator_getPDFSet", _wrap_Generator_getPDFSet, METH_VARARGS, NULL},
+ { (char *)"Generator_getPDFMember", _wrap_Generator_getPDFMember, METH_VARARGS, NULL},
+ { (char *)"Generator_getPDFScheme", _wrap_Generator_getPDFScheme, METH_VARARGS, NULL},
+ { (char *)"Generator_setSeed", _wrap_Generator_setSeed, METH_VARARGS, NULL},
+ { (char *)"Generator_setParam", _wrap_Generator_setParam, METH_VARARGS, NULL},
+ { (char *)"Generator_makeEvent", _wrap_Generator_makeEvent, METH_VARARGS, NULL},
+ { (char *)"Generator_getCrossSection", _wrap_Generator_getCrossSection, METH_VARARGS, NULL},
+ { (char *)"Generator_finalize", _wrap_Generator_finalize, METH_VARARGS, NULL},
+ { (char *)"Generator_swigregister", Generator_swigregister, METH_VARARGS, NULL},
+ { (char *)"new_Run", _wrap_new_Run, METH_VARARGS, NULL},
+ { (char *)"delete_Run", _wrap_delete_Run, METH_VARARGS, NULL},
+ { (char *)"Run_doFilter", _wrap_Run_doFilter, METH_VARARGS, NULL},
+ { (char *)"Run_makeEvent", _wrap_Run_makeEvent, METH_VARARGS, NULL},
+ { (char *)"Run_eventSummary", _wrap_Run_eventSummary, METH_VARARGS, NULL},
+ { (char *)"Run_swigregister", Run_swigregister, METH_VARARGS, NULL},
+ { (char *)"initialize", _wrap_initialize, METH_VARARGS, NULL},
+ { (char *)"getAvailableGens", _wrap_getAvailableGens, METH_VARARGS, NULL},
+ { (char *)"loadGenLibs", _wrap_loadGenLibs, METH_VARARGS, NULL},
+ { (char *)"createGen", _wrap_createGen, METH_VARARGS, NULL},
+ { (char *)"destroyGen", _wrap_destroyGen, METH_VARARGS, NULL},
+ { (char *)"finalize", _wrap_finalize, METH_VARARGS, NULL},
+ { NULL, NULL, 0, NULL }
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
+
+static swig_type_info _swigt__p_AGILe__Generator = {"_p_AGILe__Generator", "AGILe::Generator *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_AGILe__Log = {"_p_AGILe__Log", "AGILe::Log *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_AGILe__Run = {"_p_AGILe__Run", "AGILe::Run *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_ColorCodes = {"_p_ColorCodes", "ColorCodes *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_HepMC__GenEvent = {"_p_HepMC__GenEvent", "HepMC::GenEvent *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_LevelMap = {"_p_LevelMap", "LevelMap *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_LogMap = {"_p_LogMap", "LogMap *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_allocator_type = {"_p_allocator_type", "allocator_type *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_difference_type = {"_p_difference_type", "difference_type *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_f_p_AGILe__Generator__void = {"_p_f_p_AGILe__Generator__void", "void (*)(AGILe::Generator *)|AGILe::Destroyer *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_int = {"_p_int", "int *|AGILe::PdgCode *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_key_type = {"_p_key_type", "key_type *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_mapped_type = {"_p_mapped_type", "mapped_type *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_p_PyObject = {"_p_p_PyObject", "PyObject **", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_size_type = {"_p_size_type", "size_type *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__invalid_argument = {"_p_std__invalid_argument", "std::invalid_argument *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__lessT_std__string_t = {"_p_std__lessT_std__string_t", "std::less< std::string > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_std__string_const_int_std__lessT_std__string_const_t_std__allocatorT_std__pairT_std__string_const_const_int_t_t_t = {"_p_std__mapT_std__string_const_int_std__lessT_std__string_const_t_std__allocatorT_std__pairT_std__string_const_const_int_t_t_t", "std::map< std::string const,int,std::less< std::string const >,std::allocator< std::pair< std::string const const,int > > > *|AGILe::Log::LevelMap *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t = {"_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t", "std::map< std::string,int,std::less< std::string >,std::allocator< std::pair< std::string const,int > > > *|std::map< std::string,int > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t__allocator_type = {"_p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t__allocator_type", "std::map< std::string,int >::allocator_type *|std::allocator< std::pair< std::string const,int > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__ostream = {"_p_std__ostream", "std::ostream *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorT_std__string_std__allocatorT_std__string_t_t = {"_p_std__vectorT_std__string_std__allocatorT_std__string_t_t", "std::vector< std::string,std::allocator< std::string > > *|std::vector< std::string > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorT_std__string_std__allocatorT_std__string_t_t__allocator_type = {"_p_std__vectorT_std__string_std__allocatorT_std__string_t_t__allocator_type", "std::vector< std::string >::allocator_type *|std::allocator< std::string > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_swig__SwigPyIterator = {"_p_swig__SwigPyIterator", "swig::SwigPyIterator *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_value_type = {"_p_value_type", "value_type *", 0, 0, (void*)0, 0};
+
+static swig_type_info *swig_type_initial[] = {
+ &_swigt__p_AGILe__Generator,
+ &_swigt__p_AGILe__Log,
+ &_swigt__p_AGILe__Run,
+ &_swigt__p_ColorCodes,
+ &_swigt__p_HepMC__GenEvent,
+ &_swigt__p_LevelMap,
+ &_swigt__p_LogMap,
+ &_swigt__p_allocator_type,
+ &_swigt__p_char,
+ &_swigt__p_difference_type,
+ &_swigt__p_f_p_AGILe__Generator__void,
+ &_swigt__p_int,
+ &_swigt__p_key_type,
+ &_swigt__p_mapped_type,
+ &_swigt__p_p_PyObject,
+ &_swigt__p_size_type,
+ &_swigt__p_std__invalid_argument,
+ &_swigt__p_std__lessT_std__string_t,
+ &_swigt__p_std__mapT_std__string_const_int_std__lessT_std__string_const_t_std__allocatorT_std__pairT_std__string_const_const_int_t_t_t,
+ &_swigt__p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t,
+ &_swigt__p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t__allocator_type,
+ &_swigt__p_std__ostream,
+ &_swigt__p_std__vectorT_std__string_std__allocatorT_std__string_t_t,
+ &_swigt__p_std__vectorT_std__string_std__allocatorT_std__string_t_t__allocator_type,
+ &_swigt__p_swig__SwigPyIterator,
+ &_swigt__p_value_type,
+};
+
+static swig_cast_info _swigc__p_AGILe__Generator[] = { {&_swigt__p_AGILe__Generator, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_AGILe__Log[] = { {&_swigt__p_AGILe__Log, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_AGILe__Run[] = { {&_swigt__p_AGILe__Run, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_ColorCodes[] = { {&_swigt__p_ColorCodes, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_HepMC__GenEvent[] = { {&_swigt__p_HepMC__GenEvent, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_LevelMap[] = { {&_swigt__p_LevelMap, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_LogMap[] = { {&_swigt__p_LogMap, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_allocator_type[] = { {&_swigt__p_allocator_type, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_difference_type[] = { {&_swigt__p_difference_type, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_f_p_AGILe__Generator__void[] = { {&_swigt__p_f_p_AGILe__Generator__void, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_key_type[] = { {&_swigt__p_key_type, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_mapped_type[] = { {&_swigt__p_mapped_type, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_p_PyObject[] = { {&_swigt__p_p_PyObject, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_size_type[] = { {&_swigt__p_size_type, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__invalid_argument[] = { {&_swigt__p_std__invalid_argument, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__lessT_std__string_t[] = { {&_swigt__p_std__lessT_std__string_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_std__string_const_int_std__lessT_std__string_const_t_std__allocatorT_std__pairT_std__string_const_const_int_t_t_t[] = { {&_swigt__p_std__mapT_std__string_const_int_std__lessT_std__string_const_t_std__allocatorT_std__pairT_std__string_const_const_int_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t[] = { {&_swigt__p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t__allocator_type[] = { {&_swigt__p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t__allocator_type, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__ostream[] = { {&_swigt__p_std__ostream, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorT_std__string_std__allocatorT_std__string_t_t[] = { {&_swigt__p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorT_std__string_std__allocatorT_std__string_t_t__allocator_type[] = { {&_swigt__p_std__vectorT_std__string_std__allocatorT_std__string_t_t__allocator_type, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_swig__SwigPyIterator[] = { {&_swigt__p_swig__SwigPyIterator, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_value_type[] = { {&_swigt__p_value_type, 0, 0, 0},{0, 0, 0, 0}};
+
+static swig_cast_info *swig_cast_initial[] = {
+ _swigc__p_AGILe__Generator,
+ _swigc__p_AGILe__Log,
+ _swigc__p_AGILe__Run,
+ _swigc__p_ColorCodes,
+ _swigc__p_HepMC__GenEvent,
+ _swigc__p_LevelMap,
+ _swigc__p_LogMap,
+ _swigc__p_allocator_type,
+ _swigc__p_char,
+ _swigc__p_difference_type,
+ _swigc__p_f_p_AGILe__Generator__void,
+ _swigc__p_int,
+ _swigc__p_key_type,
+ _swigc__p_mapped_type,
+ _swigc__p_p_PyObject,
+ _swigc__p_size_type,
+ _swigc__p_std__invalid_argument,
+ _swigc__p_std__lessT_std__string_t,
+ _swigc__p_std__mapT_std__string_const_int_std__lessT_std__string_const_t_std__allocatorT_std__pairT_std__string_const_const_int_t_t_t,
+ _swigc__p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t,
+ _swigc__p_std__mapT_std__string_int_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_int_t_t_t__allocator_type,
+ _swigc__p_std__ostream,
+ _swigc__p_std__vectorT_std__string_std__allocatorT_std__string_t_t,
+ _swigc__p_std__vectorT_std__string_std__allocatorT_std__string_t_t__allocator_type,
+ _swigc__p_swig__SwigPyIterator,
+ _swigc__p_value_type,
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
+
+static swig_const_info swig_const_table[] = {
+{0, 0, 0, 0.0, 0, 0}};
+
+#ifdef __cplusplus
+}
+#endif
+/* -----------------------------------------------------------------------------
+ * Type initialization:
+ * This problem is tough by the requirement that no dynamic
+ * memory is used. Also, since swig_type_info structures store pointers to
+ * swig_cast_info structures and swig_cast_info structures store pointers back
+ * to swig_type_info structures, we need some lookup code at initialization.
+ * The idea is that swig generates all the structures that are needed.
+ * The runtime then collects these partially filled structures.
+ * The SWIG_InitializeModule function takes these initial arrays out of
+ * swig_module, and does all the lookup, filling in the swig_module.types
+ * array with the correct data and linking the correct swig_cast_info
+ * structures together.
+ *
+ * The generated swig_type_info structures are assigned staticly to an initial
+ * array. We just loop through that array, and handle each type individually.
+ * First we lookup if this type has been already loaded, and if so, use the
+ * loaded structure instead of the generated one. Then we have to fill in the
+ * cast linked list. The cast data is initially stored in something like a
+ * two-dimensional array. Each row corresponds to a type (there are the same
+ * number of rows as there are in the swig_type_initial array). Each entry in
+ * a column is one of the swig_cast_info structures for that type.
+ * The cast_initial array is actually an array of arrays, because each row has
+ * a variable number of columns. So to actually build the cast linked list,
+ * we find the array of casts associated with the type, and loop through it
+ * adding the casts to the list. The one last trick we need to do is making
+ * sure the type pointer in the swig_cast_info struct is correct.
+ *
+ * First off, we lookup the cast->type name to see if it is already loaded.
+ * There are three cases to handle:
+ * 1) If the cast->type has already been loaded AND the type we are adding
+ * casting info to has not been loaded (it is in this module), THEN we
+ * replace the cast->type pointer with the type pointer that has already
+ * been loaded.
+ * 2) If BOTH types (the one we are adding casting info to, and the
+ * cast->type) are loaded, THEN the cast info has already been loaded by
+ * the previous module so we just ignore it.
+ * 3) Finally, if cast->type has not already been loaded, then we add that
+ * swig_cast_info to the linked list (because the cast->type) pointer will
+ * be correct.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
+#endif
+
+
+SWIGRUNTIME void
+SWIG_InitializeModule(void *clientdata) {
+ size_t i;
+ swig_module_info *module_head, *iter;
+ int found, init;
+
+ clientdata = clientdata;
+
+ /* check to see if the circular list has been setup, if not, set it up */
+ if (swig_module.next==0) {
+ /* Initialize the swig_module */
+ swig_module.type_initial = swig_type_initial;
+ swig_module.cast_initial = swig_cast_initial;
+ swig_module.next = &swig_module;
+ init = 1;
+ } else {
+ init = 0;
+ }
+
+ /* Try and load any already created modules */
+ module_head = SWIG_GetModule(clientdata);
+ if (!module_head) {
+ /* This is the first module loaded for this interpreter */
+ /* so set the swig module into the interpreter */
+ SWIG_SetModule(clientdata, &swig_module);
+ module_head = &swig_module;
+ } else {
+ /* the interpreter has loaded a SWIG module, but has it loaded this one? */
+ found=0;
+ iter=module_head;
+ do {
+ if (iter==&swig_module) {
+ found=1;
+ break;
+ }
+ iter=iter->next;
+ } while (iter!= module_head);
+
+ /* if the is found in the list, then all is done and we may leave */
+ if (found) return;
+ /* otherwise we must add out module into the list */
+ swig_module.next = module_head->next;
+ module_head->next = &swig_module;
+ }
+
+ /* When multiple interpeters are used, a module could have already been initialized in
+ a different interpreter, but not yet have a pointer in this interpreter.
+ In this case, we do not want to continue adding types... everything should be
+ set up already */
+ if (init == 0) return;
+
+ /* Now work on filling in swig_module.types */
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
+ for (i = 0; i < swig_module.size; ++i) {
+ swig_type_info *type = 0;
+ swig_type_info *ret;
+ swig_cast_info *cast;
+
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
+
+ /* if there is another module already loaded */
+ if (swig_module.next != &swig_module) {
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+ }
+ if (type) {
+ /* Overwrite clientdata field */
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+ if (swig_module.type_initial[i]->clientdata) {
+ type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+ }
+ } else {
+ type = swig_module.type_initial[i];
+ }
+
+ /* Insert casting types */
+ cast = swig_module.cast_initial[i];
+ while (cast->type) {
+ /* Don't need to add information already in the list */
+ ret = 0;
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
+ if (swig_module.next != &swig_module) {
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
+ }
+ if (ret) {
+ if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+ cast->type = ret;
+ ret = 0;
+ } else {
+ /* Check for casting already in the list */
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+ if (!ocast) ret = 0;
+ }
+ }
+
+ if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
+ if (type->cast) {
+ type->cast->prev = cast;
+ cast->next = type->cast;
+ }
+ type->cast = cast;
+ }
+ cast++;
+ }
+ /* Set entry in modules->types array equal to the type */
+ swig_module.types[i] = type;
+ }
+ swig_module.types[i] = 0;
+
+#ifdef SWIGRUNTIME_DEBUG
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
+ for (i = 0; i < swig_module.size; ++i) {
+ int j = 0;
+ swig_cast_info *cast = swig_module.cast_initial[i];
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+ while (cast->type) {
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+ cast++;
+ ++j;
+ }
+ printf("---- Total casts: %d\n",j);
+ }
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
+}
+
+/* This function will propagate the clientdata field of type to
+* any new swig_type_info structures that have been added into the list
+* of equivalent types. It is like calling
+* SWIG_TypeClientData(type, clientdata) a second time.
+*/
+SWIGRUNTIME void
+SWIG_PropagateClientData(void) {
+ size_t i;
+ swig_cast_info *equiv;
+ static int init_run = 0;
+
+ if (init_run) return;
+ init_run = 1;
+
+ for (i = 0; i < swig_module.size; i++) {
+ if (swig_module.types[i]->clientdata) {
+ equiv = swig_module.types[i]->cast;
+ while (equiv) {
+ if (!equiv->converter) {
+ if (equiv->type && !equiv->type->clientdata)
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+ }
+ equiv = equiv->next;
+ }
+ }
+ }
+}
+
+#ifdef __cplusplus
+#if 0
+{
+ /* c-mode */
+#endif
+}
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /* Python-specific SWIG API */
+#define SWIG_newvarlink() SWIG_Python_newvarlink()
+#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr)
+#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants)
+
+ /* -----------------------------------------------------------------------------
+ * global variable support code.
+ * ----------------------------------------------------------------------------- */
+
+ typedef struct swig_globalvar {
+ char *name; /* Name of global variable */
+ PyObject *(*get_attr)(void); /* Return the current value */
+ int (*set_attr)(PyObject *); /* Set the value */
+ struct swig_globalvar *next;
+ } swig_globalvar;
+
+ typedef struct swig_varlinkobject {
+ PyObject_HEAD
+ swig_globalvar *vars;
+ } swig_varlinkobject;
+
+ SWIGINTERN PyObject *
+ swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
+#if PY_VERSION_HEX >= 0x03000000
+ return PyUnicode_InternFromString("<Swig global variables>");
+#else
+ return PyString_FromString("<Swig global variables>");
+#endif
+ }
+
+ SWIGINTERN PyObject *
+ swig_varlink_str(swig_varlinkobject *v) {
+#if PY_VERSION_HEX >= 0x03000000
+ PyObject *str = PyUnicode_InternFromString("(");
+ PyObject *tail;
+ PyObject *joined;
+ swig_globalvar *var;
+ for (var = v->vars; var; var=var->next) {
+ tail = PyUnicode_FromString(var->name);
+ joined = PyUnicode_Concat(str, tail);
+ Py_DecRef(str);
+ Py_DecRef(tail);
+ str = joined;
+ if (var->next) {
+ tail = PyUnicode_InternFromString(", ");
+ joined = PyUnicode_Concat(str, tail);
+ Py_DecRef(str);
+ Py_DecRef(tail);
+ str = joined;
+ }
+ }
+ tail = PyUnicode_InternFromString(")");
+ joined = PyUnicode_Concat(str, tail);
+ Py_DecRef(str);
+ Py_DecRef(tail);
+ str = joined;
+#else
+ PyObject *str = PyString_FromString("(");
+ swig_globalvar *var;
+ for (var = v->vars; var; var=var->next) {
+ PyString_ConcatAndDel(&str,PyString_FromString(var->name));
+ if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
+ }
+ PyString_ConcatAndDel(&str,PyString_FromString(")"));
+#endif
+ return str;
+ }
+
+ SWIGINTERN int
+ swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
+ char *tmp;
+ PyObject *str = swig_varlink_str(v);
+ fprintf(fp,"Swig global variables ");
+ fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str));
+ SWIG_Python_str_DelForPy3(tmp);
+ Py_DECREF(str);
+ return 0;
+ }
+
+ SWIGINTERN void
+ swig_varlink_dealloc(swig_varlinkobject *v) {
+ swig_globalvar *var = v->vars;
+ while (var) {
+ swig_globalvar *n = var->next;
+ free(var->name);
+ free(var);
+ var = n;
+ }
+ }
+
+ SWIGINTERN PyObject *
+ swig_varlink_getattr(swig_varlinkobject *v, char *n) {
+ PyObject *res = NULL;
+ swig_globalvar *var = v->vars;
+ while (var) {
+ if (strcmp(var->name,n) == 0) {
+ res = (*var->get_attr)();
+ break;
+ }
+ var = var->next;
+ }
+ if (res == NULL && !PyErr_Occurred()) {
+ PyErr_SetString(PyExc_NameError,"Unknown C global variable");
+ }
+ return res;
+ }
+
+ SWIGINTERN int
+ swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
+ int res = 1;
+ swig_globalvar *var = v->vars;
+ while (var) {
+ if (strcmp(var->name,n) == 0) {
+ res = (*var->set_attr)(p);
+ break;
+ }
+ var = var->next;
+ }
+ if (res == 1 && !PyErr_Occurred()) {
+ PyErr_SetString(PyExc_NameError,"Unknown C global variable");
+ }
+ return res;
+ }
+
+ SWIGINTERN PyTypeObject*
+ swig_varlink_type(void) {
+ static char varlink__doc__[] = "Swig var link object";
+ static PyTypeObject varlink_type;
+ static int type_init = 0;
+ if (!type_init) {
+ const PyTypeObject tmp
+ = {
+ /* PyObject header changed in Python 3 */
+#if PY_VERSION_HEX >= 0x03000000
+ PyVarObject_HEAD_INIT(&PyType_Type, 0)
+#else
+ PyObject_HEAD_INIT(NULL)
+ 0, /* Number of items in variable part (ob_size) */
+#endif
+ (char *)"swigvarlink", /* Type name (tp_name) */
+ sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */
+ 0, /* Itemsize (tp_itemsize) */
+ (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */
+ (printfunc) swig_varlink_print, /* Print (tp_print) */
+ (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
+ (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
+ 0, /* tp_compare */
+ (reprfunc) swig_varlink_repr, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ (reprfunc) swig_varlink_str, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ 0, /* tp_flags */
+ varlink__doc__, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+#if PY_VERSION_HEX >= 0x02020000
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
+#endif
+#if PY_VERSION_HEX >= 0x02030000
+ 0, /* tp_del */
+#endif
+#ifdef COUNT_ALLOCS
+ 0,0,0,0 /* tp_alloc -> tp_next */
+#endif
+ };
+ varlink_type = tmp;
+ /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */
+#if PY_VERSION_HEX < 0x03000000
+ varlink_type.ob_type = &PyType_Type;
+#endif
+ type_init = 1;
+ }
+ return &varlink_type;
+ }
+
+ /* Create a variable linking object for use later */
+ SWIGINTERN PyObject *
+ SWIG_Python_newvarlink(void) {
+ swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
+ if (result) {
+ result->vars = 0;
+ }
+ return ((PyObject*) result);
+ }
+
+ SWIGINTERN void
+ SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
+ swig_varlinkobject *v = (swig_varlinkobject *) p;
+ swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
+ if (gv) {
+ size_t size = strlen(name)+1;
+ gv->name = (char *)malloc(size);
+ if (gv->name) {
+ strncpy(gv->name,name,size);
+ gv->get_attr = get_attr;
+ gv->set_attr = set_attr;
+ gv->next = v->vars;
+ }
+ }
+ v->vars = gv;
+ }
+
+ SWIGINTERN PyObject *
+ SWIG_globals(void) {
+ static PyObject *_SWIG_globals = 0;
+ if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();
+ return _SWIG_globals;
+ }
+
+ /* -----------------------------------------------------------------------------
+ * constants/methods manipulation
+ * ----------------------------------------------------------------------------- */
+
+ /* Install Constants */
+ SWIGINTERN void
+ SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
+ PyObject *obj = 0;
+ size_t i;
+ for (i = 0; constants[i].type; ++i) {
+ switch(constants[i].type) {
+ case SWIG_PY_POINTER:
+ obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
+ break;
+ case SWIG_PY_BINARY:
+ obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
+ break;
+ default:
+ obj = 0;
+ break;
+ }
+ if (obj) {
+ PyDict_SetItemString(d, constants[i].name, obj);
+ Py_DECREF(obj);
+ }
+ }
+ }
+
+ /* -----------------------------------------------------------------------------*/
+ /* Fix SwigMethods to carry the callback ptrs when needed */
+ /* -----------------------------------------------------------------------------*/
+
+ SWIGINTERN void
+ SWIG_Python_FixMethods(PyMethodDef *methods,
+ swig_const_info *const_table,
+ swig_type_info **types,
+ swig_type_info **types_initial) {
+ size_t i;
+ for (i = 0; methods[i].ml_name; ++i) {
+ const char *c = methods[i].ml_doc;
+ if (c && (c = strstr(c, "swig_ptr: "))) {
+ int j;
+ swig_const_info *ci = 0;
+ const char *name = c + 10;
+ for (j = 0; const_table[j].type; ++j) {
+ if (strncmp(const_table[j].name, name,
+ strlen(const_table[j].name)) == 0) {
+ ci = &(const_table[j]);
+ break;
+ }
+ }
+ if (ci) {
+ size_t shift = (ci->ptype) - types;
+ swig_type_info *ty = types_initial[shift];
+ size_t ldoc = (c - methods[i].ml_doc);
+ size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
+ char *ndoc = (char*)malloc(ldoc + lptr + 10);
+ if (ndoc) {
+ char *buff = ndoc;
+ void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
+ if (ptr) {
+ strncpy(buff, methods[i].ml_doc, ldoc);
+ buff += ldoc;
+ strncpy(buff, "swig_ptr: ", 10);
+ buff += 10;
+ SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
+ methods[i].ml_doc = ndoc;
+ }
+ }
+ }
+ }
+ }
+ }
+
+#ifdef __cplusplus
+}
+#endif
+
+/* -----------------------------------------------------------------------------*
+ * Partial Init method
+ * -----------------------------------------------------------------------------*/
+
+#ifdef __cplusplus
+extern "C"
+#endif
+
+SWIGEXPORT
+#if PY_VERSION_HEX >= 0x03000000
+PyObject*
+#else
+void
+#endif
+SWIG_init(void) {
+ PyObject *m, *d;
+#if PY_VERSION_HEX >= 0x03000000
+ static struct PyModuleDef SWIG_module = {
+ PyModuleDef_HEAD_INIT,
+ (char *) SWIG_name,
+ NULL,
+ -1,
+ SwigMethods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ };
+#endif
+
+ /* Fix SwigMethods to carry the callback ptrs when needed */
+ SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
+
+#if PY_VERSION_HEX >= 0x03000000
+ m = PyModule_Create(&SWIG_module);
+#else
+ m = Py_InitModule((char *) SWIG_name, SwigMethods);
+#endif
+ d = PyModule_GetDict(m);
+
+ SWIG_InitializeModule(0);
+ SWIG_InstallConstants(d,swig_const_table);
+
+
+ SWIG_Python_SetConstant(d, "Log_TRACE",SWIG_From_int(static_cast< int >(AGILe::Log::TRACE)));
+ SWIG_Python_SetConstant(d, "Log_DEBUG",SWIG_From_int(static_cast< int >(AGILe::Log::DEBUG)));
+ SWIG_Python_SetConstant(d, "Log_INFO",SWIG_From_int(static_cast< int >(AGILe::Log::INFO)));
+ SWIG_Python_SetConstant(d, "Log_WARN",SWIG_From_int(static_cast< int >(AGILe::Log::WARN)));
+ SWIG_Python_SetConstant(d, "Log_ERROR",SWIG_From_int(static_cast< int >(AGILe::Log::ERROR)));
+ SWIG_Python_SetConstant(d, "Log_CRITICAL",SWIG_From_int(static_cast< int >(AGILe::Log::CRITICAL)));
+ SWIG_Python_SetConstant(d, "Log_ALWAYS",SWIG_From_int(static_cast< int >(AGILe::Log::ALWAYS)));
+ SWIG_Python_SetConstant(d, "ELECTRON",SWIG_From_int(static_cast< int >(AGILe::ELECTRON)));
+ SWIG_Python_SetConstant(d, "POSITRON",SWIG_From_int(static_cast< int >(AGILe::POSITRON)));
+ SWIG_Python_SetConstant(d, "PROTON",SWIG_From_int(static_cast< int >(AGILe::PROTON)));
+ SWIG_Python_SetConstant(d, "ANTIPROTON",SWIG_From_int(static_cast< int >(AGILe::ANTIPROTON)));
+ SWIG_Python_SetConstant(d, "PHOTON",SWIG_From_int(static_cast< int >(AGILe::PHOTON)));
+ SWIG_Python_SetConstant(d, "NEUTRON",SWIG_From_int(static_cast< int >(AGILe::NEUTRON)));
+ SWIG_Python_SetConstant(d, "ANTINEUTRON",SWIG_From_int(static_cast< int >(AGILe::ANTINEUTRON)));
+ SWIG_Python_SetConstant(d, "MUON",SWIG_From_int(static_cast< int >(AGILe::MUON)));
+ SWIG_Python_SetConstant(d, "ANTIMUON",SWIG_From_int(static_cast< int >(AGILe::ANTIMUON)));
+ SWIG_Python_SetConstant(d, "NU_E",SWIG_From_int(static_cast< int >(AGILe::NU_E)));
+ SWIG_Python_SetConstant(d, "NU_EBAR",SWIG_From_int(static_cast< int >(AGILe::NU_EBAR)));
+ SWIG_Python_SetConstant(d, "NU_MU",SWIG_From_int(static_cast< int >(AGILe::NU_MU)));
+ SWIG_Python_SetConstant(d, "NU_MUBAR",SWIG_From_int(static_cast< int >(AGILe::NU_MUBAR)));
+ SWIG_Python_SetConstant(d, "NU_TAU",SWIG_From_int(static_cast< int >(AGILe::NU_TAU)));
+ SWIG_Python_SetConstant(d, "NU_TAUBAR",SWIG_From_int(static_cast< int >(AGILe::NU_TAUBAR)));
+ SWIG_Python_SetConstant(d, "PIPLUS",SWIG_From_int(static_cast< int >(AGILe::PIPLUS)));
+ SWIG_Python_SetConstant(d, "PIMINUS",SWIG_From_int(static_cast< int >(AGILe::PIMINUS)));
+ SWIG_Python_SetConstant(d, "TAU",SWIG_From_int(static_cast< int >(AGILe::TAU)));
+ SWIG_Python_SetConstant(d, "ANTITAU",SWIG_From_int(static_cast< int >(AGILe::ANTITAU)));
+ SWIG_Python_SetConstant(d, "EMINUS",SWIG_From_int(static_cast< int >(AGILe::EMINUS)));
+ SWIG_Python_SetConstant(d, "EPLUS",SWIG_From_int(static_cast< int >(AGILe::EPLUS)));
+ SWIG_Python_SetConstant(d, "P",SWIG_From_int(static_cast< int >(AGILe::P)));
+ SWIG_Python_SetConstant(d, "PBAR",SWIG_From_int(static_cast< int >(AGILe::PBAR)));
+ SWIG_Python_SetConstant(d, "GAMMA",SWIG_From_int(static_cast< int >(AGILe::GAMMA)));
+ SWIG_Python_SetConstant(d, "ANY",SWIG_From_int(static_cast< int >(AGILe::ANY)));
+ SWIG_Python_SetConstant(d, "PHOTOELECTRON",SWIG_From_int(static_cast< int >(AGILe::PHOTOELECTRON)));
+ SWIG_Python_SetConstant(d, "PHOTOPOSITRON",SWIG_From_int(static_cast< int >(AGILe::PHOTOPOSITRON)));
+ SWIG_Python_SetConstant(d, "PHOTOMUON",SWIG_From_int(static_cast< int >(AGILe::PHOTOMUON)));
+ SWIG_Python_SetConstant(d, "PHOTOANTIMUON",SWIG_From_int(static_cast< int >(AGILe::PHOTOANTIMUON)));
+ SWIG_Python_SetConstant(d, "PHOTOTAU",SWIG_From_int(static_cast< int >(AGILe::PHOTOTAU)));
+ SWIG_Python_SetConstant(d, "PHOTOANTITAU",SWIG_From_int(static_cast< int >(AGILe::PHOTOANTITAU)));
+ SWIG_Python_SetConstant(d, "Generator_SUCCESS",SWIG_From_int(static_cast< int >(AGILe::Generator::SUCCESS)));
+ SWIG_Python_SetConstant(d, "Generator_FAILURE",SWIG_From_int(static_cast< int >(AGILe::Generator::FAILURE)));
+#if PY_VERSION_HEX >= 0x03000000
+ return m;
+#else
+ return;
+#endif
+}
+
Index: tags/agile-1.2.0/pyext/AGILe/agilewrap.i
===================================================================
--- tags/agile-1.2.0/pyext/AGILe/agilewrap.i (revision 0)
+++ tags/agile-1.2.0/pyext/AGILe/agilewrap.i (revision 755)
@@ -0,0 +1,56 @@
+%module agilewrap
+
+%{
+ #define SWIG_FILE_WITH_INIT
+ #include "AGILe/Loader.hh"
+ #include "AGILe/Generator.hh"
+ #include "AGILe/Run.hh"
+ #include "AGILe/Tools/Logging.hh"
+%}
+
+// HepMC
+//%include "hepmc.i"
+
+// STL templates
+%include "std_string.i"
+%include "std_vector.i"
+%include "std_map.i"
+%template(StrList) std::vector<std::string>;
+%template(LogLevelMap) std::map<std::string, int>;
+
+
+// Logging interface
+// Not mapping whole log interface, since we only want to be able to set log levels.
+//%template(LogLevelMap) std::map<std::string, int>;
+%ignore operator<<;
+namespace AGILe {
+ %rename(setLogLevel) Log::setLevel(const std::string&, int);
+ class Log {
+ public:
+ enum Level {
+ TRACE = 0, DEBUG = 10, INFO = 20, WARNING = 30, WARN = 30, ERROR = 40, CRITICAL = 50, ALWAYS = 50
+ };
+ static void setLevel(const std::string& name, int level);
+ protected:
+ Log(const std::string& name);
+ Log(const std::string& name, int level);
+ };
+}
+//%include "AGILe/Tools/Logging.hh"
+
+%include "AGILe/Particle.hh"
+
+namespace AGILe {
+ %ignore Generator::getState;
+ %ignore Generator::setState;
+}
+%include "AGILe/Generator.hh"
+
+namespace AGILe {
+ // %ignore Run::Run(const Run&);
+ %ignore Run::Run(Generator&);
+ %ignore Run::event;
+}
+%include "AGILe/Run.hh"
+
+%include "AGILe/Loader.hh"
Index: tags/agile-1.2.0/pyext/AGILe/__init__.py
===================================================================
--- tags/agile-1.2.0/pyext/AGILe/__init__.py (revision 0)
+++ tags/agile-1.2.0/pyext/AGILe/__init__.py (revision 755)
@@ -0,0 +1,24 @@
+"Python interface to the Rivet MC validation system"
+
+## Change dlopen status to GLOBAL for AGILe lib loading
+import sys
+try:
+ import ctypes
+ sys.setdlopenflags(sys.getdlopenflags() | ctypes.RTLD_GLOBAL)
+ del ctypes
+except:
+ import dl
+ sys.setdlopenflags(sys.getdlopenflags() | dl.RTLD_GLOBAL)
+ del dl
+del sys
+
+## Import SWIG-generated wrapper core
+from agilewrap import *
+
+## Provide an extra Python-only function used to enforce the AGILe scripts' minimal Python version
+def check_python_version():
+ import sys
+ req_version = (2,4,0)
+ if sys.version_info[:3] < req_version:
+ print "rivet scripts require Python version >= %s... exiting" % ".".join(req_version)
+ sys.exit(1)
Index: tags/agile-1.2.0/pyext/AGILe/Makefile.am
===================================================================
--- tags/agile-1.2.0/pyext/AGILe/Makefile.am (revision 0)
+++ tags/agile-1.2.0/pyext/AGILe/Makefile.am (revision 755)
@@ -0,0 +1,12 @@
+EXTRA_DIST = __init__.py agilewrap.i
+
+all-local: agilewrap_wrap.cc agilewrap.py
+ @true
+
+agilewrap_wrap.cc agilewrap.py: agilewrap.i
+ $(SWIG) -c++ -python -I$(top_srcdir)/include -o agilewrap_wrap.cc $<
+
+clean-local:
+ @rm -f *.pyc
+ @rm -f agilewrap.py
+ @rm -f agilewrap_wrap.cc
Index: tags/agile-1.2.0/pyext/AGILe
===================================================================
--- tags/agile-1.2.0/pyext/AGILe (revision 754)
+++ tags/agile-1.2.0/pyext/AGILe (revision 755)
Property changes on: tags/agile-1.2.0/pyext/AGILe
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,4 ##
+Makefile
+Makefile.in
+agilewrap.py
+agilewrap_wrap.cc
Index: tags/agile-1.2.0/pyext/hepmc.i
===================================================================
--- tags/agile-1.2.0/pyext/hepmc.i (revision 0)
+++ tags/agile-1.2.0/pyext/hepmc.i (revision 755)
@@ -0,0 +1,245 @@
+// %module hepmc
+
+%{
+ #include "HepMC/GenEvent.h"
+ #include "HepMC/GenVertex.h"
+ #include "HepMC/GenParticle.h"
+ #include "HepMC/IO_GenEvent.h"
+ #include "HepMC/SimpleVector.h"
+ #include <sstream>
+ using namespace HepMC;
+ using namespace std;
+
+ std::vector<HepMC::GenParticle*> _fsParticles(const HepMC::GenEvent& evt) {
+ std::vector<HepMC::GenParticle*> fsps;
+ for (HepMC::GenEvent::particle_const_iterator p = evt.particles_begin(); p != evt.particles_end(); ++p) {
+ if (!(*p)->end_vertex() && (*p)->status() == 1) {
+ fsps.push_back(*p);
+ }
+ }
+ return fsps;
+ }
+
+
+%}
+
+
+// Suppress SWIG warning about inner classes.
+#pragma SWIG nowarn=SWIGWARN_PARSE_NESTED_CLASS
+
+
+// Ignore iterators, stream operators, etc.
+namespace HepMC {
+ // In GenEvent
+ %ignore GenEvent::particles_begin;
+ %ignore GenEvent::particles_end;
+ %ignore GenEvent::vertices_begin;
+ %ignore GenEvent::vertices_end;
+ %ignore GenEvent::operator=;
+ %ignore GenEvent::print(std::ostream& ostr) const;
+ %rename(as_str) GenEvent::print() const;
+ // // Ignore these HepMC 2.5 features for now
+ // %ignore GenEvent::set_cross_section;
+ // %ignore GenEvent::cross_section;
+ // %ignore GenEvent::set_input_units;
+ // %ignore GenEvent::write;
+ // %ignore GenEvent::read;
+
+
+ // In GenVertex
+ %ignore GenVertex::particles_in_const_begin;
+ %ignore GenVertex::particles_in_const_end;
+ %ignore GenVertex::particles_out_const_begin;
+ %ignore GenVertex::particles_out_const_end;
+ %ignore GenVertex::particles_begin;
+ %ignore GenVertex::particles_end;
+ %ignore GenVertex::vertices_begin;
+ %ignore GenVertex::vertices_end;
+ %ignore GenVertex::operator=;
+ %ignore GenVertex::print;
+ %rename(to_vec3) GenVertex::operator HepMC::ThreeVector;
+ %rename(to_vec4) GenVertex::operator HepMC::FourVector;
+
+ // In GenParticle
+ %ignore GenParticle::operator=;
+ %ignore GenParticle::print;
+ %rename(to_vec4) GenParticle::operator HepMC::FourVector;
+
+ // In IO classes
+ %ignore IO_BaseClass::print;
+ %ignore IO_GenEvent::print;
+
+ // In vectors
+ %ignore FourVector::operator=;
+ %ignore ThreeVector::operator=;
+
+ // Stream ops
+ %ignore IO_BaseClass::operator<<;
+ %ignore operator<<;
+}
+// Mysteriously, this doesn't work within the HepMC namespace above
+%ignore operator<<;
+//%ignore operator<<(std::ostream &, HepMC::GenEvent&);
+
+
+// Declare STL mappings
+%include "std_string.i"
+%include "std_vector.i"
+%include "std_map.i"
+
+
+// Order is important --- no chaining occurs! Import declaration
+// headers before importing headers that use those classes.
+%include "HepMC/SimpleVector.h"
+%include "HepMC/GenEvent.h"
+%include "HepMC/GenParticle.h"
+%include "HepMC/GenVertex.h"
+%include "HepMC/IO_BaseClass.h"
+%include "HepMC/IO_GenEvent.h"
+
+
+// Templates
+%template(GenParticleVector) std::vector<HepMC::GenParticle*>;
+%template(cGenParticleVector) std::vector<const HepMC::GenParticle*>;
+%template(GenVertexVector) std::vector<HepMC::GenVertex*>;
+%template(cGenVertexVector) std::vector<const HepMC::GenVertex*>;
+%template(GenParticlePair) std::pair<HepMC::GenParticle*, HepMC::GenParticle*>;
+%template(cGenParticlePair) std::pair<const HepMC::GenParticle*, const HepMC::GenParticle*>;
+
+
+%extend HepMC::IO_GenEvent {
+ // Provide Python-style IO_GenEvent constructor
+ IO_GenEvent(const std::string& filename, const std::string& mode) {
+ if (filename == "-") {
+ if (mode == "w") return new IO_GenEvent(std::cout);
+ if (mode == "r") return new IO_GenEvent(std::cin);
+ } else {
+ if (mode == "w") return new IO_GenEvent(filename.c_str(), std::ios::out);
+ if (mode == "r") return new IO_GenEvent(filename.c_str(), std::ios::in);
+ }
+ throw runtime_error("Tried to open an IO_GenEvent with an invalid mode string: " + mode);
+ return 0;
+ }
+
+ // Provide event reader method with normal return.
+ HepMC::GenEvent get_next_event() {
+ HepMC::GenEvent rtn;
+ $self->fill_next_event(&rtn);
+ return rtn;
+ }
+
+ // // Provide a way to get an event as a string
+ // std::string event_as_string() {
+ // std::ostringstream ss;
+ // $self->print(ss);
+ // return ss.str();
+ // }
+
+ // // Check stream state
+ // bool is_good() {
+ // if (m_istr) {
+ // return $self->m_istr->good();
+ // } else {
+ // return $self->m_ostr->good();
+ // }
+ // }
+
+ // // Check stream EOF state
+ // bool is_eof() {
+ // if (m_istr) {
+ // return $self->m_istr->eof();
+ // } else {
+ // return $self->m_ostr->eof();
+ // }
+ // }
+
+}
+
+
+%extend HepMC::GenEvent {
+ std::string __str__() {
+ std::ostringstream ss;
+ $self->print(ss);
+ return ss.str();
+ }
+ std::string summary() {
+ std::ostringstream ss;
+ ss << "HepMC::GenEvent { "
+ << $self->particles_size() << " particles "
+ << "(" << _fsParticles(* $self).size() << " in FS), "
+ << $self->vertices_size() << " vertices }";
+ return ss.str();
+ }
+
+ // void dump() {
+ // }
+
+ std::vector<HepMC::GenParticle*> particles() {
+ return std::vector<HepMC::GenParticle*>($self->particles_begin(), $self->particles_end());
+ }
+ std::vector<HepMC::GenVertex*> vertices() {
+ return std::vector<HepMC::GenVertex*>($self->vertices_begin(), $self->vertices_end());
+ }
+ std::vector<HepMC::GenParticle*> fsParticles() {
+ return _fsParticles(* $self);
+ }
+}
+
+
+%extend HepMC::GenParticle {
+ std::string __str__() const {
+ std::stringstream ss;
+ HepMC::FourVector p = $self->momentum();
+ ss << "HepMC::GenParticle { "
+ << $self->pdg_id() << "; p = ("
+ << p.t() << "; "
+ << p.x() << ", "
+ << p.y() << ", "
+ << p.z() << ") "
+ << "}";
+ return ss.str();
+ }
+}
+
+
+%extend HepMC::GenVertex {
+ std::string __str__() const {
+ std::stringstream ss;
+ HepMC::FourVector p = $self->position();
+ ss << "HepMC::GenVertex { "
+ << "("
+ << p.t() << "; "
+ << p.x() << ", "
+ << p.y() << ", "
+ << p.z() << ") "
+ << "}";
+ return ss.str();
+ }
+ std::vector<const HepMC::GenParticle*> particles_in() const {
+ return vector<const GenParticle*>($self->particles_in_const_begin(), $self->particles_in_const_end());
+ }
+ std::vector<const HepMC::GenParticle*> particles_out() const {
+ return vector<const HepMC::GenParticle*>($self->particles_out_const_begin(), $self->particles_out_const_end());
+ }
+ std::vector<HepMC::GenParticle*> particles(HepMC::IteratorRange range=relatives) {
+ return vector<HepMC::GenParticle*>($self->particles_begin(range), $self->particles_end(range));
+ }
+ std::vector<HepMC::GenVertex*> vertices(HepMC::IteratorRange range=relatives) {
+ return vector<HepMC::GenVertex*>($self->vertices_begin(range), $self->vertices_end(range));
+ }
+}
+
+
+%extend HepMC::FourVector {
+ std::string __str__() {
+ std::stringstream ss;
+ ss //<< "HepMC::FourVector { "
+ << "("
+ << $self->t() << "; "
+ << $self->x() << ", "
+ << $self->y() << ", "
+ << $self->z() << ")";
+ //<< " }";
+ return ss.str();
+ }
+}
Index: tags/agile-1.2.0/pyext/ez_setup.py
===================================================================
--- tags/agile-1.2.0/pyext/ez_setup.py (revision 0)
+++ tags/agile-1.2.0/pyext/ez_setup.py (revision 755)
@@ -0,0 +1,276 @@
+#!python
+"""Bootstrap setuptools installation
+
+If you want to use setuptools in your package's setup.py, just include this
+file in the same directory with it, and add this to the top of your setup.py::
+
+ from ez_setup import use_setuptools
+ use_setuptools()
+
+If you want to require a specific version of setuptools, set a download
+mirror, or use an alternate download directory, you can do so by supplying
+the appropriate options to ``use_setuptools()``.
+
+This file can also be run as a script to install or upgrade setuptools.
+"""
+import sys
+DEFAULT_VERSION = "0.6c9"
+DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3]
+
+md5_data = {
+ 'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca',
+ 'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb',
+ 'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b',
+ 'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a',
+ 'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618',
+ 'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac',
+ 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5',
+ 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4',
+ 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c',
+ 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b',
+ 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27',
+ 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277',
+ 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa',
+ 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e',
+ 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e',
+ 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f',
+ 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2',
+ 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc',
+ 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167',
+ 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64',
+ 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d',
+ 'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20',
+ 'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab',
+ 'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53',
+ 'setuptools-0.6c7-py2.3.egg': '209fdf9adc3a615e5115b725658e13e2',
+ 'setuptools-0.6c7-py2.4.egg': '5a8f954807d46a0fb67cf1f26c55a82e',
+ 'setuptools-0.6c7-py2.5.egg': '45d2ad28f9750e7434111fde831e8372',
+ 'setuptools-0.6c8-py2.3.egg': '50759d29b349db8cfd807ba8303f1902',
+ 'setuptools-0.6c8-py2.4.egg': 'cba38d74f7d483c06e9daa6070cce6de',
+ 'setuptools-0.6c8-py2.5.egg': '1721747ee329dc150590a58b3e1ac95b',
+ 'setuptools-0.6c9-py2.3.egg': 'a83c4020414807b496e4cfbe08507c03',
+ 'setuptools-0.6c9-py2.4.egg': '260a2be2e5388d66bdaee06abec6342a',
+ 'setuptools-0.6c9-py2.5.egg': 'fe67c3e5a17b12c0e7c541b7ea43a8e6',
+ 'setuptools-0.6c9-py2.6.egg': 'ca37b1ff16fa2ede6e19383e7b59245a',
+}
+
+import sys, os
+try: from hashlib import md5
+except ImportError: from md5 import md5
+
+def _validate_md5(egg_name, data):
+ if egg_name in md5_data:
+ digest = md5(data).hexdigest()
+ if digest != md5_data[egg_name]:
+ print >>sys.stderr, (
+ "md5 validation of %s failed! (Possible download problem?)"
+ % egg_name
+ )
+ sys.exit(2)
+ return data
+
+def use_setuptools(
+ version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
+ download_delay=15
+):
+ """Automatically find/download setuptools and make it available on sys.path
+
+ `version` should be a valid setuptools version number that is available
+ as an egg for download under the `download_base` URL (which should end with
+ a '/'). `to_dir` is the directory where setuptools will be downloaded, if
+ it is not already available. If `download_delay` is specified, it should
+ be the number of seconds that will be paused before initiating a download,
+ should one be required. If an older version of setuptools is installed,
+ this routine will print a message to ``sys.stderr`` and raise SystemExit in
+ an attempt to abort the calling script.
+ """
+ was_imported = 'pkg_resources' in sys.modules or 'setuptools' in sys.modules
+ def do_download():
+ egg = download_setuptools(version, download_base, to_dir, download_delay)
+ sys.path.insert(0, egg)
+ import setuptools; setuptools.bootstrap_install_from = egg
+ try:
+ import pkg_resources
+ except ImportError:
+ return do_download()
+ try:
+ pkg_resources.require("setuptools>="+version); return
+ except pkg_resources.VersionConflict, e:
+ if was_imported:
+ print >>sys.stderr, (
+ "The required version of setuptools (>=%s) is not available, and\n"
+ "can't be installed while this script is running. Please install\n"
+ " a more recent version first, using 'easy_install -U setuptools'."
+ "\n\n(Currently using %r)"
+ ) % (version, e.args[0])
+ sys.exit(2)
+ else:
+ del pkg_resources, sys.modules['pkg_resources'] # reload ok
+ return do_download()
+ except pkg_resources.DistributionNotFound:
+ return do_download()
+
+def download_setuptools(
+ version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir,
+ delay = 15
+):
+ """Download setuptools from a specified location and return its filename
+
+ `version` should be a valid setuptools version number that is available
+ as an egg for download under the `download_base` URL (which should end
+ with a '/'). `to_dir` is the directory where the egg will be downloaded.
+ `delay` is the number of seconds to pause before an actual download attempt.
+ """
+ import urllib2, shutil
+ egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3])
+ url = download_base + egg_name
+ saveto = os.path.join(to_dir, egg_name)
+ src = dst = None
+ if not os.path.exists(saveto): # Avoid repeated downloads
+ try:
+ from distutils import log
+ if delay:
+ log.warn("""
+---------------------------------------------------------------------------
+This script requires setuptools version %s to run (even to display
+help). I will attempt to download it for you (from
+%s), but
+you may need to enable firewall access for this script first.
+I will start the download in %d seconds.
+
+(Note: if this machine does not have network access, please obtain the file
+
+ %s
+
+and place it in this directory before rerunning this script.)
+---------------------------------------------------------------------------""",
+ version, download_base, delay, url
+ ); from time import sleep; sleep(delay)
+ log.warn("Downloading %s", url)
+ src = urllib2.urlopen(url)
+ # Read/write all in one block, so we don't create a corrupt file
+ # if the download is interrupted.
+ data = _validate_md5(egg_name, src.read())
+ dst = open(saveto,"wb"); dst.write(data)
+ finally:
+ if src: src.close()
+ if dst: dst.close()
+ return os.path.realpath(saveto)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+def main(argv, version=DEFAULT_VERSION):
+ """Install or upgrade setuptools and EasyInstall"""
+ try:
+ import setuptools
+ except ImportError:
+ egg = None
+ try:
+ egg = download_setuptools(version, delay=0)
+ sys.path.insert(0,egg)
+ from setuptools.command.easy_install import main
+ return main(list(argv)+[egg]) # we're done here
+ finally:
+ if egg and os.path.exists(egg):
+ os.unlink(egg)
+ else:
+ if setuptools.__version__ == '0.0.1':
+ print >>sys.stderr, (
+ "You have an obsolete version of setuptools installed. Please\n"
+ "remove it from your system entirely before rerunning this script."
+ )
+ sys.exit(2)
+
+ req = "setuptools>="+version
+ import pkg_resources
+ try:
+ pkg_resources.require(req)
+ except pkg_resources.VersionConflict:
+ try:
+ from setuptools.command.easy_install import main
+ except ImportError:
+ from easy_install import main
+ main(list(argv)+[download_setuptools(delay=0)])
+ sys.exit(0) # try to force an exit
+ else:
+ if argv:
+ from setuptools.command.easy_install import main
+ main(argv)
+ else:
+ print "Setuptools version",version,"or greater has been installed."
+ print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)'
+
+def update_md5(filenames):
+ """Update our built-in md5 registry"""
+
+ import re
+
+ for name in filenames:
+ base = os.path.basename(name)
+ f = open(name,'rb')
+ md5_data[base] = md5(f.read()).hexdigest()
+ f.close()
+
+ data = [" %r: %r,\n" % it for it in md5_data.items()]
+ data.sort()
+ repl = "".join(data)
+
+ import inspect
+ srcfile = inspect.getsourcefile(sys.modules[__name__])
+ f = open(srcfile, 'rb'); src = f.read(); f.close()
+
+ match = re.search("\nmd5_data = {\n([^}]+)}", src)
+ if not match:
+ print >>sys.stderr, "Internal error!"
+ sys.exit(2)
+
+ src = src[:match.start(1)] + repl + src[match.end(1):]
+ f = open(srcfile,'w')
+ f.write(src)
+ f.close()
+
+
+if __name__=='__main__':
+ if len(sys.argv)>2 and sys.argv[1]=='--md5update':
+ update_md5(sys.argv[2:])
+ else:
+ main(sys.argv[1:])
+
+
+
+
+
+
Index: tags/agile-1.2.0/pyext
===================================================================
--- tags/agile-1.2.0/pyext (revision 754)
+++ tags/agile-1.2.0/pyext (revision 755)
Property changes on: tags/agile-1.2.0/pyext
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,8 ##
+Makefile.in
+Makefile
+AGILe.py*
+AGILe_wrap.*
+.libs
+.deps
+build
+setup.py
Index: tags/agile-1.2.0/agileenv.csh.in
===================================================================
--- tags/agile-1.2.0/agileenv.csh.in (revision 0)
+++ tags/agile-1.2.0/agileenv.csh.in (revision 755)
@@ -0,0 +1,13 @@
+# These variables need to exist
+set prefix=@prefix@
+set exec_prefix=@exec_prefix@
+set datarootdir=@datarootdir@
+
+setenv PATH "$exec_prefix/bin:$PATH"
+setenv @LIBPATHVARNAME@ "@libdir@:@HEPMCLIBPATH@:$@LIBPATHVARNAME@"
+
+if ($?PYTHONPATH) then
+setenv PYTHONPATH "@AGILE_PYTHONPATH@:$PYTHONPATH"
+else
+setenv PYTHONPATH "@AGILE_PYTHONPATH@"
+endif
Index: tags/agile-1.2.0/NEWS
===================================================================
Index: tags/agile-1.2.0/test/Makefile.am
===================================================================
Index: tags/agile-1.2.0/test
===================================================================
--- tags/agile-1.2.0/test (revision 754)
+++ tags/agile-1.2.0/test (revision 755)
Property changes on: tags/agile-1.2.0/test
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,2 ##
+Makefile
+Makefile.in
Index: tags/agile-1.2.0
===================================================================
--- tags/agile-1.2.0 (revision 754)
+++ tags/agile-1.2.0 (revision 755)
Property changes on: tags/agile-1.2.0
___________________________________________________________________
Added: svn:ignore
## -0,0 +1,21 ##
+a.out
+*.tar.bz2
+*.tar.gz
+Makefile
+Makefile.in
+aclocal.m4
+autom4te.cache
+config.status
+configure
+libtool
+Rivet-*
+config.log
+config.guess
+config.sub
+depcomp
+install-sh
+ltmain.sh
+missing
+*.loT
+fort.*
+py-compile
Added: svn:externals
## -0,0 +1 ##
+m4 http://svn.hepforge.org/cedar/trunk/pub/autotools

File Metadata

Mime Type
text/x-diff
Expires
Tue, Nov 19, 6:06 PM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3805500
Default Alt Text
(943 KB)

Event Timeline