casacore
Loading...
Searching...
No Matches
ExprNodeRecord.h
Go to the documentation of this file.
1// # ExprNodeRecord.h: Nodes representing fields in record select expression tree
2// # Copyright (C) 2000
3// # Associated Universities, Inc. Washington DC, USA.
4// #
5// # This library is free software; you can redistribute it and/or modify it
6// # under the terms of the GNU Library General Public License as published by
7// # the Free Software Foundation; either version 2 of the License, or (at your
8// # option) any later version.
9// #
10// # This library is distributed in the hope that it will be useful, but WITHOUT
11// # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12// # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13// # License for more details.
14// #
15// # You should have received a copy of the GNU Library General Public License
16// # along with this library; if not, write to the Free Software Foundation,
17// # Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18// #
19// # Correspondence concerning AIPS++ should be addressed as follows:
20// # Internet email: 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_EXPRNODERECORD_H
27#define TABLES_EXPRNODERECORD_H
28
29// # Includes
30#include <casacore/tables/TaQL/ExprNodeRep.h>
31#include <casacore/tables/TaQL/ExprNodeArray.h>
32#include <casacore/casa/Containers/Block.h>
33#include <casacore/casa/Utilities/DataType.h>
34
35namespace casacore { // # NAMESPACE CASACORE - BEGIN
36
37// # Forward Declarations
38class RecordDesc;
39class RecordInterface;
40
41// # This file defines classes derived from TableExprNode representing
42// # fields in a record select expression.
43// #
44// # Data types Bool, Double, DComplex and String are used.
45// # Char, uChar, Short, uShort, Int and uInt are converted to Int64,
46// # float to Double, and Complex to DComplex.
47// # Binary operators +, -, *, /, ==, >=, >, <, <= and != are recognized.
48// # Also &&, ||, parentheses and unary +, - and ! are recognized.
49
50// <summary>
51// Scalar field in record select expression tree
52// </summary>
53
54// <use visibility=local>
55
56// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
57// </reviewed>
58//
59// <prerequisite>
60// # Classes you should understand before using this one.
61// <li> TableExprNode
62// </prerequisite>
63
64// <synopsis>
65// This class represents a scalar column in a table select expression tree.
66// When the select expression gets evaluated, the value of the
67// given row in the column is used.
68// </synopsis>
69
71 public:
72 TableExprNodeRecordField(DataType dtype, const Block<Int>& fieldNumbers);
74
75 virtual const IPosition& getShape(const TableExprId& id);
76 virtual Bool isDefined(const TableExprId& id);
77
78 virtual Bool getBool(const TableExprId& id);
79 virtual Int64 getInt(const TableExprId& id);
80 virtual Double getDouble(const TableExprId& id);
81 virtual DComplex getDComplex(const TableExprId& id);
82 virtual String getString(const TableExprId& id);
83
84 protected:
87
88 // Get the record for the last field number, thus going through
89 // all subrecords for the other field numbers.
90 const RecordInterface& getRecord(const TableExprId& id) const;
91};
92
93// <summary>
94// Array field in record select expression tree
95// </summary>
96
97// <use visibility=local>
98
99// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
100// </reviewed>
101//
102// <prerequisite>
103// # Classes you should understand before using this one.
104// <li> TableExprNode
105// </prerequisite>
106
107// <synopsis>
108// This class represents a scalar column in a table select expression tree.
109// When the select expression gets evaluated, the value of the
110// given row in the column is used.
111// </synopsis>
112
114 public:
115 TableExprNodeRecordFieldArray(DataType dtype, const Block<Int>& fieldNumbers);
117
118 virtual Bool isDefined(const TableExprId& id);
119 virtual const IPosition& getShape(const TableExprId& id);
120
126
127 protected:
130
131 // Get the record for the last field number, thus going through
132 // all subrecords for the other field numbers.
133 const RecordInterface& getRecord(const TableExprId& id) const;
134};
135
136} // namespace casacore
137
138#endif
String: the storage and methods of handling collections of characters.
Definition String.h:355
TableExprNodeArray(NodeDataType, OperType)
Create the object.
TableExprNodeBinary(NodeDataType, ValueType, OperType, ExprType)
Constructor.
virtual MArray< String > getArrayString(const TableExprId &id)
virtual const IPosition & getShape(const TableExprId &id)
Get the shape of the array in the given row.
virtual Bool isDefined(const TableExprId &id)
Is the value in the given row defined?
virtual MArray< Int64 > getArrayInt(const TableExprId &id)
virtual MArray< Bool > getArrayBool(const TableExprId &id)
Get an array value for this node in the given row.
virtual MArray< DComplex > getArrayDComplex(const TableExprId &id)
The default implementation of getArrayDComplex does getArrayDouble and converts the result.
const RecordInterface & getRecord(const TableExprId &id) const
Get the record for the last field number, thus going through all subrecords for the other field numbe...
TableExprNodeRecordFieldArray(DataType dtype, const Block< Int > &fieldNumbers)
virtual MArray< Double > getArrayDouble(const TableExprId &id)
The default implementation of getArrayDouble does getArrayInt and converts the result.
const RecordInterface & getRecord(const TableExprId &id) const
Get the record for the last field number, thus going through all subrecords for the other field numbe...
virtual Bool isDefined(const TableExprId &id)
Is the value in the given row defined?
virtual Bool getBool(const TableExprId &id)
Get a scalar value for this node in the given row.
TableExprNodeRecordField(DataType dtype, const Block< Int > &fieldNumbers)
virtual const IPosition & getShape(const TableExprId &id)
Get the shape for the given row.
virtual String getString(const TableExprId &id)
virtual DComplex getDComplex(const TableExprId &id)
virtual Int64 getInt(const TableExprId &id)
virtual Double getDouble(const TableExprId &id)
For temporary backward namespace compatibility, use casa as alias for casacore.
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
RecordInterface()
The default constructor creates an empty record with a variable structure.
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
double Double
Definition aipstype.h:53