casacore
Loading...
Searching...
No Matches
ExprNodeArray.h
Go to the documentation of this file.
1//# ExprNodeArray.h: Classes representing an array in table select expression
2//# Copyright (C) 1997,1999,2000,2001
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: casa-feedback@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#ifndef TABLES_EXPRNODEARRAY_H
27#define TABLES_EXPRNODEARRAY_H
28
29//# Includes
30#include <casacore/tables/TaQL/ExprNodeRep.h>
31#include <casacore/tables/TaQL/TaQLStyle.h>
32#include <casacore/tables/Tables/Table.h>
33#include <casacore/tables/Tables/ArrayColumn.h>
34#include <casacore/casa/Arrays/Slicer.h>
35
36namespace casacore { //# NAMESPACE CASACORE - BEGIN
37
38//# Forward Declarations
39class TableExprNodeSet;
40
41
42// <summary>
43// Base class for arrays in table select expression
44// </summary>
45
46// <use visibility=local>
47
48// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
49// </reviewed>
50
51// <prerequisite>
52//# Classes you should understand before using this one.
53// <li> TableExprNode
54// <li> TableExprNodeRep
55// <li> TableExprNodeBinary
56// </prerequisite>
57
58// <synopsis>
59// This class is the base class to represent an array.
60// The actual storing of the array column is done by its derivations.
61// </synopsis>
62
64{
65public:
66 // Create the object.
67 // <group>
71 // </group>
72
73 ~TableExprNodeArray() override = default;
74
75 // Turn a constant array with one element into a scalar.
76 // It returns a zero pointer if not possible.
77 // The default implementation returns 0.
79
80 // Validate the given index against the array's shape.
81 // Treat a negative as an index from the end (a la python) and replace it.
83 const ArrayBase& arr) const;
84
85 // Get the shape of the array in the given row.
86 // This default implementation evaluates the value and returns its shape.
87 const IPosition& getShape (const TableExprId& id) override;
88
89 // The default implementation of getArrayDouble does
90 // getArrayInt and converts the result.
92
93 // The default implementation of getArrayDComplex does
94 // getArrayDouble and converts the result.
96
97 // Does a value occur in the set?
98 // <group>
99 Bool contains (const TableExprId& id, Bool value) override;
100 Bool contains (const TableExprId& id, Int64 value) override;
101 Bool contains (const TableExprId& id, Double value) override;
102 Bool contains (const TableExprId& id, DComplex value) override;
103 Bool contains (const TableExprId& id, String value) override;
104 Bool contains (const TableExprId& id, MVTime value) override;
106 const MArray<Bool>& value) override;
108 const MArray<Int64>& value) override;
110 const MArray<Double>& value) override;
112 const MArray<DComplex>& value) override;
114 const MArray<String>& value) override;
116 const MArray<MVTime>& value) override;
117 // </group>
118
119 // Get a single element from the array in the given row.
120 // <group>
121 virtual Bool getElemBool (const TableExprId& id,
122 const Slicer& index);
123 virtual Int64 getElemInt (const TableExprId& id,
124 const Slicer& index);
125 virtual Double getElemDouble (const TableExprId& id,
126 const Slicer& index);
127 virtual DComplex getElemDComplex (const TableExprId& id,
128 const Slicer& index);
129 virtual String getElemString (const TableExprId& id,
130 const Slicer& index);
131 virtual MVTime getElemDate (const TableExprId& id,
132 const Slicer& index);
133 // </group>
134
135 // Get a slice of the array in the given row.
136 // <group>
138 const Slicer&);
140 const Slicer&);
142 const Slicer&);
144 const Slicer&);
146 const Slicer&);
148 const Slicer&);
149 // </group>
150
151 // Get a single element for the entire column (used by sort).
152 // <group>
154 const Slicer&);
156 const Slicer&);
158 const Slicer&);
160 const Slicer&);
162 const Slicer&);
164 const Slicer&);
166 const Slicer&);
168 const Slicer&);
170 const Slicer&);
172 const Slicer&);
174 const Slicer&);
176 const Slicer&);
177 // </group>
178
179 // Make an array with the given shape and fill it with the value.
183 const DComplex& value);
184
185protected:
187};
188
189
190
191// <summary>
192// Base class for Array column in table select expression
193// </summary>
194
195// <use visibility=local>
196
197// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
198// </reviewed>
199
200// <prerequisite>
201//# Classes you should understand before using this one.
202// <li> TableExprNodeArray
203// </prerequisite>
204
205// <synopsis>
206// This class is the base class to store an array column.
207// The actual storing of the array column is done by its derivations.
208// </synopsis>
209
211{
212public:
213 // Create the object for the given column and table.
215 const TableExprInfo&);
216
217 ~TableExprNodeArrayColumn() override = default;
218
219 // Get the table info for this column.
220 TableExprInfo getTableInfo() const override;
221
222 // Do not apply the selection.
223 void disableApplySelection() override;
224
225 // Re-create the column object for a selection of rows.
226 void applySelection (const Vector<rownr_t>& rownrs) override;
227
228 // Get the TableColumn object.
229 const TableColumn& getColumn() const;
230
231 // Get the shape of the array in the given row.
232 const IPosition& getShape (const TableExprId& id) override;
233
234 // Is the value in the given row defined?
235 Bool isDefined (const TableExprId& id) override;
236
237 // Get the data type of this column.
238 // It returns with a True status.
239 Bool getColumnDataType (DataType&) const override;
240
241protected:
245};
246
247
248
249// <summary>
250// Bool array column in table select expression
251// </summary>
252
253// <use visibility=local>
254
255// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
256// </reviewed>
257
258// <prerequisite>
259//# Classes you should understand before using this one.
260// <li> TableExprNodeArrayColumn
261// </prerequisite>
262
263// <synopsis>
264// These classes store an array column of type X.
265// </synopsis>
266
268{
269public:
271 const TableExprInfo&);
272 ~TableExprNodeArrayColumnBool() override = default;
273
274 // Re-create the column object for a selection of rows.
275 void applySelection (const Vector<rownr_t>& rownrs) override;
276
277 Bool getElemBool (const TableExprId& id, const Slicer& index) override;
279 MArray<Bool> getSliceBool (const TableExprId& id, const Slicer&) override;
281 const Slicer&) override;
282protected:
284};
285
286
287// <summary>
288// uChar array column in table select expression
289// </summary>
290
291// <use visibility=local>
292
293// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
294// </reviewed>
295
296// <prerequisite>
297//# Classes you should understand before using this one.
298// <li> TableExprNodeArrayColumn
299// </prerequisite>
300
301// <synopsis>
302// These classes store an array column of type X.
303// </synopsis>
304
306{
307public:
309 const TableExprInfo&);
310 ~TableExprNodeArrayColumnuChar() override = default;
311
312 // Re-create the column object for a selection of rows.
313 void applySelection (const Vector<rownr_t>& rownrs) override;
314
315 Int64 getElemInt (const TableExprId& id, const Slicer& index) override;
318 const Slicer&) override;
320 const Slicer&) override;
321protected:
323};
324
325
326// <summary>
327// Short array column in table select expression
328// </summary>
329
330// <use visibility=local>
331
332// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
333// </reviewed>
334
335// <prerequisite>
336//# Classes you should understand before using this one.
337// <li> TableExprNodeArrayColumn
338// </prerequisite>
339
340// <synopsis>
341// These classes store an array column of type X.
342// </synopsis>
343
345{
346public:
348 const TableExprInfo&);
349 ~TableExprNodeArrayColumnShort() override = default;
350
351 // Re-create the column object for a selection of rows.
352 void applySelection (const Vector<rownr_t>& rownrs) override;
353
354 Int64 getElemInt (const TableExprId& id, const Slicer& index) override;
357 const Slicer&) override;
359 const Slicer&) override;
360protected:
362};
363
364
365// <summary>
366// uShort array column in table select expression
367// </summary>
368
369// <use visibility=local>
370
371// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
372// </reviewed>
373
374// <prerequisite>
375//# Classes you should understand before using this one.
376// <li> TableExprNodeArrayColumn
377// </prerequisite>
378
379// <synopsis>
380// These classes store an array column of type X.
381// </synopsis>
382
384{
385public:
387 const TableExprInfo&);
389
390 // Re-create the column object for a selection of rows.
391 void applySelection (const Vector<rownr_t>& rownrs) override;
392
393 Int64 getElemInt (const TableExprId& id, const Slicer& index) override;
396 const Slicer&) override;
398 const Slicer&) override;
399protected:
401};
402
403
404// <summary>
405// Int array column in table select expression
406// </summary>
407
408// <use visibility=local>
409
410// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
411// </reviewed>
412
413// <prerequisite>
414//# Classes you should understand before using this one.
415// <li> TableExprNodeArrayColumn
416// </prerequisite>
417
418// <synopsis>
419// These classes store an array column of type X.
420// </synopsis>
421
423{
424public:
426 const TableExprInfo&);
427 ~TableExprNodeArrayColumnInt() override = default;
428
429 // Re-create the column object for a selection of rows.
430 void applySelection (const Vector<rownr_t>& rownrs) override;
431
432 Int64 getElemInt (const TableExprId& id, const Slicer& index) override;
435 const Slicer&) override;
437 const Slicer&) override;
438protected:
440};
441
442
443// <summary>
444// uInt array column in table select expression
445// </summary>
446
447// <use visibility=local>
448
449// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
450// </reviewed>
451
452// <prerequisite>
453//# Classes you should understand before using this one.
454// <li> TableExprNodeArrayColumn
455// </prerequisite>
456
457// <synopsis>
458// These classes store an array column of type X.
459// </synopsis>
460
462{
463public:
465 const TableExprInfo&);
466 ~TableExprNodeArrayColumnuInt() override = default;
467
468 // Re-create the column object for a selection of rows.
469 void applySelection (const Vector<rownr_t>& rownrs) override;
470
471 Int64 getElemInt (const TableExprId& id, const Slicer& index) override;
474 const Slicer&) override;
476 const Slicer&) override;
477protected:
479};
480
481
482// <summary>
483// Int64 array column in table select expression
484// </summary>
485
486// <use visibility=local>
487
488// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
489// </reviewed>
490
491// <prerequisite>
492//# Classes you should understand before using this one.
493// <li> TableExprNodeArrayColumn
494// </prerequisite>
495
496// <synopsis>
497// These classes store an array column of type X.
498// </synopsis>
499
501{
502public:
504 const TableExprInfo&);
505 ~TableExprNodeArrayColumnInt64() override = default;
506
507 // Re-create the column object for a selection of rows.
508 void applySelection (const Vector<rownr_t>& rownrs) override;
509
510 Int64 getElemInt (const TableExprId& id, const Slicer& index) override;
513 const Slicer&) override;
515 const Slicer&) override;
516protected:
518};
519
520
521// <summary>
522// Float array column in table select expression
523// </summary>
524
525// <use visibility=local>
526
527// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
528// </reviewed>
529
530// <prerequisite>
531//# Classes you should understand before using this one.
532// <li> TableExprNodeArrayColumn
533// </prerequisite>
534
535// <synopsis>
536// These classes store an array column of type X.
537// </synopsis>
538
540{
541public:
543 const TableExprInfo&);
544 ~TableExprNodeArrayColumnFloat() override = default;
545
546 // Re-create the column object for a selection of rows.
547 void applySelection (const Vector<rownr_t>& rownrs) override;
548
549 Double getElemDouble (const TableExprId& id, const Slicer& index) override;
552 const Slicer&) override;
554 const Slicer&) override;
555protected:
557};
558
559
560// <summary>
561// Double array column in table select expression
562// </summary>
563
564// <use visibility=local>
565
566// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
567// </reviewed>
568
569// <prerequisite>
570//# Classes you should understand before using this one.
571// <li> TableExprNodeArrayColumn
572// </prerequisite>
573
574// <synopsis>
575// These classes store an array column of type X.
576// </synopsis>
577
579{
580public:
582 const TableExprInfo&);
584
585 // Re-create the column object for a selection of rows.
586 void applySelection (const Vector<rownr_t>& rownrs) override;
587
588 Double getElemDouble (const TableExprId& id, const Slicer& index) override;
591 const Slicer&) override;
593 const Slicer&) override;
594protected:
596};
597
598
599// <summary>
600// Complex array column in table select expression
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> TableExprNodeArrayColumn
611// </prerequisite>
612
613// <synopsis>
614// These classes store an array column of type X.
615// </synopsis>
616
618{
619public:
621 const TableExprInfo&);
623
624 // Re-create the column object for a selection of rows.
625 void applySelection (const Vector<rownr_t>& rownrs) override;
626
627 DComplex getElemDComplex (const TableExprId& id, const Slicer& index) override;
630 const Slicer&) override;
632 const Slicer&) override;
633protected:
635};
636
637
638// <summary>
639// DComplex array column in table select expression
640// </summary>
641
642// <use visibility=local>
643
644// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
645// </reviewed>
646
647// <prerequisite>
648//# Classes you should understand before using this one.
649// <li> TableExprNodeArrayColumn
650// </prerequisite>
651
652// <synopsis>
653// These classes store an array column of type X.
654// </synopsis>
655
657{
658public:
660 const TableExprInfo&);
662
663 // Re-create the column object for a selection of rows.
664 void applySelection (const Vector<rownr_t>& rownrs) override;
665
666 DComplex getElemDComplex (const TableExprId& id, const Slicer& index) override;
669 const Slicer&) override;
671 const Slicer&) override;
672protected:
674};
675
676
677// <summary>
678// String array column in table select expression
679// </summary>
680
681// <use visibility=local>
682
683// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
684// </reviewed>
685
686// <prerequisite>
687//# Classes you should understand before using this one.
688// <li> TableExprNodeArrayColumn
689// </prerequisite>
690
691// <synopsis>
692// These classes store an array column of type X.
693// </synopsis>
694
696{
697public:
699 const TableExprInfo&);
701
702 // Re-create the column object for a selection of rows.
703 void applySelection (const Vector<rownr_t>& rownrs) override;
704
705 String getElemString (const TableExprId& id, const Slicer& index) override;
708 const Slicer&) override;
710 const Slicer&) override;
711protected:
713};
714
715
716
717
718// <summary>
719// The index of an array element in a table select expression
720// </summary>
721
722// <use visibility=local>
723
724// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
725// </reviewed>
726
727// <prerequisite>
728//# Classes you should understand before using this one.
729// <li> TableExprNodeMulti
730// </prerequisite>
731
732// <etymology>
733// TableExprNodeIndex is used to store an index.
734// All the operands must be Int.
735// </etymology>
736
737// <synopsis>
738// TableExprNodeIndex is a derivation of TableExprNodeMulti
739// expression tree that represents an index.
740// </synopsis>
741
742// <motivation>
743// All operands of TableExprNodeIndex must be Int,
744// therefore it is a derivation of TableExprNodeMulti.
745// </motivation>
746
747// <todo asof="$DATE:$">
748//# A List of bugs, limitations, extensions or planned refinements.
749// <li> to be filled in
750// </todo>
751
753{
754public:
755 // Constructor
756 explicit TableExprNodeIndex (const TableExprNodeSet& indices,
757 const TaQLStyle& = TaQLStyle(0));
758
759 // Destructor
760 ~TableExprNodeIndex() override = default;
761
762 // Link all the operands and check datatype.
763 // Calculate the IPosition values for the const operands.
764 void fillIndex (const TableExprNodeSet& indices);
765
766 // Check if the index values match the dimensionality and shape
767 // of fixed-shaped array.
768 void checkIndexValues (const TENShPtr& arrayNode);
769
770 // Get the Slicer value for a constant index.
771 const Slicer& getConstantSlicer() const;
772
773 // Get the Slicer value for the slice.
774 const Slicer& getSlicer (const TableExprId& id);
775
776 // Does it index a single element?
777 Bool isSingle() const;
778
779protected:
780 Int origin_p; //# origin 0 for C++/Python; 1 for Glish
781 Int endMinus_p; //# subtract from end (origin and endExcl)
782 Bool isCOrder_p; //# True for Python
783 IPosition start_p; //# precalculated start values
784 IPosition end_p; //# precalculated end values (<0 = till end)
785 IPosition incr_p; //# precalculated increment values
786 Slicer slicer_p; //# combined start, end, and incr
787 Block<Bool> varIndex_p; //# is the start for the axes variable?
788 Bool isSingle_p; //# Index a single value?
789
790 // Precalculate the constant indices and store them.
792
793 // Fill the slicer for this row.
794 void fillSlicer (const TableExprId& id);
795
796 // Get the shape of the node involved. Reverse axes if needed.
797 IPosition getNodeShape (const TENShPtr& arrayNode) const;
798};
799
800
801
802
803// <summary>
804// Array column part in table select expression
805// </summary>
806
807// <use visibility=local>
808
809// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
810// </reviewed>
811
812// <prerequisite>
813//# Classes you should understand before using this one.
814// <li> TableExprNode
815// <li> TableExprNodeRep
816// <li> TableExprNodeBinary
817// </prerequisite>
818
819// <synopsis>
820// This class handles a part of an array.
821// It uses a TableExprNodeArray to handle the array
822// and a TableExprNodeIndex to store the index.
823// </synopsis>
824
826{
827public:
829 const TENShPtr& indexNode);
830 ~TableExprNodeArrayPart() override = default;
831
832 // Show the node.
833 void show (ostream& os, uInt indent) const override;
834
835 Bool getBool (const TableExprId& id) override;
836 Int64 getInt (const TableExprId& id) override;
837 Double getDouble (const TableExprId& id) override;
838 DComplex getDComplex (const TableExprId& id) override;
839 String getString (const TableExprId& id) override;
840 MVTime getDate (const TableExprId& id) override;
841
848
849 // Get the data type of this column (if possible).
850 // It returns with a False status when the index is not constant
851 // (that means that the index can vary with row number).
852 Bool getColumnDataType (DataType&) const override;
853
854 Array<Bool> getColumnBool (const Vector<rownr_t>& rownrs) override;
858 Array<Int> getColumnInt (const Vector<rownr_t>& rownrs) override;
859 Array<uInt> getColumnuInt (const Vector<rownr_t>& rownrs) override;
866
867 // Get the index node.
868 const TableExprNodeIndex* getIndexNode() const;
869
870 // Get the array column node.
871 // It returns 0 if the parent object is no array column.
873
874private:
877 TableExprNodeArrayColumn* colNode_p; //# 0 if arrNode is no arraycolumn
878};
879
880
881
882
884{
885 return isSingle_p;
886}
888{
889 return slicer_p;
890}
892{
893 if (!isConstant()) {
894 fillSlicer (id);
895 }
896 return slicer_p;
897}
898
900{
901 return tabCol_p;
902}
903
905{
906 return inxNode_p;
907}
908
909inline const TableExprNodeArrayColumn*
914
915
916
917} //# NAMESPACE CASACORE - END
918
919#endif
920
Non-templated base class for templated Array class.
Definition ArrayBase.h:71
simple 1-D array
Definition Block.h:198
String: the storage and methods of handling collections of characters.
Definition String.h:223
Class to connect a Table and its alias name.
Bool array column in table select expression.
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
~TableExprNodeArrayColumnBool() override=default
Array< Bool > getElemColumnBool(const Vector< rownr_t > &rownrs, const Slicer &) override
Get a single element for the entire column (used by sort).
MArray< Bool > getArrayBool(const TableExprId &id) override
Get an array value for this node in the given row.
MArray< Bool > getSliceBool(const TableExprId &id, const Slicer &) override
Get a slice of the array in the given row.
Bool getElemBool(const TableExprId &id, const Slicer &index) override
Get a single element from the array in the given row.
TableExprNodeArrayColumnBool(const TableColumn &, const TableExprInfo &)
Complex array column in table select expression.
MArray< DComplex > getSliceDComplex(const TableExprId &id, const Slicer &) override
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
DComplex getElemDComplex(const TableExprId &id, const Slicer &index) override
Array< Complex > getElemColumnComplex(const Vector< rownr_t > &rownrs, const Slicer &) override
~TableExprNodeArrayColumnComplex() override=default
MArray< DComplex > getArrayDComplex(const TableExprId &id) override
The default implementation of getArrayDComplex does getArrayDouble and converts the result.
TableExprNodeArrayColumnComplex(const TableColumn &, const TableExprInfo &)
DComplex array column in table select expression.
Array< DComplex > getElemColumnDComplex(const Vector< rownr_t > &rownrs, const Slicer &) override
MArray< DComplex > getArrayDComplex(const TableExprId &id) override
The default implementation of getArrayDComplex does getArrayDouble and converts the result.
DComplex getElemDComplex(const TableExprId &id, const Slicer &index) override
~TableExprNodeArrayColumnDComplex() override=default
TableExprNodeArrayColumnDComplex(const TableColumn &, const TableExprInfo &)
MArray< DComplex > getSliceDComplex(const TableExprId &id, const Slicer &) override
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
Double array column in table select expression.
MArray< Double > getArrayDouble(const TableExprId &id) override
The default implementation of getArrayDouble does getArrayInt and converts the result.
Double getElemDouble(const TableExprId &id, const Slicer &index) override
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
MArray< Double > getSliceDouble(const TableExprId &id, const Slicer &) override
Array< Double > getElemColumnDouble(const Vector< rownr_t > &rownrs, const Slicer &) override
~TableExprNodeArrayColumnDouble() override=default
TableExprNodeArrayColumnDouble(const TableColumn &, const TableExprInfo &)
Float array column in table select expression.
MArray< Double > getArrayDouble(const TableExprId &id) override
The default implementation of getArrayDouble does getArrayInt and converts the result.
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
~TableExprNodeArrayColumnFloat() override=default
Array< Float > getElemColumnFloat(const Vector< rownr_t > &rownrs, const Slicer &) override
MArray< Double > getSliceDouble(const TableExprId &id, const Slicer &) override
TableExprNodeArrayColumnFloat(const TableColumn &, const TableExprInfo &)
Double getElemDouble(const TableExprId &id, const Slicer &index) override
Int64 array column in table select expression.
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
Array< Int64 > getElemColumnInt64(const Vector< rownr_t > &rownrs, const Slicer &) override
TableExprNodeArrayColumnInt64(const TableColumn &, const TableExprInfo &)
MArray< Int64 > getArrayInt(const TableExprId &id) override
~TableExprNodeArrayColumnInt64() override=default
Int64 getElemInt(const TableExprId &id, const Slicer &index) override
MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &) override
Int array column in table select expression.
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
TableExprNodeArrayColumnInt(const TableColumn &, const TableExprInfo &)
MArray< Int64 > getArrayInt(const TableExprId &id) override
Int64 getElemInt(const TableExprId &id, const Slicer &index) override
Array< Int > getElemColumnInt(const Vector< rownr_t > &rownrs, const Slicer &) override
~TableExprNodeArrayColumnInt() override=default
MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &) override
Short array column in table select expression.
Array< Short > getElemColumnShort(const Vector< rownr_t > &rownrs, const Slicer &) override
MArray< Int64 > getArrayInt(const TableExprId &id) override
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
Int64 getElemInt(const TableExprId &id, const Slicer &index) override
MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &) override
TableExprNodeArrayColumnShort(const TableColumn &, const TableExprInfo &)
~TableExprNodeArrayColumnShort() override=default
String array column in table select expression.
~TableExprNodeArrayColumnString() override=default
TableExprNodeArrayColumnString(const TableColumn &, const TableExprInfo &)
String getElemString(const TableExprId &id, const Slicer &index) override
MArray< String > getArrayString(const TableExprId &id) override
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
MArray< String > getSliceString(const TableExprId &id, const Slicer &) override
Array< String > getElemColumnString(const Vector< rownr_t > &rownrs, const Slicer &) override
Base class for Array column in table select expression.
const IPosition & getShape(const TableExprId &id) override
Get the shape of the array in the given row.
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
const TableColumn & getColumn() const
Get the TableColumn object.
Bool isDefined(const TableExprId &id) override
Is the value in the given row defined?
~TableExprNodeArrayColumn() override=default
void disableApplySelection() override
Do not apply the selection.
Bool getColumnDataType(DataType &) const override
Get the data type of this column.
TableExprInfo getTableInfo() const override
Get the table info for this column.
TableExprNodeArrayColumn(const TableColumn &tablecol, const TableExprInfo &)
Create the object for the given column and table.
uChar array column in table select expression
TableExprNodeArrayColumnuChar(const TableColumn &, const TableExprInfo &)
Array< uChar > getElemColumnuChar(const Vector< rownr_t > &rownrs, const Slicer &) override
~TableExprNodeArrayColumnuChar() override=default
MArray< Int64 > getArrayInt(const TableExprId &id) override
MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &) override
Int64 getElemInt(const TableExprId &id, const Slicer &index) override
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
uInt array column in table select expression
Int64 getElemInt(const TableExprId &id, const Slicer &index) override
MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &) override
TableExprNodeArrayColumnuInt(const TableColumn &, const TableExprInfo &)
Array< uInt > getElemColumnuInt(const Vector< rownr_t > &rownrs, const Slicer &) override
MArray< Int64 > getArrayInt(const TableExprId &id) override
~TableExprNodeArrayColumnuInt() override=default
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
uShort array column in table select expression
Array< uShort > getElemColumnuShort(const Vector< rownr_t > &rownrs, const Slicer &) override
~TableExprNodeArrayColumnuShort() override=default
TableExprNodeArrayColumnuShort(const TableColumn &, const TableExprInfo &)
MArray< Int64 > getArrayInt(const TableExprId &id) override
void applySelection(const Vector< rownr_t > &rownrs) override
Re-create the column object for a selection of rows.
Int64 getElemInt(const TableExprId &id, const Slicer &index) override
MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &) override
Array column part in table select expression.
Array< Int64 > getColumnInt64(const Vector< rownr_t > &rownrs) override
MArray< MVTime > getArrayDate(const TableExprId &id) override
~TableExprNodeArrayPart() override=default
void show(ostream &os, uInt indent) const override
Show the node.
Array< DComplex > getColumnDComplex(const Vector< rownr_t > &rownrs) override
Array< uShort > getColumnuShort(const Vector< rownr_t > &rownrs) override
Bool getColumnDataType(DataType &) const override
Get the data type of this column (if possible).
Array< Float > getColumnFloat(const Vector< rownr_t > &rownrs) override
Array< Bool > getColumnBool(const Vector< rownr_t > &rownrs) override
Get the value of the expression evaluated for the entire column.
Bool getBool(const TableExprId &id) override
Get a scalar value for this node in the given row.
TableExprNodeArrayColumn * colNode_p
TableExprNodeArrayPart(const TENShPtr &arrayNode, const TENShPtr &indexNode)
MArray< DComplex > getArrayDComplex(const TableExprId &id) override
The default implementation of getArrayDComplex does getArrayDouble and converts the result.
const TableExprNodeArrayColumn * getColumnNode() const
Get the array column node.
MArray< Double > getArrayDouble(const TableExprId &id) override
The default implementation of getArrayDouble does getArrayInt and converts the result.
DComplex getDComplex(const TableExprId &id) override
Array< String > getColumnString(const Vector< rownr_t > &rownrs) override
MArray< Int64 > getArrayInt(const TableExprId &id) override
Array< uChar > getColumnuChar(const Vector< rownr_t > &rownrs) override
Double getDouble(const TableExprId &id) override
const TableExprNodeIndex * getIndexNode() const
Get the index node.
MVTime getDate(const TableExprId &id) override
Array< Double > getColumnDouble(const Vector< rownr_t > &rownrs) override
String getString(const TableExprId &id) override
Array< Int > getColumnInt(const Vector< rownr_t > &rownrs) override
Array< Short > getColumnShort(const Vector< rownr_t > &rownrs) override
MArray< String > getArrayString(const TableExprId &id) override
Array< Complex > getColumnComplex(const Vector< rownr_t > &rownrs) override
Array< uInt > getColumnuInt(const Vector< rownr_t > &rownrs) override
MArray< Bool > getArrayBool(const TableExprId &id) override
Get an array value for this node in the given row.
Int64 getInt(const TableExprId &id) override
~TableExprNodeArray() override=default
virtual Array< DComplex > getElemColumnDComplex(const Vector< rownr_t > &rownrs, const Slicer &)
virtual Double getElemDouble(const TableExprId &id, const Slicer &index)
virtual Array< Double > getElemColumnDouble(const Vector< rownr_t > &rownrs, const Slicer &)
MArray< DComplex > getArrayDComplex(const TableExprId &id) override
The default implementation of getArrayDComplex does getArrayDouble and converts the result.
const IPosition & getShape(const TableExprId &id) override
Get the shape of the array in the given row.
virtual Array< Int > getElemColumnInt(const Vector< rownr_t > &rownrs, const Slicer &)
Bool contains(const TableExprId &id, Double value) override
MArray< Bool > contains(const TableExprId &id, const MArray< MVTime > &value) override
virtual MArray< String > getSliceString(const TableExprId &id, const Slicer &)
TableExprNodeArray(NodeDataType, OperType, const IPosition &shape)
MArray< Bool > contains(const TableExprId &id, const MArray< Double > &value) override
virtual Int64 getElemInt(const TableExprId &id, const Slicer &index)
virtual String getElemString(const TableExprId &id, const Slicer &index)
virtual Array< uInt > getElemColumnuInt(const Vector< rownr_t > &rownrs, const Slicer &)
virtual Array< Int64 > getElemColumnInt64(const Vector< rownr_t > &rownrs, const Slicer &)
virtual MArray< Bool > getSliceBool(const TableExprId &id, const Slicer &)
Get a slice of the array in the given row.
MArray< Bool > contains(const TableExprId &id, const MArray< String > &value) override
virtual MArray< DComplex > getSliceDComplex(const TableExprId &id, const Slicer &)
virtual DComplex getElemDComplex(const TableExprId &id, const Slicer &index)
virtual Array< uChar > getElemColumnuChar(const Vector< rownr_t > &rownrs, const Slicer &)
virtual MVTime getElemDate(const TableExprId &id, const Slicer &index)
TableExprNodeArray(const TableExprNodeRep &node, NodeDataType, OperType)
virtual Bool getElemBool(const TableExprId &id, const Slicer &index)
Get a single element from the array in the given row.
static MArray< Double > makeArray(const IPosition &shape, Double value)
MArray< Bool > contains(const TableExprId &id, const MArray< Int64 > &value) override
Bool contains(const TableExprId &id, String value) override
virtual MArray< MVTime > getSliceDate(const TableExprId &id, const Slicer &)
virtual Array< uShort > getElemColumnuShort(const Vector< rownr_t > &rownrs, const Slicer &)
virtual TENShPtr makeConstantScalar()
Turn a constant array with one element into a scalar.
Bool contains(const TableExprId &id, MVTime value) override
virtual Array< String > getElemColumnString(const Vector< rownr_t > &rownrs, const Slicer &)
IPosition validateIndex(const IPosition &index, const ArrayBase &arr) const
Validate the given index against the array's shape.
MArray< Bool > contains(const TableExprId &id, const MArray< DComplex > &value) override
static MArray< DComplex > makeArray(const IPosition &shape, const DComplex &value)
TableExprNodeArray(NodeDataType, OperType)
Create the object.
MArray< Bool > contains(const TableExprId &id, const MArray< Bool > &value) override
MArray< Double > getArrayDouble(const TableExprId &id) override
The default implementation of getArrayDouble does getArrayInt and converts the result.
static MArray< Int64 > makeArray(const IPosition &shape, Int64 value)
Make an array with the given shape and fill it with the value.
virtual Array< Bool > getElemColumnBool(const Vector< rownr_t > &rownrs, const Slicer &)
Get a single element for the entire column (used by sort).
virtual Array< Short > getElemColumnShort(const Vector< rownr_t > &rownrs, const Slicer &)
Bool contains(const TableExprId &id, DComplex value) override
virtual MArray< Double > getSliceDouble(const TableExprId &id, const Slicer &)
virtual MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &)
virtual Array< Complex > getElemColumnComplex(const Vector< rownr_t > &rownrs, const Slicer &)
Bool contains(const TableExprId &id, Bool value) override
Does a value occur in the set?
virtual Array< Float > getElemColumnFloat(const Vector< rownr_t > &rownrs, const Slicer &)
Bool contains(const TableExprId &id, Int64 value) override
Abstract base class for a node having 0, 1, or 2 child nodes.
The index of an array element in a table select expression.
Bool isSingle() const
Does it index a single element?
void fillIndex(const TableExprNodeSet &indices)
Link all the operands and check datatype.
const Slicer & getSlicer(const TableExprId &id)
Get the Slicer value for the slice.
TableExprNodeIndex(const TableExprNodeSet &indices, const TaQLStyle &=TaQLStyle(0))
Constructor.
IPosition getNodeShape(const TENShPtr &arrayNode) const
Get the shape of the node involved.
~TableExprNodeIndex() override=default
Destructor.
void fillSlicer(const TableExprId &id)
Fill the slicer for this row.
const Slicer & getConstantSlicer() const
Get the Slicer value for a constant index.
void convertConstIndex()
Precalculate the constant indices and store them.
void checkIndexValues(const TENShPtr &arrayNode)
Check if the index values match the dimensionality and shape of fixed-shaped array.
Abstract base class for a node having multiple child nodes.
Abstract base class for a node in a table column expression tree.
OperType
Define the operator types.
Bool isConstant() const
Is the expression a constant?
NodeDataType
Define the data types of a node.
const IPosition & shape() const
Get the fixed shape (same for all rows).
this file contains all the compiler specific defines
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:49
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Definition aipsxtype.h:36
std::shared_ptr< TableExprNodeRep > TENShPtr
Definition ExprNodeRep.h:55
int Int
Definition aipstype.h:48
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
double Double
Definition aipstype.h:53