ODIN
seqoperator.h
1 /***************************************************************************
2  seqoperator.h - description
3  -------------------
4  begin : Mon Apr 19 2004
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 SEQOPERATOR_H
19 #define SEQOPERATOR_H
20 
21 #include <odinseq/seqclass.h>
22 
23 
24 // forward declarations
25 class SeqObjBase;
27 class SeqObjList;
28 class SeqObjLoop;
29 class SeqDecoupling;
30 class SeqParallel;
31 class SeqGradChan;
32 class SeqGradChanList;
34 
39 class SeqOperator : public SeqClass {
40 
41  public:
42  static SeqObjList& concat(const SeqObjBase& s1, const SeqObjBase& s2);
43  static SeqObjList& concat(const SeqObjBase& s1, const SeqObjList& s2, bool swap);
44  static SeqObjList& concat(const SeqObjBase& s1, const SeqObjLoop& s2, bool swap);
45  static SeqObjList& concat(const SeqObjBase& s1, const SeqDecoupling& s2, bool swap);
46  static SeqObjList& concat(const SeqObjBase& s1, const SeqParallel& s2, bool swap);
47  static SeqObjList& concat(const SeqObjBase& s1, SeqGradChan& s2, bool swap);
48  static SeqObjList& concat(const SeqObjBase& s1, SeqGradChanList& s2, bool swap);
49  static SeqObjList& concat(const SeqObjBase& s1, SeqGradChanParallel& s2, bool swap);
50 
51  static SeqObjList& concat(const SeqObjList& s1, const SeqObjList& s2);
52  static SeqObjList& concat(const SeqObjList& s1, const SeqObjLoop& s2, bool swap);
53  static SeqObjList& concat(const SeqObjList& s1, const SeqDecoupling& s2, bool swap);
54  static SeqObjList& concat(const SeqObjList& s1, const SeqParallel& s2, bool swap);
55  static SeqObjList& concat(const SeqObjList& s1, SeqGradChan& s2, bool swap);
56  static SeqObjList& concat(const SeqObjList& s1, SeqGradChanList& s2, bool swap);
57  static SeqObjList& concat(const SeqObjList& s1, SeqGradChanParallel& s2, bool swap);
58 
59  static SeqObjList& concat(const SeqObjLoop& s1, const SeqObjLoop& s2);
60  static SeqObjList& concat(const SeqObjLoop& s1, const SeqDecoupling& s2, bool swap);
61  static SeqObjList& concat(const SeqObjLoop& s1, const SeqParallel& s2, bool swap);
62  static SeqObjList& concat(const SeqObjLoop& s1, SeqGradChan& s2, bool swap);
63  static SeqObjList& concat(const SeqObjLoop& s1, SeqGradChanList& s2, bool swap);
64  static SeqObjList& concat(const SeqObjLoop& s1, SeqGradChanParallel& s2, bool swap);
65 
66  static SeqObjList& concat(const SeqDecoupling& s1, const SeqDecoupling& s2);
67  static SeqObjList& concat(const SeqDecoupling& s1, const SeqParallel& s2, bool swap);
68  static SeqObjList& concat(const SeqDecoupling& s1, SeqGradChan& s2, bool swap);
69  static SeqObjList& concat(const SeqDecoupling& s1, SeqGradChanList& s2, bool swap);
70  static SeqObjList& concat(const SeqDecoupling& s1, SeqGradChanParallel& s2, bool swap);
71 
72  static SeqObjList& concat(const SeqParallel& s1, const SeqParallel& s2);
73  static SeqObjList& concat(const SeqParallel& s1, SeqGradChan& s2, bool swap);
74  static SeqObjList& concat(const SeqParallel& s1, SeqGradChanList& s2, bool swap);
75  static SeqObjList& concat(const SeqParallel& s1, SeqGradChanParallel& s2, bool swap);
76 
77  static SeqGradChanList& concat(SeqGradChan& s1, SeqGradChan& s2);
78  static SeqGradChanList& concat(SeqGradChan& s1, SeqGradChanList& s2, bool swap);
79  static SeqGradChanParallel& concat(SeqGradChan& s1, SeqGradChanParallel& s2, bool swap);
80 
81  static SeqGradChanList& concat(SeqGradChanList& s1, SeqGradChanList& s2);
82  static SeqGradChanParallel& concat(SeqGradChanList& s1, SeqGradChanParallel& s2, bool swap);
83 
85 
86 
87 
88  static SeqParallel& simultan(const SeqObjBase& s1, SeqGradObjInterface& s2);
89  static SeqParallel& simultan(const SeqObjBase& s1, SeqGradChan& s2);
90  static SeqParallel& simultan(const SeqObjBase& s1, SeqGradChanList& s2);
91 
92 
93  static SeqGradChanParallel& simultan(SeqGradChan& s1, SeqGradChan& s2);
94  static SeqGradChanParallel& simultan(SeqGradChan& s1, SeqGradChanList& s2);
95  static SeqGradChanParallel& simultan(SeqGradChan& s1, SeqGradChanParallel& s2);
96 
97  static SeqGradChanParallel& simultan(SeqGradChanList& s1, SeqGradChanList& s2);
98  static SeqGradChanParallel& simultan(SeqGradChanList& s1, SeqGradChanParallel& s2);
99 
101 
102  private:
103  static void append_list2list(SeqObjList& dst, const SeqObjList& src);
104 
105  static SeqObjList& create_SeqObjList_label(const STD_string& label1, const STD_string& label2, bool swap);
106  static SeqObjList& create_SeqObjList_obj(const SeqObjBase& s1, const SeqObjBase& s2, bool swap);
107  static SeqObjList& create_SeqObjList_list(const SeqObjList& s1, const SeqObjBase& s2, bool swap);
108 
109  static SeqGradChanList& create_SeqGradChanList(const STD_string& label1, const STD_string& label2, bool swap);
110  static SeqGradChanList& create_SeqGradChanList(SeqGradChan& sgc);
111  static SeqGradChanParallel& create_SeqGradChanParallel_concat(const STD_string& label1, const STD_string& label2, bool swap);
112 
113  static SeqParallel& create_SeqParallel(const STD_string& label1, const STD_string& label2);
114  static SeqGradChanParallel& create_SeqGradChanParallel_simultan(const STD_string& label1, const STD_string& label2);
115 
116 };
117 
118 inline SeqObjList& operator + (const SeqObjBase& s1, const SeqObjBase& s2){return SeqOperator::concat(s1,s2);}
119 inline SeqObjList& operator + (const SeqObjBase& s1, const SeqObjList& s2) {return SeqOperator::concat(s1,s2,false);}
120 inline SeqObjList& operator + (const SeqObjBase& s1, const SeqObjLoop& s2) {return SeqOperator::concat(s1,s2,false);}
121 inline SeqObjList& operator + (const SeqObjBase& s1, const SeqDecoupling& s2) {return SeqOperator::concat(s1,s2,false);}
122 inline SeqObjList& operator + (const SeqObjBase& s1, const SeqParallel& s2) {return SeqOperator::concat(s1,s2,false);}
123 inline SeqObjList& operator + (const SeqObjBase& s1, SeqGradChan& s2) {return SeqOperator::concat(s1,s2,false);}
124 inline SeqObjList& operator + (const SeqObjBase& s1, SeqGradChanList& s2) {return SeqOperator::concat(s1,s2,false);}
125 inline SeqObjList& operator + (const SeqObjBase& s1, SeqGradChanParallel& s2) {return SeqOperator::concat(s1,s2,false);}
126 
127 inline SeqObjList& operator + (const SeqObjList& s1, const SeqObjBase& s2){return SeqOperator::concat(s2,s1,true);}
128 inline SeqObjList& operator + (const SeqObjList& s1, const SeqObjList& s2) {return SeqOperator::concat(s1,s2);}
129 inline SeqObjList& operator + (const SeqObjList& s1, const SeqObjLoop& s2) {return SeqOperator::concat(s1,s2,false);}
130 inline SeqObjList& operator + (const SeqObjList& s1, const SeqDecoupling& s2) {return SeqOperator::concat(s1,s2,false);}
131 inline SeqObjList& operator + (const SeqObjList& s1, const SeqParallel& s2) {return SeqOperator::concat(s1,s2,false);}
132 inline SeqObjList& operator + (const SeqObjList& s1, SeqGradChan& s2) {return SeqOperator::concat(s1,s2,false);}
133 inline SeqObjList& operator + (const SeqObjList& s1, SeqGradChanList& s2) {return SeqOperator::concat(s1,s2,false);}
134 inline SeqObjList& operator + (const SeqObjList& s1, SeqGradChanParallel& s2) {return SeqOperator::concat(s1,s2,false);}
135 
136 inline SeqObjList& operator + (const SeqObjLoop& s1, const SeqObjBase& s2){return SeqOperator::concat(s2,s1,true);}
137 inline SeqObjList& operator + (const SeqObjLoop& s1, const SeqObjList& s2) {return SeqOperator::concat(s2,s1,true);}
138 inline SeqObjList& operator + (const SeqObjLoop& s1, const SeqObjLoop& s2) {return SeqOperator::concat(s1,s2);}
139 inline SeqObjList& operator + (const SeqObjLoop& s1, const SeqDecoupling& s2) {return SeqOperator::concat(s1,s2,false);}
140 inline SeqObjList& operator + (const SeqObjLoop& s1, const SeqParallel& s2) {return SeqOperator::concat(s1,s2,false);}
141 inline SeqObjList& operator + (const SeqObjLoop& s1, SeqGradChan& s2) {return SeqOperator::concat(s1,s2,false);}
142 inline SeqObjList& operator + (const SeqObjLoop& s1, SeqGradChanList& s2) {return SeqOperator::concat(s1,s2,false);}
143 inline SeqObjList& operator + (const SeqObjLoop& s1, SeqGradChanParallel& s2) {return SeqOperator::concat(s1,s2,false);}
144 
145 inline SeqObjList& operator + (const SeqDecoupling& s1, const SeqObjBase& s2){return SeqOperator::concat(s2,s1,true);}
146 inline SeqObjList& operator + (const SeqDecoupling& s1, const SeqObjList& s2) {return SeqOperator::concat(s2,s1,true);}
147 inline SeqObjList& operator + (const SeqDecoupling& s1, const SeqObjLoop& s2) {return SeqOperator::concat(s2,s1,true);}
148 inline SeqObjList& operator + (const SeqDecoupling& s1, const SeqDecoupling& s2) {return SeqOperator::concat(s1,s2);}
149 inline SeqObjList& operator + (const SeqDecoupling& s1, const SeqParallel& s2) {return SeqOperator::concat(s1,s2,false);}
150 inline SeqObjList& operator + (const SeqDecoupling& s1, SeqGradChan& s2) {return SeqOperator::concat(s1,s2,false);}
151 inline SeqObjList& operator + (const SeqDecoupling& s1, SeqGradChanList& s2) {return SeqOperator::concat(s1,s2,false);}
152 inline SeqObjList& operator + (const SeqDecoupling& s1, SeqGradChanParallel& s2) {return SeqOperator::concat(s1,s2,false);}
153 
154 inline SeqObjList& operator + (const SeqParallel& s1, const SeqObjBase& s2){return SeqOperator::concat(s2,s1,true);}
155 inline SeqObjList& operator + (const SeqParallel& s1, const SeqObjList& s2) {return SeqOperator::concat(s2,s1,true);}
156 inline SeqObjList& operator + (const SeqParallel& s1, const SeqObjLoop& s2) {return SeqOperator::concat(s2,s1,true);}
157 inline SeqObjList& operator + (const SeqParallel& s1, const SeqDecoupling& s2) {return SeqOperator::concat(s2,s1,true);}
158 inline SeqObjList& operator + (const SeqParallel& s1, const SeqParallel& s2) {return SeqOperator::concat(s1,s2);}
159 inline SeqObjList& operator + (const SeqParallel& s1, SeqGradChan& s2) {return SeqOperator::concat(s1,s2,false);}
160 inline SeqObjList& operator + (const SeqParallel& s1, SeqGradChanList& s2) {return SeqOperator::concat(s1,s2,false);}
161 inline SeqObjList& operator + (const SeqParallel& s1, SeqGradChanParallel& s2) {return SeqOperator::concat(s1,s2,false);}
162 
163 inline SeqObjList& operator + (SeqGradChan& s1, const SeqObjBase& s2){return SeqOperator::concat(s2,s1,true);}
164 inline SeqObjList& operator + (SeqGradChan& s1, const SeqObjList& s2) {return SeqOperator::concat(s2,s1,true);}
165 inline SeqObjList& operator + (SeqGradChan& s1, const SeqObjLoop& s2) {return SeqOperator::concat(s2,s1,true);}
166 inline SeqObjList& operator + (SeqGradChan& s1, const SeqDecoupling& s2) {return SeqOperator::concat(s2,s1,true);}
167 inline SeqObjList& operator + (SeqGradChan& s1, const SeqParallel& s2) {return SeqOperator::concat(s2,s1,true);}
168 inline SeqGradChanList& operator + (SeqGradChan& s1, SeqGradChan& s2) {return SeqOperator::concat(s1,s2);}
169 inline SeqGradChanList& operator + (SeqGradChan& s1, SeqGradChanList& s2) {return SeqOperator::concat(s1,s2,false);}
170 inline SeqGradChanParallel& operator + (SeqGradChan& s1, SeqGradChanParallel& s2) {return SeqOperator::concat(s1,s2,false);}
171 
172 inline SeqObjList& operator + (SeqGradChanList& s1, const SeqObjBase& s2){return SeqOperator::concat(s2,s1,true);}
173 inline SeqObjList& operator + (SeqGradChanList& s1, const SeqObjList& s2) {return SeqOperator::concat(s2,s1,true);}
174 inline SeqObjList& operator + (SeqGradChanList& s1, const SeqObjLoop& s2) {return SeqOperator::concat(s2,s1,true);}
175 inline SeqObjList& operator + (SeqGradChanList& s1, const SeqDecoupling& s2) {return SeqOperator::concat(s2,s1,true);}
176 inline SeqObjList& operator + (SeqGradChanList& s1, const SeqParallel& s2) {return SeqOperator::concat(s2,s1,true);}
177 inline SeqGradChanList& operator + (SeqGradChanList& s1, SeqGradChan& s2) {return SeqOperator::concat(s2,s1,true);}
178 inline SeqGradChanList& operator + (SeqGradChanList& s1, SeqGradChanList& s2) {return SeqOperator::concat(s1,s2);}
179 inline SeqGradChanParallel& operator + (SeqGradChanList& s1, SeqGradChanParallel& s2) {return SeqOperator::concat(s1,s2,false);}
180 
181 inline SeqObjList& operator + (SeqGradChanParallel& s1, const SeqObjBase& s2){return SeqOperator::concat(s2,s1,true);}
182 inline SeqObjList& operator + (SeqGradChanParallel& s1, const SeqObjList& s2) {return SeqOperator::concat(s2,s1,true);}
183 inline SeqObjList& operator + (SeqGradChanParallel& s1, const SeqObjLoop& s2) {return SeqOperator::concat(s2,s1,true);}
184 inline SeqObjList& operator + (SeqGradChanParallel& s1, const SeqDecoupling& s2) {return SeqOperator::concat(s2,s1,true);}
185 inline SeqObjList& operator + (SeqGradChanParallel& s1, const SeqParallel& s2) {return SeqOperator::concat(s2,s1,true);}
186 inline SeqGradChanParallel& operator + (SeqGradChanParallel& s1, SeqGradChan& s2) {return SeqOperator::concat(s2,s1,true);}
187 inline SeqGradChanParallel& operator + (SeqGradChanParallel& s1, SeqGradChanList& s2) {return SeqOperator::concat(s2,s1,true);}
188 inline SeqGradChanParallel& operator + (SeqGradChanParallel& s1, SeqGradChanParallel& s2) {return SeqOperator::concat(s1,s2);}
189 
190 
191 
192 inline SeqParallel& operator / (const SeqObjBase& s1, SeqGradObjInterface& s2) {return SeqOperator::simultan(s1,s2);}
193 inline SeqParallel& operator / (SeqGradObjInterface& s1, const SeqObjBase& s2) {return SeqOperator::simultan(s2,s1);}
194 
195 inline SeqParallel& operator / (const SeqObjBase& s1, SeqGradChan& s2) {return SeqOperator::simultan(s1,s2);}
196 inline SeqParallel& operator / (SeqGradChan& s1, const SeqObjBase& s2) {return SeqOperator::simultan(s2,s1);}
197 
198 inline SeqParallel& operator / (const SeqObjBase& s1, SeqGradChanList& s2) {return SeqOperator::simultan(s1,s2);}
199 inline SeqParallel& operator / (SeqGradChanList& s1, const SeqObjBase& s2) {return SeqOperator::simultan(s2,s1);}
200 
201 
202 inline SeqGradChanParallel& operator / (SeqGradChan& s1, SeqGradChan& s2) {return SeqOperator::simultan(s1,s2);}
203 
204 inline SeqGradChanParallel& operator / (SeqGradChan& s1, SeqGradChanList& s2) {return SeqOperator::simultan(s1,s2);}
205 inline SeqGradChanParallel& operator / (SeqGradChanList& s1, SeqGradChan& s2) {return SeqOperator::simultan(s2,s1);}
206 
207 inline SeqGradChanParallel& operator / (SeqGradChan& s1, SeqGradChanParallel& s2) {return SeqOperator::simultan(s1,s2);}
208 inline SeqGradChanParallel& operator / (SeqGradChanParallel& s1, SeqGradChan& s2) {return SeqOperator::simultan(s2,s1);}
209 
210 inline SeqGradChanParallel& operator / (SeqGradChanList& s1, SeqGradChanList& s2) {return SeqOperator::simultan(s1,s2);}
211 
212 inline SeqGradChanParallel& operator / (SeqGradChanList& s1, SeqGradChanParallel& s2) {return SeqOperator::simultan(s1,s2);}
213 inline SeqGradChanParallel& operator / (SeqGradChanParallel& s1, SeqGradChanList& s2) {return SeqOperator::simultan(s2,s1);}
214 
215 inline SeqGradChanParallel& operator / (SeqGradChanParallel& s1, SeqGradChanParallel& s2) {return SeqOperator::simultan(s1,s2);}
216 
217 
218 #endif
Decoupling period.
Definition: seqdec.h:70
Container for sequence objects.
Definition: seqlist.h:87
Sequence Loop.
Definition: seqloop.h:38