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
42//# This file defines classes derived from TableExprNode representing
43//# fields in a record select expression.
44//#
45//# Data types Bool, Double, DComplex and String are used.
46//# Char, uChar, Short, uShort, Int and uInt are converted to Int64,
47//# float to Double, and Complex to DComplex.
48//# Binary operators +, -, *, /, ==, >=, >, <, <= and != are recognized.
49//# Also &&, ||, parentheses and unary +, - and ! are recognized.
50
51
52
53// <summary>
54// Scalar field in record select expression tree
55// </summary>
56
57// <use visibility=local>
58
59// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
60// </reviewed>
61//
62// <prerequisite>
63//# Classes you should understand before using this one.
64// <li> TableExprNode
65// </prerequisite>
66
67// <synopsis>
68// This class represents a scalar column in a table select expression tree.
69// When the select expression gets evaluated, the value of the
70// given row in the column is used.
71// </synopsis>
72
73
75{
76public:
77 TableExprNodeRecordField (DataType dtype,
78 const Block<Int>& fieldNumbers);
80
81 virtual const IPosition& getShape (const TableExprId& id);
82 virtual Bool isDefined (const TableExprId& id);
83
84 virtual Bool getBool (const TableExprId& id);
85 virtual Int64 getInt (const TableExprId& id);
86 virtual Double getDouble (const TableExprId& id);
87 virtual DComplex getDComplex (const TableExprId& id);
88 virtual String getString (const TableExprId& id);
89
90protected:
93
94 // Get the record for the last field number, thus going through
95 // all subrecords for the other field numbers.
96 const RecordInterface& getRecord (const TableExprId& id) const;
97};
98
99
100
101// <summary>
102// Array field in record select expression tree
103// </summary>
104
105// <use visibility=local>
106
107// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
108// </reviewed>
109//
110// <prerequisite>
111//# Classes you should understand before using this one.
112// <li> TableExprNode
113// </prerequisite>
114
115// <synopsis>
116// This class represents a scalar column in a table select expression tree.
117// When the select expression gets evaluated, the value of the
118// given row in the column is used.
119// </synopsis>
120
121
123{
124public:
126 const Block<Int>& fieldNumbers);
128
129 virtual Bool isDefined (const TableExprId& id);
130 virtual const IPosition& getShape (const TableExprId& id);
131
137
138protected:
141
142 // Get the record for the last field number, thus going through
143 // all subrecords for the other field numbers.
144 const RecordInterface& getRecord (const TableExprId& id) const;
145};
146
147
148
149
150} //# NAMESPACE CASACORE - END
151
152#endif
simple 1-D array
Definition Block.h:198
String: the storage and methods of handling collections of characters.
Definition String.h:223
Abstract base class for a node having 0, 1, or 2 child nodes.
Array field in record select expression tree.
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? The default implementation returns True.
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? The default implementation returns True.
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)
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
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40
double Double
Definition aipstype.h:53