casacore
ExprMathNodeArray.h
Go to the documentation of this file.
1 //# ExprMathArrayNode.h: Nodes representing mathematical array operators in table select expression tree
2 //# Copyright (C) 1997,1999,2000
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id: ExprMathNodeArray.h 21262 2012-09-07 12:38:36Z gervandiepen $
27 
28 #ifndef TABLES_EXPRMATHNODEARRAY_H
29 #define TABLES_EXPRMATHNODEARRAY_H
30 
31 //# Includes
32 #include <casacore/casa/aips.h>
33 #include <casacore/tables/TaQL/ExprNodeArray.h>
34 #include <casacore/casa/Arrays/Array.h>
35 
36 namespace casacore { //# NAMESPACE CASACORE - BEGIN
37 
38 //# Forward Declarations
39 
40 //# This file defines classes derived from TableExprNode representing
41 //# the data type and operator in a table expression.
42 //#
43 //# Data types Bool, Int64, Double, DComplex and String are used.
44 //# Char, uChar, Short, uShort, Int, and uInt are converted to Int64,
45 //# Float to Double, and Complex to DComplex.
46 //# Binary operators +, -, *, /, and % are recognized.
47 //# Also unary + and - are recognized.
48 
49 
50 
51 // <summary>
52 // Array addition in table select expression tree
53 // </summary>
54 
55 // <use visibility=local>
56 
57 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
58 // </reviewed>
59 
60 // <prerequisite>
61 //# Classes you should understand before using this one.
62 // <li> TableExprNode
63 // <li> TableExprNodeRep
64 // </prerequisite>
65 
66 // <synopsis>
67 // This abstract class represents an addition in a table expression tree.
68 // </synopsis>
69 
71 {
72 public:
75 };
76 
77 
78 // <summary>
79 // Int Array addition in table select expression tree
80 // </summary>
81 
82 // <use visibility=local>
83 
84 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
85 // </reviewed>
86 
87 // <prerequisite>
88 //# Classes you should understand before using this one.
89 // <li> TableExprNode
90 // <li> TableExprNodeRep
91 // </prerequisite>
92 
93 // <synopsis>
94 // This class represents an addition in a table select expression tree.
95 // Strings can also be added (ie. concatenated).
96 // Numeric data types will be promoted if possible, so for instance
97 // an addition of Int and Complex is possible.
98 // </synopsis>
99 
101 {
102 public:
106 };
107 
108 
109 // <summary>
110 // Double Array addition in table select expression tree
111 // </summary>
112 
113 // <use visibility=local>
114 
115 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
116 // </reviewed>
117 
118 // <prerequisite>
119 //# Classes you should understand before using this one.
120 // <li> TableExprNode
121 // <li> TableExprNodeRep
122 // </prerequisite>
123 
124 // <synopsis>
125 // This class represents an addition in a table select expression tree.
126 // Strings can also be added (ie. concatenated).
127 // Numeric data types will be promoted if possible, so for instance
128 // an addition of Int and Complex is possible.
129 // </synopsis>
130 
132 {
133 public:
137 };
138 
139 
140 // <summary>
141 // DComplex Array addition in table select expression tree
142 // </summary>
143 
144 // <use visibility=local>
145 
146 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
147 // </reviewed>
148 
149 // <prerequisite>
150 //# Classes you should understand before using this one.
151 // <li> TableExprNode
152 // <li> TableExprNodeRep
153 // </prerequisite>
154 
155 // <synopsis>
156 // This class represents an addition in a table select expression tree.
157 // Strings can also be added (ie. concatenated).
158 // Numeric data types will be promoted if possible, so for instance
159 // an addition of Int and Complex is possible.
160 // </synopsis>
161 
163 {
164 public:
168 };
169 
170 
171 // <summary>
172 // String Array addition in table select expression tree
173 // </summary>
174 
175 // <use visibility=local>
176 
177 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
178 // </reviewed>
179 
180 // <prerequisite>
181 //# Classes you should understand before using this one.
182 // <li> TableExprNode
183 // <li> TableExprNodeRep
184 // </prerequisite>
185 
186 // <synopsis>
187 // This class represents an addition in a table select expression tree.
188 // Strings can also be added (ie. concatenated).
189 // Numeric data types will be promoted if possible, so for instance
190 // an addition of Int and Complex is possible.
191 // </synopsis>
192 
194 {
195 public:
199 private:
200  // Concatenate <src>nr</src> arrays of strings.
201  // The increment is 0 for a scalar value. Otherwise it is 1.
202  void concString (String* to, const String* left, Int incrLeft,
203  const String* right, Int incrRight, uInt nr) const;
204 };
205 
206 
207 // <summary>
208 // Date Array addition in table select expression tree
209 // </summary>
210 
211 // <use visibility=local>
212 
213 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
214 // </reviewed>
215 
216 // <prerequisite>
217 //# Classes you should understand before using this one.
218 // <li> TableExprNode
219 // <li> TableExprNodeRep
220 // </prerequisite>
221 
222 // <synopsis>
223 // This class represents an addition in a table select expression tree.
224 // Strings can also be added (ie. concatenated).
225 // Numeric data types will be promoted if possible, so for instance
226 // an addition of Int and Complex is possible.
227 // </synopsis>
228 
230 {
231 public:
234  virtual void handleUnits();
237 };
238 
239 
240 
241 // <summary>
242 // Array addition in table select expression tree
243 // </summary>
244 
245 // <use visibility=local>
246 
247 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
248 // </reviewed>
249 
250 // <prerequisite>
251 //# Classes you should understand before using this one.
252 // <li> TableExprNode
253 // <li> TableExprNodeRep
254 // </prerequisite>
255 
256 // <synopsis>
257 // This abstract class represents an addition in a table expression tree.
258 // </synopsis>
259 
261 {
262 public:
265 };
266 
267 
268 // <summary>
269 // Int Array subtraction in table select expression tree
270 // </summary>
271 
272 // <use visibility=local>
273 
274 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
275 // </reviewed>
276 
277 // <prerequisite>
278 //# Classes you should understand before using this one.
279 // <li> TableExprNode
280 // <li> TableExprNodeRep
281 // </prerequisite>
282 
283 // <synopsis>
284 // This class represents a subtraction in a table select expression tree.
285 // Numeric data types will be promoted if possible, so for instance
286 // a subtraction of Int and Complex is possible.
287 // </synopsis>
288 
290 {
291 public:
295 };
296 
297 
298 // <summary>
299 // Double Array subtraction in table select expression tree
300 // </summary>
301 
302 // <use visibility=local>
303 
304 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
305 // </reviewed>
306 
307 // <prerequisite>
308 //# Classes you should understand before using this one.
309 // <li> TableExprNode
310 // <li> TableExprNodeRep
311 // </prerequisite>
312 
313 // <synopsis>
314 // This class represents a subtraction in a table select expression tree.
315 // Numeric data types will be promoted if possible, so for instance
316 // a subtraction of Int and Complex is possible.
317 // </synopsis>
318 
320 {
321 public:
325 };
326 
327 
328 // <summary>
329 // DComplex Array subtraction in table select expression tree
330 // </summary>
331 
332 // <use visibility=local>
333 
334 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
335 // </reviewed>
336 
337 // <prerequisite>
338 //# Classes you should understand before using this one.
339 // <li> TableExprNode
340 // <li> TableExprNodeRep
341 // </prerequisite>
342 
343 // <synopsis>
344 // This class represents a subtraction in a table select expression tree.
345 // Numeric data types will be promoted if possible, so for instance
346 // a subtraction of Int and Complex is possible.
347 // </synopsis>
348 
350 {
351 public:
355 };
356 
357 
358 // <summary>
359 // Date Array subtraction in table select expression tree
360 // </summary>
361 
362 // <use visibility=local>
363 
364 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
365 // </reviewed>
366 
367 // <prerequisite>
368 //# Classes you should understand before using this one.
369 // <li> TableExprNode
370 // <li> TableExprNodeRep
371 // </prerequisite>
372 
373 // <synopsis>
374 // This class represents a subtraction in a table select expression tree.
375 // Numeric data types will be promoted if possible, so for instance
376 // a subtraction of Int and Complex is possible.
377 // </synopsis>
378 
380 {
381 public:
384  virtual void handleUnits();
387 };
388 
389 
390 
391 // <summary>
392 // Array addition in table select expression tree
393 // </summary>
394 
395 // <use visibility=local>
396 
397 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
398 // </reviewed>
399 
400 // <prerequisite>
401 //# Classes you should understand before using this one.
402 // <li> TableExprNode
403 // <li> TableExprNodeRep
404 // </prerequisite>
405 
406 // <synopsis>
407 // This abstract class represents an addition in a table expression tree.
408 // </synopsis>
409 
411 {
412 public:
415  virtual void handleUnits();
416 };
417 
418 
419 // <summary>
420 // Int Array multiplication in table select expression tree
421 // </summary>
422 
423 // <use visibility=local>
424 
425 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
426 // </reviewed>
427 
428 // <prerequisite>
429 //# Classes you should understand before using this one.
430 // <li> TableExprNode
431 // <li> TableExprNodeRep
432 // </prerequisite>
433 
434 // <synopsis>
435 // This class represents a multiplication in a table select expression tree.
436 // Numeric data types will be promoted if possible, so for instance
437 // a multiplication of Int and Complex is possible.
438 // </synopsis>
439 
441 {
442 public:
446 };
447 
448 
449 // <summary>
450 // Double Array multiplication in table select expression tree
451 // </summary>
452 
453 // <use visibility=local>
454 
455 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
456 // </reviewed>
457 
458 // <prerequisite>
459 //# Classes you should understand before using this one.
460 // <li> TableExprNode
461 // <li> TableExprNodeRep
462 // </prerequisite>
463 
464 // <synopsis>
465 // This class represents a multiplication in a table select expression tree.
466 // Numeric data types will be promoted if possible, so for instance
467 // a multiplication of Int and Complex is possible.
468 // </synopsis>
469 
471 {
472 public:
476 };
477 
478 
479 // <summary>
480 // DComplex Array multiplication in table select expression tree
481 // </summary>
482 
483 // <use visibility=local>
484 
485 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
486 // </reviewed>
487 
488 // <prerequisite>
489 //# Classes you should understand before using this one.
490 // <li> TableExprNode
491 // <li> TableExprNodeRep
492 // </prerequisite>
493 
494 // <synopsis>
495 // This class represents a multiplication in a table select expression tree.
496 // Numeric data types will be promoted if possible, so for instance
497 // a multiplication of Int and Complex is possible.
498 // </synopsis>
499 
501 {
502 public:
506 };
507 
508 
509 
510 // <summary>
511 // Array addition in table select expression tree
512 // </summary>
513 
514 // <use visibility=local>
515 
516 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
517 // </reviewed>
518 
519 // <prerequisite>
520 //# Classes you should understand before using this one.
521 // <li> TableExprNode
522 // <li> TableExprNodeRep
523 // </prerequisite>
524 
525 // <synopsis>
526 // This abstract class represents an addition in a table expression tree.
527 // </synopsis>
528 
530 {
531 public:
534  virtual void handleUnits();
535 };
536 
537 
538 // <summary>
539 // Double Array division in table select expression tree
540 // </summary>
541 
542 // <use visibility=local>
543 
544 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
545 // </reviewed>
546 
547 // <prerequisite>
548 //# Classes you should understand before using this one.
549 // <li> TableExprNode
550 // <li> TableExprNodeRep
551 // </prerequisite>
552 
553 // <synopsis>
554 // This class represents a division in a table select expression tree.
555 // Numeric data types will be promoted if possible, so for instance
556 // a division of Int and Complex is possible.
557 // </synopsis>
558 
560 {
561 public:
565 };
566 
567 
568 // <summary>
569 // DComplex Array division in table select expression tree
570 // </summary>
571 
572 // <use visibility=local>
573 
574 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
575 // </reviewed>
576 
577 // <prerequisite>
578 //# Classes you should understand before using this one.
579 // <li> TableExprNode
580 // <li> TableExprNodeRep
581 // </prerequisite>
582 
583 // <synopsis>
584 // This class represents a division in a table select expression tree.
585 // Numeric data types will be promoted if possible, so for instance
586 // a division of Int and Complex is possible.
587 // </synopsis>
588 
590 {
591 public:
595 };
596 
597 
598 
599 // <summary>
600 // Array addition in table select expression tree
601 // </summary>
602 
603 // <use visibility=local>
604 
605 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
606 // </reviewed>
607 
608 // <prerequisite>
609 //# Classes you should understand before using this one.
610 // <li> TableExprNode
611 // <li> TableExprNodeRep
612 // </prerequisite>
613 
614 // <synopsis>
615 // This abstract class represents an addition in a table expression tree.
616 // </synopsis>
617 
619 {
620 public:
623  virtual void handleUnits();
624 };
625 
626 
627 // <summary>
628 // Int Array modulo in table select expression tree
629 // </summary>
630 
631 // <use visibility=local>
632 
633 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
634 // </reviewed>
635 
636 // <prerequisite>
637 //# Classes you should understand before using this one.
638 // <li> TableExprNode
639 // <li> TableExprNodeRep
640 // </prerequisite>
641 
642 // <synopsis>
643 // This class represents a modulo operation in a table select expression tree.
644 // It is only possible for datatype Int.
645 // </synopsis>
646 
648 {
649 public:
653 };
654 
655 
656 // <summary>
657 // Double Array modulo in table select expression tree
658 // </summary>
659 
660 // <use visibility=local>
661 
662 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
663 // </reviewed>
664 
665 // <prerequisite>
666 //# Classes you should understand before using this one.
667 // <li> TableExprNode
668 // <li> TableExprNodeRep
669 // </prerequisite>
670 
671 // <synopsis>
672 // This class represents a modulo operation in a table select expression tree.
673 // It is only possible for datatype Double.
674 // </synopsis>
675 
677 {
678 public:
682 };
683 
684 
685 
686 // <summary>
687 // Int Array bitwise and in table select expression tree
688 // </summary>
689 
690 // <use visibility=local>
691 
692 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
693 // </reviewed>
694 
695 // <prerequisite>
696 //# Classes you should understand before using this one.
697 // <li> TableExprNode
698 // <li> TableExprNodeRep
699 // </prerequisite>
700 
701 // <synopsis>
702 // This class represents a bitwise and operation in a table select expression
703 // tree. It is only possible for datatype Int.
704 // </synopsis>
705 
707 {
708 public:
712 };
713 
714 
715 // <summary>
716 // Int Array bitwise or in table select expression tree
717 // </summary>
718 
719 // <use visibility=local>
720 
721 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
722 // </reviewed>
723 
724 // <prerequisite>
725 //# Classes you should understand before using this one.
726 // <li> TableExprNode
727 // <li> TableExprNodeRep
728 // </prerequisite>
729 
730 // <synopsis>
731 // This class represents a bitwise or operation in a table select expression
732 // tree. It is only possible for datatype Int.
733 // </synopsis>
734 
736 {
737 public:
741 };
742 
743 
744 // <summary>
745 // Int Array bitwise xor in table select expression tree
746 // </summary>
747 
748 // <use visibility=local>
749 
750 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
751 // </reviewed>
752 
753 // <prerequisite>
754 //# Classes you should understand before using this one.
755 // <li> TableExprNode
756 // <li> TableExprNodeRep
757 // </prerequisite>
758 
759 // <synopsis>
760 // This class represents a bitwise xor operation in a table select expression
761 // tree. It is only possible for datatype Int.
762 // </synopsis>
763 
765 {
766 public:
770 };
771 
772 
773 
774 // <summary>
775 // Unary minus in table select expression tree
776 // </summary>
777 
778 // <use visibility=local>
779 
780 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
781 // </reviewed>
782 
783 // <prerequisite>
784 //# Classes you should understand before using this one.
785 // <li> TableExprNode
786 // </prerequisite>
787 
788 // <synopsis>
789 // This class represents a unary minus in a table select expression tree.
790 // This is defined for numeric data types only.
791 // </synopsis>
792 
794 {
795 public:
801 };
802 
803 
804 // <summary>
805 // Bitwise negate in table select expression tree
806 // </summary>
807 
808 // <use visibility=local>
809 
810 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
811 // </reviewed>
812 
813 // <prerequisite>
814 //# Classes you should understand before using this one.
815 // <li> TableExprNode
816 // </prerequisite>
817 
818 // <synopsis>
819 // This class represents a bitwise negate in a table select expression tree.
820 // This is defined for Int data types only.
821 // </synopsis>
822 
824 {
825 public:
829 };
830 
831 
832 } //# NAMESPACE CASACORE - END
833 
834 #endif
int Int
Definition: aipstype.h:50
Int Array multiplication in table select expression tree.
Int Array subtraction in table select expression tree.
virtual MArray< MVTime > getArrayDate(const TableExprId &id)
Double Array multiplication in table select expression tree.
DComplex Array addition in table select expression tree.
Int Array bitwise and in table select expression tree.
Int Array bitwise xor in table select expression tree.
Unary minus in table select expression tree.
Base class for arrays in table select expression.
Definition: ExprNodeArray.h:65
Array addition in table select expression tree.
String Array addition in table select expression tree.
NodeDataType
Define the data types of a node.
Definition: ExprNodeRep.h:155
Abstract base class for a node in a table column expression tree.
Definition: ExprNodeRep.h:151
Array addition in table select expression tree.
virtual MArray< Double > getArrayDouble(const TableExprId &id)
The default implementation of getArrayDouble does getArrayInt and converts the result.
Double Array modulo in table select expression tree.
Bitwise negate in table select expression tree.
Date Array addition in table select expression tree.
DComplex Array division in table select expression tree.
Double Array addition in table select expression tree.
Double Array subtraction in table select expression tree.
virtual void handleUnits()
Handle the units of the children and possibly set the parent&#39;s unit.
Array addition in table select expression tree.
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
Date Array subtraction in table select expression tree.
Array addition in table select expression tree.
virtual MArray< DComplex > getArrayDComplex(const TableExprId &id)
The default implementation of getArrayDComplex does getArrayDouble and converts the result...
Int Array addition in table select expression tree.
The identification of a TaQL selection subject.
Definition: TableExprId.h:98
DComplex Array subtraction in table select expression tree.
TableExprNodeArrayPlus(NodeDataType, const TableExprNodeRep &)
Int Array modulo in table select expression tree.
virtual MArray< String > getArrayString(const TableExprId &id)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
DComplex Array multiplication in table select expression tree.
Array addition in table select expression tree.
Int Array bitwise or in table select expression tree.
this file contains all the compiler specific defines
Definition: mainpage.dox:28
Double Array division in table select expression tree.
unsigned int uInt
Definition: aipstype.h:51