ODIN
seqlist.h
1 /***************************************************************************
2  seqlist.h - description
3  -------------------
4  begin : Wed Aug 14 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 
19 
20 #ifndef SEQLIST_H
21 #define SEQLIST_H
22 
23 
24 #include <tjutils/tjlist.h>
25 
26 #include <odinseq/seqobj.h>
27 #include <odinseq/seqdriver.h>
28 #include <odinseq/seqrotmatrixvector.h>
29 
30 
31 #define _MIN_PPG_CMDSIZE_ 25
32 #define _MIN_GP_CMDSIZE_ 50
33 
34 
35 
36 
46 class SeqListDriver : public SeqDriverBase {
47 
48  public:
49  SeqListDriver() {}
50  virtual ~SeqListDriver() {}
51 
52  virtual STD_string pre_program (programContext& context, const SeqRotMatrixVector* rotmats) const = 0;
53  virtual STD_string post_program(programContext& context, const SeqRotMatrixVector* rotmats) const = 0;
54 
55  virtual STD_string get_itemprogram(const SeqTreeObj* item, programContext& context) const = 0;
56 
57  virtual void pre_event (eventContext& context, const RotMatrix* rotmatrix) const = 0;
58  virtual void post_event(eventContext& context, const RotMatrix* rotmatrix) const = 0;
59 
60  virtual void pre_itemevent (const SeqTreeObj* item, eventContext& context) const = 0;
61  virtual void post_itemevent(const SeqTreeObj* item, eventContext& context) const = 0;
62 
63  virtual bool prep_driver() = 0;
64 
65  virtual SeqListDriver* clone_driver() const = 0;
66 };
67 
73 
74 class SeqObjLoop; // forward declaration
75 class SeqDecoupling; // forward declaration
76 class SeqGradObjInterface; // forward declaration
77 class SeqGradChan; // forward declaration
78 class SeqGradChanList; // forward declaration
79 
87 class SeqObjList : public SeqObjBase, public List<SeqObjBase, const SeqObjBase*, const SeqObjBase& > {
88 
89  public:
90 
94  SeqObjList(const STD_string& object_label="unnamedSeqObjList");
95 
99  SeqObjList(const SeqObjList& so);
100 
101  ~SeqObjList();
102 
107 
112 
113 
118 
119 
124 
128  SeqObjList& operator = (SeqGradObjInterface& sgoa) {clear(); return (*this)+=sgoa;}
129 
133  SeqObjList& operator = (SeqGradChan& sgc) {clear(); return (*this)+=sgc;}
134 
138  SeqObjList& operator = (SeqGradChanList& sgcl) {clear(); return (*this)+=sgcl;}
139 
144 
149 
150 
155 
160 
161 
162 
168  SeqObjList& set_gradrotmatrixvector(const SeqRotMatrixVector& matrixVec) {gradrotmatrixvec.set_handled(&matrixVec); return *this;}
169 
170 
171 
172  // overloading virtual function from SeqTreeObj
173  STD_string get_program(programContext& context) const;
174  unsigned int event(eventContext& context) const;
175  double get_duration() const;
176  STD_string get_properties() const;
177  void query(queryContext& context) const;
178  RecoValList get_recovallist(unsigned int reptimes, LDRkSpaceCoords& coords) const;
181  double get_rf_energy() const;
182 
183  protected:
184 
185  // overloading virtual function from SeqClass
186  void clear_container() {clear();}
187  bool prep();
188 
189  private:
190  friend class SeqGradChan;
191  friend class SeqOperator;
192 
193  // overloading virtual function from SeqObjBase
194  bool contains_list() const {return true;}
195 
196 
197  mutable SeqDriverInterface<SeqListDriver> listdriver;
198 
199  Handler<const SeqRotMatrixVector* > gradrotmatrixvec;
200  static Handler<const SeqRotMatrixVector* > current_gradrotmatrixvec;
201 
202 };
203 
204 #endif
Definition: tjlist.h:105
Rotation Matrix.
Definition: geometry.h:67
Decoupling period.
Definition: seqdec.h:70
Container for sequence objects.
Definition: seqlist.h:87
void clear_container()
Definition: seqlist.h:186
SeqObjList & operator=(const SeqObjList &so)
SeqObjList(const STD_string &object_label="unnamedSeqObjList")
STD_string get_program(programContext &context) const
bool prep()
double get_duration() const
double get_rf_energy() const
SeqObjList & set_gradrotmatrixvector(const SeqRotMatrixVector &matrixVec)
Definition: seqlist.h:168
STD_string get_properties() const
SeqObjList(const SeqObjList &so)
unsigned int event(eventContext &context) const
SeqValList get_delayvallist() const
SeqValList get_freqvallist(freqlistAction action) const
SeqObjList & operator+=(const SeqObjBase &soa)
RecoValList get_recovallist(unsigned int reptimes, LDRkSpaceCoords &coords) const
void query(queryContext &context) const
Sequence Loop.
Definition: seqloop.h:38
Vector of SeqRotMatrix's.
freqlistAction
Definition: seqtree.h:102