ODIN
seqclass.h
1 /***************************************************************************
2  seqclass.h - description
3  -------------------
4  begin : Sun Jan 20 2002
5  copyright : (C) 2000-2021 by Thies H. Jochimsen
6  email : thies@jochimsen.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef SEQCLASS_H
19 #define SEQCLASS_H
20 
21 
22 #include <tjutils/tjtypes.h>
23 #include <tjutils/tjstring.h>
24 #include <tjutils/tjstatic.h>
25 #include <tjutils/tjlog.h>
26 #include <tjutils/tjlabel.h>
27 #include <tjutils/tjindex.h>
28 #include <tjutils/tjhandler.h>
29 #include <tjutils/tjvector.h>
30 
31 #include <odinpara/reco.h>
32 #include <odinpara/geometry.h>
33 #include <odinpara/seqpars.h>
34 #include <odinpara/study.h>
35 #include <odinpara/system.h>
36 
37 
45 
46 // For debugging the Seq component
47 class Seq {
48  public:
49  static const char* get_compName();
50 };
51 
53 
54 class SeqVector; //forward declaration
55 
62 class SeqClass : public virtual Labeled, public StaticHandler<SeqClass> {
63 
64  public:
65 
66 
71 
72 
73  System& get_systemInfo() {return *systemInfo;}
74 
75  // functions to initialize/delete static members by the StaticHandler template class
76  static void init_static();
77  static void destroy_static();
78 
79 
80  protected:
81 
82  // prevent direct construction/assignment/destruction of this class
83  SeqClass();
84  virtual ~SeqClass();
85  SeqClass& operator = (const SeqClass& sc);
86 
90  void marshall_error() const;
91 
95  static void clear_temporary();
96 
102  virtual void clear_container() {}
103 
104 
108  static void clear_containers();
109 
116  virtual bool prep() {prepped=true; return true;}
117 
118 
119  // call prep() of all objects
120  static bool prep_all();
121 
122 
123  // points to systemInfo of the currently active platform
124  SystemInterface& systemInfo;
125 
126  // points to the geometry parameters
127  static SingletonHandler<Geometry,false> geometryInfo;
128 
129  // points to the geometry parameters
130  static SingletonHandler<Study,false> studyInfo;
131 
132  // points to the reco parameters
133  static SingletonHandler<RecoPars,false> recoInfo;
134 
135 
136  static SeqVector& get_dummyvec();
137 
138 
139  private:
140  friend class SeqOperator;
141  friend class SeqMethod;
142  friend class SeqMethodProxy;
143  friend class SystemInterface;
144  friend class SeqPlatformProxy;
145 
146 
147  // remove all references to other sequence objects
148  static void clear_objlists();
149 
150  bool prepped;
151 
152  // List to hold references to SeqClass objects
153  struct SeqClassList : public STD_list<SeqClass *>, public Labeled {};
154 
155  static SingletonHandler<SeqClassList,false> allseqobjs;
156  static SingletonHandler<SeqClassList,false> tmpseqobjs;
157 
158  static SingletonHandler<SeqClassList,false> seqobjs2prep;
159  static SingletonHandler<SeqClassList,false> seqobjs2clear;
160 
161  static SystemInterface* systemInfo_ptr;
162 
163  static SeqVector* dummyvec;
164 };
165 
166 
167 
170 #endif
virtual bool prep()
Definition: seqclass.h:116
virtual void clear_container()
Definition: seqclass.h:102
static void clear_containers()
SeqClass & set_temporary()
static void clear_temporary()
void marshall_error() const
Base class for methods (sequences)
Definition: seqmeth.h:155
System proxy.
Definition: system.h:91