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: 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: ExprNodeArray.h 21262 2012-09-07 12:38:36Z gervandiepen $
27
28#ifndef TABLES_EXPRNODEARRAY_H
29#define TABLES_EXPRNODEARRAY_H
30
31//# Includes
32#include <casacore/tables/TaQL/ExprNodeRep.h>
33#include <casacore/tables/TaQL/TaQLStyle.h>
34#include <casacore/tables/Tables/Table.h>
35#include <casacore/tables/Tables/ArrayColumn.h>
36#include <casacore/casa/Arrays/Slicer.h>
37
38namespace casacore { //# NAMESPACE CASACORE - BEGIN
39
40//# Forward Declarations
41class TableExprNodeSet;
42
43
44// <summary>
45// Base class for arrays in table select expression
46// </summary>
47
48// <use visibility=local>
49
50// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
51// </reviewed>
52
53// <prerequisite>
54//# Classes you should understand before using this one.
55// <li> TableExprNode
56// <li> TableExprNodeRep
57// <li> TableExprNodeBinary
58// </prerequisite>
59
60// <synopsis>
61// This class is the base class to represent an array.
62// The actual storing of the array column is done by its derivations.
63// </synopsis>
64
66{
67public:
68 // Create the object.
69 // <group>
73 // </group>
74
76
77 // Turn a constant array with one element into a scalar.
78 // It returns a zero pointer if not possible.
79 // The default implementation returns 0.
81
82 // Validate the given index against the array's shape.
83 // Treat a negative as an index from the end (a la python) and replace it.
85 const ArrayBase& arr) const;
86
87 // Get the shape of the array in the given row.
88 // This default implementation evaluates the value and returns its shape.
89 virtual const IPosition& getShape (const TableExprId& id);
90
91 // The default implementation of getArrayDouble does
92 // getArrayInt and converts the result.
94
95 // The default implementation of getArrayDComplex does
96 // getArrayDouble and converts the result.
98
99 // Does a value occur in the set?
100 // <group>
101 virtual Bool hasBool (const TableExprId& id, Bool value);
102 virtual Bool hasInt (const TableExprId& id, Int64 value);
103 virtual Bool hasDouble (const TableExprId& id, Double value);
104 virtual Bool hasDComplex (const TableExprId& id, const DComplex& value);
105 virtual Bool hasString (const TableExprId& id, const String& value);
106 virtual Bool hasDate (const TableExprId& id, const MVTime& value);
108 const MArray<Bool>& value);
110 const MArray<Int64>& value);
112 const MArray<Double>& value);
114 const MArray<DComplex>& value);
116 const MArray<String>& value);
118 const MArray<MVTime>& value);
119 // </group>
120
121 // Get a single element from the array in the given row.
122 // <group>
123 virtual Bool getElemBool (const TableExprId& id,
124 const Slicer& index);
125 virtual Int64 getElemInt (const TableExprId& id,
126 const Slicer& index);
127 virtual Double getElemDouble (const TableExprId& id,
128 const Slicer& index);
129 virtual DComplex getElemDComplex (const TableExprId& id,
130 const Slicer& index);
131 virtual String getElemString (const TableExprId& id,
132 const Slicer& index);
133 virtual MVTime getElemDate (const TableExprId& id,
134 const Slicer& index);
135 // </group>
136
137 // Get a slice of the array in the given row.
138 // <group>
140 const Slicer&);
142 const Slicer&);
144 const Slicer&);
146 const Slicer&);
148 const Slicer&);
150 const Slicer&);
151 // </group>
152
153 // Get a single element for the entire column (used by sort).
154 // <group>
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&);
178 const Slicer&);
179 // </group>
180
181 // Make an array with the given shape and fill it with the value.
185 const DComplex& value);
186
187protected:
189};
190
191
192
193// <summary>
194// Base class for Array column in table select expression
195// </summary>
196
197// <use visibility=local>
198
199// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
200// </reviewed>
201
202// <prerequisite>
203//# Classes you should understand before using this one.
204// <li> TableExprNodeArray
205// </prerequisite>
206
207// <synopsis>
208// This class is the base class to store an array column.
209// The actual storing of the array column is done by its derivations.
210// </synopsis>
211
213{
214public:
215 // Create the object for the given column and table.
217 const Table& table);
218
220
221 // This node represents a table column.
222 virtual void getColumnNodes (std::vector<TableExprNodeRep*>& cols);
223
224 // Do not apply the selection.
225 virtual void disableApplySelection();
226
227 // Re-create the column object for a selection of rows.
228 virtual void applySelection (const Vector<rownr_t>& rownrs);
229
230 // Get the TableColumn object.
231 const TableColumn& getColumn() const;
232
233 // Get the shape of the array in the given row.
234 virtual const IPosition& getShape (const TableExprId& id);
235
236 // Is the value in the given row defined?
237 virtual Bool isDefined (const TableExprId& id);
238
239 // Get the data type of this column.
240 // It returns with a True status.
241 virtual Bool getColumnDataType (DataType&) const;
242
243protected:
247};
248
249
250
251// <summary>
252// Bool array column in table select expression
253// </summary>
254
255// <use visibility=local>
256
257// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
258// </reviewed>
259
260// <prerequisite>
261//# Classes you should understand before using this one.
262// <li> TableExprNodeArrayColumn
263// </prerequisite>
264
265// <synopsis>
266// These classes store an array column of type X.
267// </synopsis>
268
270{
271public:
273 const Table&);
275
276 // Re-create the column object for a selection of rows.
277 virtual void applySelection (const Vector<rownr_t>& rownrs);
278
279 virtual Bool getElemBool (const TableExprId& id, const Slicer& index);
281 virtual MArray<Bool> getSliceBool (const TableExprId& id, const Slicer&);
283 const Slicer&);
284protected:
286};
287
288
289// <summary>
290// uChar array column in table select expression
291// </summary>
292
293// <use visibility=local>
294
295// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
296// </reviewed>
297
298// <prerequisite>
299//# Classes you should understand before using this one.
300// <li> TableExprNodeArrayColumn
301// </prerequisite>
302
303// <synopsis>
304// These classes store an array column of type X.
305// </synopsis>
306
308{
309public:
311 const Table&);
313
314 // Re-create the column object for a selection of rows.
315 virtual void applySelection (const Vector<rownr_t>& rownrs);
316
317 virtual Int64 getElemInt (const TableExprId& id, const Slicer& index);
320 const Slicer&);
322 const Slicer&);
323protected:
325};
326
327
328// <summary>
329// Short array column in table select expression
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> TableExprNodeArrayColumn
340// </prerequisite>
341
342// <synopsis>
343// These classes store an array column of type X.
344// </synopsis>
345
347{
348public:
350 const Table&);
352
353 // Re-create the column object for a selection of rows.
354 virtual void applySelection (const Vector<rownr_t>& rownrs);
355
356 virtual Int64 getElemInt (const TableExprId& id, const Slicer& index);
359 const Slicer&);
361 const Slicer&);
362protected:
364};
365
366
367// <summary>
368// uShort array column in table select expression
369// </summary>
370
371// <use visibility=local>
372
373// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
374// </reviewed>
375
376// <prerequisite>
377//# Classes you should understand before using this one.
378// <li> TableExprNodeArrayColumn
379// </prerequisite>
380
381// <synopsis>
382// These classes store an array column of type X.
383// </synopsis>
384
386{
387public:
389 const Table&);
391
392 // Re-create the column object for a selection of rows.
393 virtual void applySelection (const Vector<rownr_t>& rownrs);
394
395 virtual Int64 getElemInt (const TableExprId& id, const Slicer& index);
398 const Slicer&);
400 const Slicer&);
401protected:
403};
404
405
406// <summary>
407// Int array column in table select expression
408// </summary>
409
410// <use visibility=local>
411
412// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
413// </reviewed>
414
415// <prerequisite>
416//# Classes you should understand before using this one.
417// <li> TableExprNodeArrayColumn
418// </prerequisite>
419
420// <synopsis>
421// These classes store an array column of type X.
422// </synopsis>
423
425{
426public:
428 const Table&);
430
431 // Re-create the column object for a selection of rows.
432 virtual void applySelection (const Vector<rownr_t>& rownrs);
433
434 virtual Int64 getElemInt (const TableExprId& id, const Slicer& index);
437 const Slicer&);
439 const Slicer&);
440protected:
442};
443
444
445// <summary>
446// uInt array column in table select expression
447// </summary>
448
449// <use visibility=local>
450
451// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
452// </reviewed>
453
454// <prerequisite>
455//# Classes you should understand before using this one.
456// <li> TableExprNodeArrayColumn
457// </prerequisite>
458
459// <synopsis>
460// These classes store an array column of type X.
461// </synopsis>
462
464{
465public:
467 const Table&);
469
470 // Re-create the column object for a selection of rows.
471 virtual void applySelection (const Vector<rownr_t>& rownrs);
472
473 virtual Int64 getElemInt (const TableExprId& id, const Slicer& index);
476 const Slicer&);
478 const Slicer&);
479protected:
481};
482
483
484// <summary>
485// Int64 array column in table select expression
486// </summary>
487
488// <use visibility=local>
489
490// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
491// </reviewed>
492
493// <prerequisite>
494//# Classes you should understand before using this one.
495// <li> TableExprNodeArrayColumn
496// </prerequisite>
497
498// <synopsis>
499// These classes store an array column of type X.
500// </synopsis>
501
503{
504public:
506 const Table&);
508
509 // Re-create the column object for a selection of rows.
510 virtual void applySelection (const Vector<rownr_t>& rownrs);
511
512 virtual Int64 getElemInt (const TableExprId& id, const Slicer& index);
515 const Slicer&);
517 const Slicer&);
518protected:
520};
521
522
523// <summary>
524// Float array column in table select expression
525// </summary>
526
527// <use visibility=local>
528
529// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
530// </reviewed>
531
532// <prerequisite>
533//# Classes you should understand before using this one.
534// <li> TableExprNodeArrayColumn
535// </prerequisite>
536
537// <synopsis>
538// These classes store an array column of type X.
539// </synopsis>
540
542{
543public:
545 const Table&);
547
548 // Re-create the column object for a selection of rows.
549 virtual void applySelection (const Vector<rownr_t>& rownrs);
550
551 virtual Double getElemDouble (const TableExprId& id, const Slicer& index);
554 const Slicer&);
556 const Slicer&);
557protected:
559};
560
561
562// <summary>
563// Double array column in table select expression
564// </summary>
565
566// <use visibility=local>
567
568// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
569// </reviewed>
570
571// <prerequisite>
572//# Classes you should understand before using this one.
573// <li> TableExprNodeArrayColumn
574// </prerequisite>
575
576// <synopsis>
577// These classes store an array column of type X.
578// </synopsis>
579
581{
582public:
584 const Table&);
586
587 // Re-create the column object for a selection of rows.
588 virtual void applySelection (const Vector<rownr_t>& rownrs);
589
590 virtual Double getElemDouble (const TableExprId& id, const Slicer& index);
593 const Slicer&);
595 const Slicer&);
596protected:
598};
599
600
601// <summary>
602// Complex array column in table select expression
603// </summary>
604
605// <use visibility=local>
606
607// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
608// </reviewed>
609
610// <prerequisite>
611//# Classes you should understand before using this one.
612// <li> TableExprNodeArrayColumn
613// </prerequisite>
614
615// <synopsis>
616// These classes store an array column of type X.
617// </synopsis>
618
620{
621public:
623 const Table&);
625
626 // Re-create the column object for a selection of rows.
627 virtual void applySelection (const Vector<rownr_t>& rownrs);
628
629 virtual DComplex getElemDComplex (const TableExprId& id, const Slicer& index);
632 const Slicer&);
634 const Slicer&);
635protected:
637};
638
639
640// <summary>
641// DComplex array column in table select expression
642// </summary>
643
644// <use visibility=local>
645
646// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
647// </reviewed>
648
649// <prerequisite>
650//# Classes you should understand before using this one.
651// <li> TableExprNodeArrayColumn
652// </prerequisite>
653
654// <synopsis>
655// These classes store an array column of type X.
656// </synopsis>
657
659{
660public:
662 const Table&);
664
665 // Re-create the column object for a selection of rows.
666 virtual void applySelection (const Vector<rownr_t>& rownrs);
667
668 virtual DComplex getElemDComplex (const TableExprId& id, const Slicer& index);
671 const Slicer&);
673 const Slicer&);
674protected:
676};
677
678
679// <summary>
680// String array column in table select expression
681// </summary>
682
683// <use visibility=local>
684
685// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
686// </reviewed>
687
688// <prerequisite>
689//# Classes you should understand before using this one.
690// <li> TableExprNodeArrayColumn
691// </prerequisite>
692
693// <synopsis>
694// These classes store an array column of type X.
695// </synopsis>
696
698{
699public:
701 const Table&);
703
704 // Re-create the column object for a selection of rows.
705 virtual void applySelection (const Vector<rownr_t>& rownrs);
706
707 virtual String getElemString (const TableExprId& id, const Slicer& index);
710 const Slicer&);
712 const Slicer&);
713protected:
715};
716
717
718
719
720// <summary>
721// The index of an array element in a table select expression
722// </summary>
723
724// <use visibility=local>
725
726// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
727// </reviewed>
728
729// <prerequisite>
730//# Classes you should understand before using this one.
731// <li> TableExprNodeMulti
732// </prerequisite>
733
734// <etymology>
735// TableExprNodeIndex is used to store an index.
736// All the operands must be Int.
737// </etymology>
738
739// <synopsis>
740// TableExprNodeIndex is a derivation of TableExprNodeMulti
741// expression tree that represents an index.
742// </synopsis>
743
744// <motivation>
745// All operands of TableExprNodeIndex must be Int,
746// therefore it is a derivation of TableExprNodeMulti.
747// </motivation>
748
749// <todo asof="$DATE:$">
750//# A List of bugs, limitations, extensions or planned refinements.
751// <li> to be filled in
752// </todo>
753
755{
756public:
757 // Constructor
758 explicit TableExprNodeIndex (const TableExprNodeSet& indices,
759 const TaQLStyle& = TaQLStyle(0));
760
761 // Destructor
763
764 // Link all the operands and check datatype.
765 // Calculate the IPosition values for the const operands.
766 void fillIndex (const TableExprNodeSet& indices);
767
768 // Check if the index values match the dimensionality and shape
769 // of fixed-shaped array.
770 void checkIndexValues (const TENShPtr& arrayNode);
771
772 // Get the Slicer value for a constant index.
773 const Slicer& getConstantSlicer() const;
774
775 // Get the Slicer value for the slice.
776 const Slicer& getSlicer (const TableExprId& id);
777
778 // Does it index a single element?
779 Bool isSingle() const;
780
781protected:
782 Int origin_p; //# origin 0 for C++/Python; 1 for Glish
783 Int endMinus_p; //# subtract from end (origin and endExcl)
784 Bool isCOrder_p; //# True for Python
785 IPosition start_p; //# precalculated start values
786 IPosition end_p; //# precalculated end values (<0 = till end)
787 IPosition incr_p; //# precalculated increment values
788 Slicer slicer_p; //# combined start, end, and incr
789 Block<Bool> varIndex_p; //# is the start for the axes variable?
790 Bool isSingle_p; //# Index a single value?
791
792 // Precalculate the constant indices and store them.
794
795 // Fill the slicer for this row.
796 void fillSlicer (const TableExprId& id);
797
798 // Get the shape of the node involved. Reverse axes if needed.
799 IPosition getNodeShape (const TENShPtr& arrayNode) const;
800};
801
802
803
804
805// <summary>
806// Array column part in table select expression
807// </summary>
808
809// <use visibility=local>
810
811// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
812// </reviewed>
813
814// <prerequisite>
815//# Classes you should understand before using this one.
816// <li> TableExprNode
817// <li> TableExprNodeRep
818// <li> TableExprNodeBinary
819// </prerequisite>
820
821// <synopsis>
822// This class handles a part of an array.
823// It uses a TableExprNodeArray to handle the array
824// and a TableExprNodeIndex to store the index.
825// </synopsis>
826
828{
829public:
831 const TENShPtr& indexNode);
833
834 // Show the node.
835 virtual void show (ostream& os, uInt indent) const;
836
837 virtual Bool getBool (const TableExprId& id);
838 virtual Int64 getInt (const TableExprId& id);
839 virtual Double getDouble (const TableExprId& id);
840 virtual DComplex getDComplex (const TableExprId& id);
841 virtual String getString (const TableExprId& id);
842 virtual MVTime getDate (const TableExprId& id);
843
850
851 // Get the data type of this column (if possible).
852 // It returns with a False status when the index is not constant
853 // (that means that the index can vary with row number).
854 virtual Bool getColumnDataType (DataType&) const;
855
860 virtual Array<Int> getColumnInt (const Vector<rownr_t>& rownrs);
868
869 // Get the index node.
870 const TableExprNodeIndex* getIndexNode() const;
871
872 // Get the array column node.
873 // It returns 0 if the parent object is no array column.
875
876private:
879 TableExprNodeArrayColumn* colNode_p; //# 0 if arrNode is no arraycolumn
880};
881
882
883
884
886{
887 return isSingle_p;
888}
890{
891 return slicer_p;
892}
894{
895 if (!isConstant()) {
896 fillSlicer (id);
897 }
898 return slicer_p;
899}
900
902{
903 return tabCol_p;
904}
905
907{
908 return inxNode_p;
909}
910
911inline const TableExprNodeArrayColumn*
916
917
918
919} //# NAMESPACE CASACORE - END
920
921#endif
922
Non-templated base class for templated Array class.
Definition ArrayBase.h:73
simple 1-D array
Definition Block.h:200
String: the storage and methods of handling collections of characters.
Definition String.h:225
Bool array column in table select expression.
virtual Array< Bool > getElemColumnBool(const Vector< rownr_t > &rownrs, const Slicer &)
Get a single element for the entire column (used by sort).
virtual Bool getElemBool(const TableExprId &id, const Slicer &index)
Get a single element from the array in the given row.
TableExprNodeArrayColumnBool(const TableColumn &, const Table &)
virtual MArray< Bool > getArrayBool(const TableExprId &id)
Get an array value for this node in the given row.
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
virtual MArray< Bool > getSliceBool(const TableExprId &id, const Slicer &)
Get a slice of the array in the given row.
Complex array column in table select expression.
virtual DComplex getElemDComplex(const TableExprId &id, const Slicer &index)
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
virtual MArray< DComplex > getSliceDComplex(const TableExprId &id, const Slicer &)
TableExprNodeArrayColumnComplex(const TableColumn &, const Table &)
virtual MArray< DComplex > getArrayDComplex(const TableExprId &id)
The default implementation of getArrayDComplex does getArrayDouble and converts the result.
virtual Array< Complex > getElemColumnComplex(const Vector< rownr_t > &rownrs, const Slicer &)
DComplex array column in table select expression.
TableExprNodeArrayColumnDComplex(const TableColumn &, const Table &)
virtual Array< DComplex > getElemColumnDComplex(const Vector< rownr_t > &rownrs, const Slicer &)
virtual MArray< DComplex > getArrayDComplex(const TableExprId &id)
The default implementation of getArrayDComplex does getArrayDouble and converts the result.
virtual MArray< DComplex > getSliceDComplex(const TableExprId &id, const Slicer &)
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
virtual DComplex getElemDComplex(const TableExprId &id, const Slicer &index)
Double array column in table select expression.
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
virtual MArray< Double > getSliceDouble(const TableExprId &id, const Slicer &)
virtual Array< Double > getElemColumnDouble(const Vector< rownr_t > &rownrs, const Slicer &)
TableExprNodeArrayColumnDouble(const TableColumn &, const Table &)
virtual Double getElemDouble(const TableExprId &id, const Slicer &index)
virtual MArray< Double > getArrayDouble(const TableExprId &id)
The default implementation of getArrayDouble does getArrayInt and converts the result.
Float array column in table select expression.
virtual Array< Float > getElemColumnFloat(const Vector< rownr_t > &rownrs, const Slicer &)
virtual Double getElemDouble(const TableExprId &id, const Slicer &index)
TableExprNodeArrayColumnFloat(const TableColumn &, const Table &)
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
virtual MArray< Double > getSliceDouble(const TableExprId &id, const Slicer &)
virtual MArray< Double > getArrayDouble(const TableExprId &id)
The default implementation of getArrayDouble does getArrayInt and converts the result.
Int64 array column in table select expression.
virtual Array< Int64 > getElemColumnInt64(const Vector< rownr_t > &rownrs, const Slicer &)
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
virtual Int64 getElemInt(const TableExprId &id, const Slicer &index)
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
virtual MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &)
TableExprNodeArrayColumnInt64(const TableColumn &, const Table &)
Int array column in table select expression.
virtual Int64 getElemInt(const TableExprId &id, const Slicer &index)
virtual MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &)
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
virtual Array< Int > getElemColumnInt(const Vector< rownr_t > &rownrs, const Slicer &)
TableExprNodeArrayColumnInt(const TableColumn &, const Table &)
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
Short array column in table select expression.
virtual Array< Short > getElemColumnShort(const Vector< rownr_t > &rownrs, const Slicer &)
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
TableExprNodeArrayColumnShort(const TableColumn &, const Table &)
virtual MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &)
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
virtual Int64 getElemInt(const TableExprId &id, const Slicer &index)
String array column in table select expression.
virtual Array< String > getElemColumnString(const Vector< rownr_t > &rownrs, const Slicer &)
virtual MArray< String > getArrayString(const TableExprId &id)
TableExprNodeArrayColumnString(const TableColumn &, const Table &)
virtual MArray< String > getSliceString(const TableExprId &id, const Slicer &)
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
virtual String getElemString(const TableExprId &id, const Slicer &index)
Base class for Array column in table select expression.
TableExprNodeArrayColumn(const TableColumn &tablecol, const Table &table)
Create the object for the given column and table.
virtual Bool isDefined(const TableExprId &id)
Is the value in the given row defined?
const TableColumn & getColumn() const
Get the TableColumn object.
virtual void disableApplySelection()
Do not apply the selection.
virtual void getColumnNodes(std::vector< TableExprNodeRep * > &cols)
This node represents a table column.
virtual Bool getColumnDataType(DataType &) const
Get the data type of this column.
virtual const IPosition & getShape(const TableExprId &id)
Get the shape of the array in the given row.
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
uChar array column in table select expression
virtual MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &)
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
virtual Array< uChar > getElemColumnuChar(const Vector< rownr_t > &rownrs, const Slicer &)
virtual Int64 getElemInt(const TableExprId &id, const Slicer &index)
TableExprNodeArrayColumnuChar(const TableColumn &, const Table &)
uInt array column in table select expression
virtual Array< uInt > getElemColumnuInt(const Vector< rownr_t > &rownrs, const Slicer &)
virtual MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &)
TableExprNodeArrayColumnuInt(const TableColumn &, const Table &)
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
virtual Int64 getElemInt(const TableExprId &id, const Slicer &index)
uShort array column in table select expression
virtual void applySelection(const Vector< rownr_t > &rownrs)
Re-create the column object for a selection of rows.
virtual MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &)
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
TableExprNodeArrayColumnuShort(const TableColumn &, const Table &)
virtual Array< uShort > getElemColumnuShort(const Vector< rownr_t > &rownrs, const Slicer &)
virtual Int64 getElemInt(const TableExprId &id, const Slicer &index)
Array column part in table select expression.
virtual MArray< DComplex > getArrayDComplex(const TableExprId &id)
The default implementation of getArrayDComplex does getArrayDouble and converts the result.
virtual Array< DComplex > getColumnDComplex(const Vector< rownr_t > &rownrs)
virtual MVTime getDate(const TableExprId &id)
virtual Bool getBool(const TableExprId &id)
Get a scalar value for this node in the given row.
virtual void show(ostream &os, uInt indent) const
Show the node.
virtual Array< uShort > getColumnuShort(const Vector< rownr_t > &rownrs)
virtual Array< Bool > getColumnBool(const Vector< rownr_t > &rownrs)
Get the value of the expression evaluated for the entire column.
TableExprNodeArrayColumn * colNode_p
virtual Int64 getInt(const TableExprId &id)
TableExprNodeArrayPart(const TENShPtr &arrayNode, const TENShPtr &indexNode)
virtual Double getDouble(const TableExprId &id)
virtual Array< Int > getColumnInt(const Vector< rownr_t > &rownrs)
virtual DComplex getDComplex(const TableExprId &id)
const TableExprNodeArrayColumn * getColumnNode() const
Get the array column node.
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
virtual Bool getColumnDataType(DataType &) const
Get the data type of this column (if possible).
virtual String getString(const TableExprId &id)
virtual MArray< Double > getArrayDouble(const TableExprId &id)
The default implementation of getArrayDouble does getArrayInt and converts the result.
const TableExprNodeIndex * getIndexNode() const
Get the index node.
virtual Array< Short > getColumnShort(const Vector< rownr_t > &rownrs)
virtual Array< Float > getColumnFloat(const Vector< rownr_t > &rownrs)
virtual Array< uChar > getColumnuChar(const Vector< rownr_t > &rownrs)
virtual MArray< Bool > getArrayBool(const TableExprId &id)
Get an array value for this node in the given row.
virtual MArray< MVTime > getArrayDate(const TableExprId &id)
virtual Array< Int64 > getColumnInt64(const Vector< rownr_t > &rownrs)
virtual MArray< String > getArrayString(const TableExprId &id)
virtual Array< Double > getColumnDouble(const Vector< rownr_t > &rownrs)
virtual Array< uInt > getColumnuInt(const Vector< rownr_t > &rownrs)
virtual Array< String > getColumnString(const Vector< rownr_t > &rownrs)
virtual Array< Complex > getColumnComplex(const Vector< rownr_t > &rownrs)
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 &)
virtual MArray< Bool > hasArrayDate(const TableExprId &id, const MArray< MVTime > &value)
virtual Array< Int > getElemColumnInt(const Vector< rownr_t > &rownrs, const Slicer &)
virtual MArray< String > getSliceString(const TableExprId &id, const Slicer &)
TableExprNodeArray(NodeDataType, OperType, const IPosition &shape)
virtual MArray< Bool > hasArrayBool(const TableExprId &id, const MArray< Bool > &value)
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.
virtual MArray< Bool > hasArrayDComplex(const TableExprId &id, const MArray< DComplex > &value)
virtual Bool hasDComplex(const TableExprId &id, const DComplex &value)
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 MArray< Double > getArrayDouble(const TableExprId &id)
The default implementation of getArrayDouble does getArrayInt and converts the result.
virtual Bool getElemBool(const TableExprId &id, const Slicer &index)
Get a single element from the array in the given row.
virtual Bool hasDouble(const TableExprId &id, Double value)
static MArray< Double > makeArray(const IPosition &shape, Double value)
virtual Bool hasBool(const TableExprId &id, Bool value)
Does a value occur in the set?
virtual Bool hasInt(const TableExprId &id, Int64 value)
virtual MArray< MVTime > getSliceDate(const TableExprId &id, const Slicer &)
virtual MArray< Bool > hasArrayInt(const TableExprId &id, const MArray< Int64 > &value)
virtual Array< uShort > getElemColumnuShort(const Vector< rownr_t > &rownrs, const Slicer &)
virtual TENShPtr makeConstantScalar()
Turn a constant array with one element into a scalar.
virtual const IPosition & getShape(const TableExprId &id)
Get the shape of the array in the given row.
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.
static MArray< DComplex > makeArray(const IPosition &shape, const DComplex &value)
TableExprNodeArray(NodeDataType, OperType)
Create the object.
virtual Bool hasDate(const TableExprId &id, const MVTime &value)
virtual Bool hasString(const TableExprId &id, const String &value)
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 &)
virtual MArray< Double > getSliceDouble(const TableExprId &id, const Slicer &)
virtual MArray< Bool > hasArrayString(const TableExprId &id, const MArray< String > &value)
virtual MArray< DComplex > getArrayDComplex(const TableExprId &id)
The default implementation of getArrayDComplex does getArrayDouble and converts the result.
virtual MArray< Int64 > getSliceInt(const TableExprId &id, const Slicer &)
virtual Array< Complex > getElemColumnComplex(const Vector< rownr_t > &rownrs, const Slicer &)
virtual Array< Float > getElemColumnFloat(const Vector< rownr_t > &rownrs, const Slicer &)
virtual MArray< Bool > hasArrayDouble(const TableExprId &id, const MArray< Double > &value)
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.
virtual ~TableExprNodeIndex()
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).
Table & table()
Get table.
Class to hold multiple table expression nodes.
this file contains all the compiler specific defines
Definition mainpage.dox:28
unsigned int uInt
Definition aipstype.h:51
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Definition aipsxtype.h:38
int Int
Definition aipstype.h:50
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:42
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
double Double
Definition aipstype.h:55