00001 #ifndef MARLINSTEERCHECK_H
00002 #define MARLINSTEERCHECK_H
00003
00004 #include "marlin/CCProcessor.h"
00005 #include "marlin/CCCollection.h"
00006 #include "marlin/CMProcessor.h"
00007 #include "marlin/XMLParser.h"
00008
00009
00010
00011 #define TERM_COLOR
00012
00013 #ifdef TERM_COLOR
00014
00015 #define clrscr() printf("\033[2J")
00016 #define dblue() printf("\x1b[34m")
00017 #define dred() printf("\x1b[31m")
00018 #define dyellow() printf("\x1b[33m")
00019 #define dgreen() printf("\x1b[32m")
00020 #define dunderline() printf("\x1b[4m")
00021 #define ditalic() printf("\x1b[3m")
00022 #define ddunkel() printf("\x1b[2m")
00023 #define dhell() printf("\x1b[1m")
00024 #define dblink() printf("\x1b[5m")
00025 #define endcolor() printf("\x1b[m")
00026
00027 #else
00028
00029 #define clrscr()
00030 #define dblue()
00031 #define dred()
00032 #define dyellow()
00033 #define dgreen()
00034 #define dunderline()
00035 #define ditalic()
00036 #define ddunkel()
00037 #define dhell()
00038 #define dblink()
00039 #define endcolor()
00040
00041 #endif
00042
00043 #define MAXEVENTS 30
00044
00045 namespace marlin {
00046
00047 class CCCollection;
00048 class CCProcessor;
00049
00050 typedef std::vector< CCProcessor* > ProcVec;
00051
00072 class MarlinSteerCheck{
00073
00074 public:
00075
00076
00077 MarlinSteerCheck( const char* steerFileName=NULL );
00078
00079
00080 ~MarlinSteerCheck();
00081
00083 CMProcessor* getMProcs() { return _marlinProcs; };
00084
00086 ProcVec& getAProcs() { return _aProc; };
00087
00089 ProcVec& getIProcs() { return _iProc; };
00090
00095 int existsProcessor( const std::string& type, const std::string& name="" );
00096
00098 ColVec& getLCIOCols() const;
00099
00101 StringVec& getLCIOFiles(){ return _lcioFiles; }
00102
00104 sSet& getColsSet( const std::string& type, const std::string& name, CCProcessor* proc );
00105
00107 StringParameters* getGlobalParameters(){ return _gparam; }
00108
00110 void dumpColErrors( unsigned int i, std::ostream& stream, bool separators=false );
00111
00113 int addLCIOFile( const std::string& file );
00114
00116 void remLCIOFile( const std::string& file );
00117
00119 void changeLCIOFilePos( unsigned int pos, unsigned int newPos );
00120
00122 void addProcessor( bool status, const std::string& name, const std::string& type, StringParameters* p=NULL );
00123
00125 void remProcessor( unsigned int index, bool status );
00126
00128 void activateProcessor( unsigned int index );
00129
00131 void deactivateProcessor( unsigned int index );
00132
00134 void changeProcessorPos( unsigned int pos, unsigned int newPos );
00135
00137 void consistencyCheck();
00138
00141 bool saveAsXMLFile( const std::string& file );
00142
00143
00144 const std::string getXMLFileRelPath(){ return _XMLFileRelPath; }
00145
00146
00147 const std::string getXMLFileAbsPath(){ return _XMLFileAbsPath; }
00148
00149
00150 const std::string getXMLFileName(){ return _XMLFileName; }
00151
00152
00153 const std::string getXMLFile(){ return _steeringFile; }
00154
00156 void dump_information();
00157
00159 sSet& getErrors(){ return _errors; };
00160
00162 sSet& getPConditions(){ return _pConditions; };
00163
00165 const std::string getCondition( unsigned int index );
00166
00168 void addCondition( const std::string& condition );
00169
00171 void repCondition( const std::string& oldCond, const std::string& newCond );
00172
00174 void remCondition( const std::string& condition );
00175
00177 bool saveAsDOTFile(const std::string& file);
00178
00179 private:
00180
00182
00184
00185
00186 ColVec& getProcCols( const ProcVec& v, const std::string& iotype ) const;
00187
00188
00189 ColVec& getAllCols() const;
00190
00191
00192 ProcVec& getAllProcs() const;
00193
00194
00195 bool parseXMLFile( const std::string& file );
00196
00197
00198 CCProcessor* popProc(ProcVec& v, CCProcessor* p);
00199
00200
00201 ColVec& findMatchingCols( ColVec& v, CCProcessor* srcProc,
00202 const std::string& type, const std::string& value="UNDEFINED", const std::string& name="UNDEFINED" );
00203
00205
00207
00208 sSet _errors;
00209
00210
00211
00212
00213
00214
00215
00216 IParser* _parser;
00217 StringParameters* _gparam;
00218
00219 std::string _steeringFile;
00220 std::string _XMLFileName;
00221 std::string _XMLFileAbsPath;
00222 std::string _XMLFileRelPath;
00223
00224 ProcVec _aProc;
00225 ProcVec _iProc;
00226 sColVecMap _lcioCols;
00227 StringVec _lcioFiles;
00228
00229 sSet _colValues;
00230
00231 sSet _pConditions;
00232
00233 CMProcessor* _marlinProcs;
00234 };
00235
00236 }
00237 #endif