casacore
ExprNodeSet.h
Go to the documentation of this file.
1 //# ExprNodeSet.h: Classes representing a set in table select expression
2 //# Copyright (C) 1997,2000,2001,2002,2003
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: ExprNodeSet.h 21262 2012-09-07 12:38:36Z gervandiepen $
27 
28 #ifndef TABLES_EXPRNODESET_H
29 #define TABLES_EXPRNODESET_H
30 
31 //# Includes
32 #include <casacore/casa/aips.h>
33 #include <casacore/tables/TaQL/ExprNodeRep.h>
34 #include <casacore/tables/TaQL/ExprNodeArray.h>
35 #include <casacore/casa/Containers/Block.h>
36 #include <vector>
37 
38 namespace casacore { //# NAMESPACE CASACORE - BEGIN
39 
40 //# Forward Declarations
41 class TableExprNode;
42 class IPosition;
43 class Slicer;
44 template<class T> class Vector;
45 
46 
47 // <summary>
48 // Class to hold the table expression nodes for an element in a set.
49 // </summary>
50 
51 // <use visibility=export>
52 
53 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
54 // </reviewed>
55 
56 // <prerequisite>
57 //# Classes you should understand before using this one.
58 // <li> TableExprNodeSet
59 // <li> TableExprNodeRep
60 // </prerequisite>
61 
62 // <synopsis>
63 // This class is used to assemble the table expression nodes
64 // representing an element in a set. A set element can be of 3 types:
65 // <ol>
66 // <li> A single discrete value, which can be of any type.
67 // It can be used for 3 purposes:
68 // <br>- A function argument.
69 // <br>- A single index in an array indexing operation.
70 // <br>- A single value in a set (used with the IN operator).
71 // This is in fact a bounded discrete interval (see below).
72 // <li> A discrete interval consisting of start, end and increment.
73 // Each of those has to be an int scalar. Increment defaults to 1.
74 // It can be used for 2 purposes:
75 // <br>- A slice in an array indexing operation. In that case start
76 // defaults to the beginning of the dimension and end defaults to the end.
77 // <br>- A discrete interval in a set. Start has to be given.
78 // When end is not given, the result is an unbounded discrete interval.
79 // For a discrete interval, the type of start and end can also be
80 // a datetime scalar.
81 // <li> A continuous interval, which can only be used in a set.
82 // It consists of a start and/or an end scalar value of type int, double,
83 // datetime, or string. The interval can be open or closed on one or
84 // both sides.
85 // </ol>
86 // Note the difference between a discrete and a continuous interval.
87 // E.g. the discrete interval 2,6 consists of the five values 2,3,4,5,6.
88 // The continuous interval 2,6 consists of all values between them.
89 // <br>Further note that a bounded discrete interval is automatically
90 // converted to a vector, which makes it possible to apply array
91 // functions to it.
92 // </synopsis>
93 
95 {
96 public:
97  // Create the object for a single expression node.
98  explicit TableExprNodeSetElem (const TableExprNode& node);
99 
100  // Create the object for a discrete interval.
101  // Each of the start, end, and incr pointers can be zero meaning
102  // that they are not given (see the synopsis for an explanation).
103  // Optionally the end is inclusive (C++ and Glish style) or exclusive
104  // (Python style).
106  const TableExprNode* end,
107  const TableExprNode* incr,
108  Bool isEndExcl = False);
109 
110  // Create the object for a continuous bounded interval. It can be
111  // open or closed on either side.
113  const TableExprNode& end, Bool isRightClosed);
114 
115  // Create the object for a continuous left-bounded interval.
116  TableExprNodeSetElem (Bool isLeftClosed, const TableExprNode& start);
117 
118  // Create the object for a continuous right-bounded interval.
119  TableExprNodeSetElem (const TableExprNode& end, Bool isRightClosed);
120 
121  // Copy constructor (copy semantics).
123 
125 
126  // Show the node.
127  void show (ostream& os, uInt indent) const;
128 
129  // Get the nodes representing an aggregate function.
130  virtual void getAggrNodes (vector<TableExprNodeRep*>& aggr);
131 
132  // Get the nodes representing a table column.
133  virtual void getColumnNodes (vector<TableExprNodeRep*>& cols);
134 
135  // Is it a discrete set element.
136  Bool isDiscrete() const;
137 
138  // Is a single value given?
139  Bool isSingle() const;
140 
141  // Is the interval left or right closed?
142  // <group>
143  Bool isLeftClosed() const;
144  Bool isRightClosed() const;
145  // </group>
146 
147  // Get the start, end or increment expression.
148  // Note that the pointer returned can be zero indicating that that
149  // value was not given.
150  // <group>
151  TableExprNodeRep* start() const;
152  TableExprNodeRep* end() const;
153  TableExprNodeRep* increment() const;
154  // </group>
155 
156  // Fill a vector with the value(s) from this element by appending them
157  // at the end of the vector; the end is given by argument <src>cnt</src>
158  // which gets incremented with the number of values appended.
159  // This is used by the system to convert a set to a vector.
160  // <group>
161  void fillVector (Vector<Bool>& vec, Int64& cnt,
162  const TableExprId& id) const;
163  void fillVector (Vector<Int64>& vec, Int64& cnt,
164  const TableExprId& id) const;
165  void fillVector (Vector<Double>& vec, Int64& cnt,
166  const TableExprId& id) const;
167  void fillVector (Vector<DComplex>& vec, Int64& cnt,
168  const TableExprId& id) const;
169  void fillVector (Vector<String>& vec, Int64& cnt,
170  const TableExprId& id) const;
171  void fillVector (Vector<MVTime>& vec, Int64& cnt,
172  const TableExprId& id) const;
173  // </group>
174 
175  // Set a flag in the match output array if the corresponding element
176  // in the value array is included in this set element.
177  // This is used by the system to implement the IN operator.
178  // <br>Note that it does NOT set match values to False; it is assumed they
179  // are initialized that way.
180  // <group>
181  void matchBool (Bool* match, const Bool* value, uInt nval,
182  const TableExprId& id) const;
183  void matchInt (Bool* match, const Int64* value, uInt nval,
184  const TableExprId& id) const;
185  void matchDouble (Bool* match, const Double* value, uInt nval,
186  const TableExprId& id) const;
187  void matchDComplex (Bool* match, const DComplex* value, uInt nval,
188  const TableExprId& id) const;
189  void matchString (Bool* match, const String* value, uInt nval,
190  const TableExprId& id) const;
191  void matchDate (Bool* match, const MVTime* value, uInt nval,
192  const TableExprId& id) const;
193  // </group>
194 
195  // Evaluate the element for the given row and construct a new
196  // (constant) element from it.
197  // This is used by the system to implement a set in a GIVING clause.
198  TableExprNodeSetElem* evaluate (const TableExprId& id) const;
199 
200  // Get the table of a node and check if the children use the same table.
201  void checkTable();
202 
203  // Let a set node convert itself to the given unit.
204  virtual void adaptSetUnits (const Unit&);
205 
206 private:
207  // A copy of a TableExprNodeSetElem cannot be made.
209 
210  // Construct an element from the given parts and take over their pointers.
211  // It is used by evaluate to construct an element in a rather cheap way.
213  TableExprNodeRep* start, TableExprNodeRep* end,
214  TableExprNodeRep* incr);
215 
216  // Setup the object for a continuous interval.
217  void setup (Bool isLeftClosed, const TableExprNode* start,
218  const TableExprNode* end, Bool isRightClosed);
219 
220 
229 };
230 
231 
232 
234 {
235  return itsDiscrete;
236 }
238 {
239  return itsSingle;
240 }
242 {
243  return itsLeftClosed;
244 }
246 {
247  return itsRightClosed;
248 }
250 {
251  return itsStart;
252 }
254 {
255  return itsEnd;
256 }
258 {
259  return itsIncr;
260 }
261 
262 
263 
264 // <summary>
265 // Class to hold multiple table expression nodes.
266 // </summary>
267 
268 // <use visibility=export>
269 
270 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
271 // </reviewed>
272 
273 // <prerequisite>
274 //# Classes you should understand before using this one.
275 // <li> TableExprNode
276 // <li> TableExprNodeRep
277 // <li> TableExprNodeBinary
278 // </prerequisite>
279 
280 // <synopsis>
281 // This class is used to assemble several table expression nodes.
282 // It is used for 3 purposes:
283 // <ol>
284 // <li> To hold the arguments of a function.
285 // All set elements must be single.
286 // <li> To hold the variables of an index for an array slice.
287 // All set elements must be of type int scalar and they must
288 // represent a discrete interval (which includes single).
289 // <li> To hold the elements of a set used with the IN operator.
290 // All set elements must be scalars of any type.
291 // </ol>
292 // The type of all set elements has to be the same.
293 // The set consists of
294 // <linkto class=TableExprNodeSetElem>TableExprNodeSetElem</linkto>
295 // elements. The <src>add</src> function has to be used to
296 // add an element to the set.
297 // <p>
298 // It is possible to construct the object directly from an
299 // <linkto class=IPosition>IPosition</linkto> object.
300 // In that case all elements are single.
301 // Furthermore it is possible to construct it directly from a
302 // <linkto class=Slicer>Slicer</linkto> object.
303 // In that case all elements represent a discrete interval.
304 // </synopsis>
305 
307 {
308 public:
309  // Construct an empty set.
311 
312  // Construct from an <src>IPosition</src>.
313  // The number of elements in the set is the number of elements
314  // in the <src>IPosition</src>. All set elements are single values.
315  TableExprNodeSet (const IPosition&);
316 
317  // Construct from a <src>Slicer</src>.
318  // The number of elements in the set is the dimensionality
319  // of the <src>Slicer</src>. All set elements are discrete intervals.
320  // Their start and/or end is undefined if it is was not defined
321  // (i.e. Slicer::MimicSource used) in the <src>Slicer</src> object.
322  TableExprNodeSet (const Slicer&);
323 
324  // Construct a set with n*set.nelements() elements where n is the number
325  // of rows.
326  // Element i is constructed by evaluating the input element
327  // for row rownr[i].
328  TableExprNodeSet (const Vector<uInt>& rownrs, const TableExprNodeSet&);
329 
331 
332  ~TableExprNodeSet();
333 
334  // Add an element to the set.
335  // If adaptType=True, the data type is the highest of the elements added.
336  // Otherwise it is that of the first element.
337  // True is meant for a set of values, False for function arguments.
338  void add (const TableExprNodeSetElem&, Bool adaptType=False);
339 
340  // Show the node.
341  void show (ostream& os, uInt indent) const;
342 
343  // Get the nodes representing an aggregate function.
344  virtual void getAggrNodes (vector<TableExprNodeRep*>& aggr);
345 
346  // Get the nodes representing a table column.
347  virtual void getColumnNodes (vector<TableExprNodeRep*>& cols);
348 
349  // Check if the data type of the set elements are the same.
350  // If not, an exception is thrown.
351  //# Note that if itsCheckTypes is set, the data types are already
352  //# known to be equal.
353  void checkEqualDataTypes() const;
354 
355  // Contains the set only single elements?
356  // Single means that only single values are given (thus end nor incr).
357  Bool isSingle() const;
358 
359  // Contains the set only discrete elements?
360  // Discrete means that no continuous ranges are given, but discrete
361  // ranges (using :) are possible.
362  Bool isDiscrete() const;
363 
364  // Is the set fully bounded (discrete and no undefined end values)?
365  Bool isBounded() const;
366 
367  // Get the number of elements.
368  uInt nelements() const;
369 
370  // Get the i-th element.
371  const TableExprNodeSetElem& operator[] (uInt index) const;
372 
373  // Contains the set array values?
374  Bool hasArrays() const;
375 
376  // Try to convert the set to an array.
377  // If not possible, a copy of the set is returned.
378  TableExprNodeRep* setOrArray() const;
379 
380  template<typename T>
381  MArray<T> toArray (const TableExprId& id) const;
382 
383  // Get an array value for this bounded set in the given row.
384  // <group>
385  virtual MArray<Bool> getArrayBool (const TableExprId& id);
386  virtual MArray<Int64> getArrayInt (const TableExprId& id);
387  virtual MArray<Double> getArrayDouble (const TableExprId& id);
388  virtual MArray<DComplex> getArrayDComplex (const TableExprId& id);
389  virtual MArray<String> getArrayString (const TableExprId& id);
390  virtual MArray<MVTime> getArrayDate (const TableExprId& id);
391  // </group>
392 
393  // Does a value occur in the set?
394  // <group>
395  virtual Bool hasBool (const TableExprId& id, Bool value);
396  virtual Bool hasInt (const TableExprId& id, Int64 value);
397  virtual Bool hasDouble (const TableExprId& id, Double value);
398  virtual Bool hasDComplex (const TableExprId& id, const DComplex& value);
399  virtual Bool hasString (const TableExprId& id, const String& value);
400  virtual Bool hasDate (const TableExprId& id, const MVTime& value);
401  virtual MArray<Bool> hasArrayBool (const TableExprId& id,
402  const MArray<Bool>& value);
403  virtual MArray<Bool> hasArrayInt (const TableExprId& id,
404  const MArray<Int64>& value);
405  virtual MArray<Bool> hasArrayDouble (const TableExprId& id,
406  const MArray<Double>& value);
407  virtual MArray<Bool> hasArrayDComplex (const TableExprId& id,
408  const MArray<DComplex>& value);
409  virtual MArray<Bool> hasArrayString (const TableExprId& id,
410  const MArray<String>& value);
411  virtual MArray<Bool> hasArrayDate (const TableExprId& id,
412  const MArray<MVTime>& value);
413  // </group>
414 
415  // Let a set node convert itself to the given unit.
416  virtual void adaptSetUnits (const Unit&);
417 
418 private:
419  // A copy of a TableExprNodeSet cannot be made.
421 
422  // Delete all set elements in itsElems.
423  void deleteElems();
424 
425  // Convert the const set to an array.
426  TableExprNodeRep* toConstArray() const;
427 
428  // Get the array in a templated way.
429  // <group>
431  const TableExprId& id) const
432  { marr.reference (node->getArrayBool (id)); }
434  const TableExprId& id) const
435  { marr.reference (node->getArrayInt (id)); }
437  const TableExprId& id) const
438  { marr.reference (node->getArrayDouble (id)); }
440  const TableExprId& id) const
441  { marr.reference (node->getArrayDComplex (id)); }
443  const TableExprId& id) const
444  { marr.reference (node->getArrayString (id)); }
446  const TableExprId& id) const
447  { marr.reference (node->getArrayDate (id)); }
448  // </group>
449 
450  // Sort and combine intervals.
451  // <group>
452  void combineIntIntervals();
453  void combineDoubleIntervals();
454  void combineDateIntervals();
455  // </group>
456 
457  // Define the functions to find a double, which depend on open/closed-ness.
458  // In this way a test on open/closed is done only once.
459  // <group>
460  typedef Bool (TableExprNodeSet::* FindFuncPtr) (Double value);
461  Bool findOpenOpen (Double value);
462  Bool findOpenClosed (Double value);
463  Bool findClosedOpen (Double value);
464  Bool findClosedClosed (Double value);
465  void setFindFunc (Bool isLeftClosed, Bool isRightClosed);
466  // </group>
467 
468  std::vector<TableExprNodeSetElem*> itsElems;
471  Bool itsBounded; //# Set is discrete and all starts/ends are defined
472  Bool itsCheckTypes; //# True = checking data types is not needed
473  Bool itsAllIntervals; //# True = all elements are const intervals (sorted)
474  Block<Double> itsStart; //# Start values of const intervals
475  Block<Double> itsEnd; //# End values of const intervals
476  FindFuncPtr itsFindFunc; //# Function to find a matching const interval
477 };
478 
479 
481 {
482  return itsSingle;
483 }
485 {
486  return itsDiscrete;
487 }
489 {
490  return itsBounded;
491 }
493 {
494  return itsElems.size();
495 }
496 inline const TableExprNodeSetElem&
498 {
499  return *(itsElems[index]);
500 }
501 
502 
503 template<typename T>
505 {
506  // TODO: align possible units
507  DebugAssert (itsBounded, AipsError);
508  Int64 n = nelements();
509  if (hasArrays()) {
510  // Handle a nested array; this is done recursively.
511  MArray<T> marr;
512  getArray (marr, itsElems[0]->start(), id);
513  if (marr.isNull()) return marr;
514  Array<T> result (marr.array());
515  Array<Bool> mask (marr.mask());
516  IPosition shp = result.shape();
517  uInt naxes = shp.size();
518  shp.append (IPosition(1,n));
519  result.resize (shp, True);
520  if (! mask.empty()) mask.resize (shp, True);
521  ArrayIterator<T> iter(result, shp.size()-1);
522  IPosition s(shp);
523  IPosition e(shp);
524  s[naxes] = 0;
525  e[naxes] = 0;
526  for (Int64 i=1; i<n; i++) {
527  iter.next();
528  s[naxes]++;
529  e[naxes]++;
530  MArray<T> marr;
531  getArray (marr, itsElems[i]->start(), id);
532  if (marr.isNull()) return marr;
533  if (! marr.shape().isEqual (iter.array().shape())) {
534  throw TableInvExpr("Shapes of nested arrays do not match");
535  }
536  iter.array() = marr.array();
537  if (marr.hasMask()) {
538  if (mask.empty()) {
539  mask.resize (shp);
540  mask = False;
541  }
542  mask(s,e) = marr.mask();
543  } else if (! mask.empty()) {
544  mask(s,e) = False;
545  }
546  }
547  return MArray<T>(result, mask);
548  } else {
549  Int64 n = nelements();
550  Int64 cnt = 0;
551  Vector<T> result (n);
552  for (Int64 i=0; i<n; i++) {
553  itsElems[i]->fillVector (result, cnt, id);
554  }
555  result.resize (cnt, True);
556  return MArray<T>(result);
557  }
558 }
559 
560 
561 
562 } //# NAMESPACE CASACORE - END
563 
564 #endif
A Vector of integers, for indexing into Array<T> objects.
Definition: IPosition.h:119
TableExprNodeRep * itsIncr
Definition: ExprNodeSet.h:223
size_t size() const
Definition: ArrayBase.h:101
void getArray(MArray< Bool > &marr, TableExprNodeRep *node, const TableExprId &id) const
Get the array in a templated way.
Definition: ExprNodeSet.h:430
virtual void getAggrNodes(vector< TableExprNodeRep *> &aggr)
Get the nodes representing an aggregate function.
Bool isNull() const
Is the array null?
Definition: MArrayBase.h:111
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size)
Definition: aipsxtype.h:38
void matchDate(Bool *match, const MVTime *value, uInt nval, const TableExprId &id) const
Class to handle an Array with an optional mask.
Definition: ExprNode.h:54
virtual MArray< Bool > hasArrayString(const TableExprId &id, const MArray< String > &value)
void matchBool(Bool *match, const Bool *value, uInt nval, const TableExprId &id) const
Set a flag in the match output array if the corresponding element in the value array is included in t...
uInt nelements() const
Get the number of elements.
Definition: ExprNodeSet.h:492
Block< Double > itsEnd
Definition: ExprNodeSet.h:475
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
void getArray(MArray< String > &marr, TableExprNodeRep *node, const TableExprId &id) const
Definition: ExprNodeSet.h:442
Bool isBounded() const
Is the set fully bounded (discrete and no undefined end values)?
Definition: ExprNodeSet.h:488
virtual MArray< Bool > getArrayBool(const TableExprId &id)
Get an array value for this node in the given row.
Class to hold multiple table expression nodes.
Definition: ExprNodeSet.h:306
Handle class for a table column expression tree.
Definition: ExprNode.h:614
void getArray(MArray< MVTime > &marr, TableExprNodeRep *node, const TableExprId &id) const
Definition: ExprNodeSet.h:445
virtual MArray< MVTime > getArrayDate(const TableExprId &id)
void getArray(MArray< DComplex > &marr, TableExprNodeRep *node, const TableExprId &id) const
Definition: ExprNodeSet.h:439
Bool isLeftClosed() const
Is the interval left or right closed?
Definition: ExprNodeSet.h:241
virtual MArray< Bool > hasArrayDComplex(const TableExprId &id, const MArray< DComplex > &value)
TableExprNodeSetElem * evaluate(const TableExprId &id) const
Evaluate the element for the given row and construct a new (constant) element from it...
void show(ostream &os, uInt indent) const
Show the node.
void reference(const MArray< T > &other)
Reference another array.
Definition: MArray.h:114
TableExprNodeRep * start() const
Get the start, end or increment expression.
Definition: ExprNodeSet.h:249
Abstract base class for a node in a table column expression tree.
Definition: ExprNodeRep.h:151
void checkTable()
Get the table of a node and check if the children use the same table.
virtual Bool hasDComplex(const TableExprId &id, const DComplex &value)
virtual void adaptSetUnits(const Unit &)
Let a set node convert itself to the given unit.
virtual Bool hasInt(const TableExprId &id, Int64 value)
Iterate an Array cursor through another Array.
Definition: Array.h:54
const Array< Bool > & mask() const
Get the mask.
Definition: MArrayBase.h:126
defines physical units
Definition: Unit.h:189
virtual void resize()
Make this array a different shape.
virtual MArray< Double > getArrayDouble(const TableExprId &id)
virtual MArray< DComplex > getArrayDComplex(const TableExprId &id)
Class to hold the table expression nodes for an element in a set.
Definition: ExprNodeSet.h:94
const Array< T > & array() const
Get access to the array.
Definition: MArray.h:153
virtual MArray< Bool > hasArrayDate(const TableExprId &id, const MArray< MVTime > &value)
double Double
Definition: aipstype.h:55
void getArray(MArray< Int64 > &marr, TableExprNodeRep *node, const TableExprId &id) const
Definition: ExprNodeSet.h:433
const TableExprNodeSetElem & operator[](uInt index) const
Get the i-th element.
Definition: ExprNodeSet.h:497
TableExprNodeSetElem(const TableExprNode &node)
Create the object for a single expression node.
virtual MArray< Bool > hasArrayInt(const TableExprId &id, const MArray< Int64 > &value)
LatticeExprNode nelements(const LatticeExprNode &expr)
1-argument function to get the number of elements in a lattice.
virtual Bool hasDate(const TableExprId &id, const MVTime &value)
virtual Bool hasBool(const TableExprId &id, Bool value)
Does a value occur in an array or set? The default implementation tests if it is in an array...
void fillVector(Vector< Bool > &vec, Int64 &cnt, const TableExprId &id) const
Fill a vector with the value(s) from this element by appending them at the end of the vector; the end...
#define DebugAssert(expr, exception)
Definition: Assert.h:185
Bool isSingle() const
Is a single value given?
Definition: ExprNodeSet.h:237
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual MArray< Bool > hasArrayDouble(const TableExprId &id, const MArray< Double > &value)
Block< Double > itsStart
Definition: ExprNodeSet.h:474
Bool isDiscrete() const
Is it a discrete set element.
Definition: ExprNodeSet.h:233
Bool isDiscrete() const
Contains the set only discrete elements? Discrete means that no continuous ranges are given...
Definition: ExprNodeSet.h:484
void setup(Bool isLeftClosed, const TableExprNode *start, const TableExprNode *end, Bool isRightClosed)
Setup the object for a continuous interval.
const Bool False
Definition: aipstype.h:44
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
void matchString(Bool *match, const String *value, uInt nval, const TableExprId &id) const
MArray< T > toArray(const TableExprId &id) const
Definition: ExprNodeSet.h:504
template <class T, class U> class vector;
Definition: Array.h:169
Bool isSingle() const
Contains the set only single elements? Single means that only single values are given (thus end nor i...
Definition: ExprNodeSet.h:480
Specify which elements to extract from an n-dimensional array.
Definition: Slicer.h:289
TableExprNodeRep * increment() const
Definition: ExprNodeSet.h:257
virtual Bool hasDouble(const TableExprId &id, Double value)
void matchDComplex(Bool *match, const DComplex *value, uInt nval, const TableExprId &id) const
The identification of a TaQL selection subject.
Definition: TableExprId.h:98
Base class for all Casacore library errors.
Definition: Error.h:135
const Double e
e and functions thereof:
const IPosition & shape() const
Get the shape.
Definition: MArrayBase.h:147
void getArray(MArray< Double > &marr, TableExprNodeRep *node, const TableExprId &id) const
Definition: ExprNodeSet.h:436
TableExprNodeRep * end() const
Definition: ExprNodeSet.h:253
virtual MArray< Bool > hasArrayBool(const TableExprId &id, const MArray< Bool > &value)
Bool hasMask() const
Is there a mask?
Definition: MArrayBase.h:119
virtual MArray< String > getArrayString(const TableExprId &id)
String: the storage and methods of handling collections of characters.
Definition: String.h:223
virtual void getColumnNodes(vector< TableExprNodeRep *> &cols)
Get the nodes representing a table column.
void getArray(Array< V > &val, int type, const Record &gr, const String &name)
void resize(size_t len, Bool copyValues=False)
Definition: Vector.h:171
TableExprNodeRep * itsEnd
Definition: ExprNodeSet.h:222
Class to handle date/time type conversions and I/O.
Definition: MVTime.h:266
std::vector< TableExprNodeSetElem * > itsElems
Definition: ExprNodeSet.h:468
virtual Bool hasString(const TableExprId &id, const String &value)
TableExprNodeSetElem & operator=(const TableExprNodeSetElem &)
A copy of a TableExprNodeSetElem cannot be made.
TableExprNodeRep * itsStart
Definition: ExprNodeSet.h:221
void matchDouble(Bool *match, const Double *value, uInt nval, const TableExprId &id) const
const Bool True
Definition: aipstype.h:43
Table error; invalid select expression.
Definition: TableError.h:450
this file contains all the compiler specific defines
Definition: mainpage.dox:28
void matchInt(Bool *match, const Int64 *value, uInt nval, const TableExprId &id) const
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.
unsigned int uInt
Definition: aipstype.h:51