00001 /*************************************************************************** 00002 seqclass.h - description 00003 ------------------- 00004 begin : Sun Jan 20 2002 00005 copyright : (C) 2001 by Thies H. Jochimsen 00006 email : jochimse@cns.mpg.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef SEQCLASS_H 00019 #define SEQCLASS_H 00020 00021 00022 #include <tjutils/tjtypes.h> 00023 #include <tjutils/tjstring.h> 00024 #include <tjutils/tjstatic.h> 00025 #include <tjutils/tjlog.h> 00026 #include <tjutils/tjlabel.h> 00027 #include <tjutils/tjindex.h> 00028 #include <tjutils/tjhandler.h> 00029 #include <tjutils/tjvector.h> 00030 00031 #include <odinpara/reco.h> 00032 #include <odinpara/geometry.h> 00033 #include <odinpara/seqpars.h> 00034 #include <odinpara/study.h> 00035 #include <odinpara/system.h> 00036 00037 00044 00045 00046 // For debugging the Seq component 00047 class Seq { 00048 public: 00049 static const char* get_compName(); 00050 }; 00051 00053 00054 class SeqVector; //forward declaration 00055 00062 class SeqClass : public virtual Labeled, public StaticHandler<SeqClass> { 00063 00064 public: 00065 00066 00070 SeqClass& set_temporary(); 00071 00072 00073 System& get_systemInfo() {return *systemInfo;} 00074 00075 // functions to initialize/delete static members by the StaticHandler template class 00076 static void init_static(); 00077 static void destroy_static(); 00078 00079 00080 protected: 00081 00082 // prevent direct construction/assignment/destruction of this class 00083 SeqClass(); 00084 virtual ~SeqClass(); 00085 SeqClass& operator = (const SeqClass& sc); 00086 00090 void marshall_error() const; 00091 00095 static void clear_temporary(); 00096 00102 virtual void clear_container() {} 00103 00104 00108 static void clear_containers(); 00109 00116 virtual bool prep() {prepped=true; return true;} 00117 00118 00119 // call prep() of all objects 00120 static bool prep_all(); 00121 00122 00123 // points to systemInfo of the currently active platform 00124 SystemInterface& systemInfo; 00125 00126 // points to the geometry parameters 00127 static SingletonHandler<Geometry,false> geometryInfo; 00128 00129 // points to the geometry parameters 00130 static SingletonHandler<Study,false> studyInfo; 00131 00132 // points to the reco parameters 00133 static SingletonHandler<RecoPars,false> recoInfo; 00134 00135 00136 static SeqVector& get_dummyvec(); 00137 00138 00139 private: 00140 friend class SeqOperator; 00141 friend class SeqMethod; 00142 friend class SeqMethodProxy; 00143 friend class SystemInterface; 00144 friend class SeqPlatformProxy; 00145 00146 00147 // remove all references to other sequence objects 00148 static void clear_objlists(); 00149 00150 bool prepped; 00151 00152 // List to hold references to SeqClass objects 00153 struct SeqClassList : public STD_list<SeqClass *>, public Labeled {}; 00154 00155 static SingletonHandler<SeqClassList,false> allseqobjs; 00156 static SingletonHandler<SeqClassList,false> tmpseqobjs; 00157 00158 static SingletonHandler<SeqClassList,false> seqobjs2prep; 00159 static SingletonHandler<SeqClassList,false> seqobjs2clear; 00160 00161 static SystemInterface* systemInfo_ptr; 00162 00163 static SeqVector* dummyvec; 00164 }; 00165 00166 00167 00170 #endif
1.5.6