casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TaQLResult.h
Go to the documentation of this file.
1 //# TaQLResult.h: Class to hold the result of a TaQL command
2 //# Copyright (C) 2004
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$
27 
28 #ifndef TABLES_TAQLRESULT_H
29 #define TABLES_TAQLRESULT_H
30 
31 
32 //# Includes
33 #include <casacore/casa/aips.h>
36 
37 namespace casacore {
38 
39 // <summary>
40 // Class to hold the result of a TaQL command.
41 // </summary>
42 
43 // <use visibility=local>
44 
45 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
46 // </reviewed>
47 
48 // <prerequisite>
49 //# Classes you should understand before using this one.
50 // </prerequisite>
51 
52 // <synopsis>
53 // The result of a TaQL command can be a Table or a TableExprNode.
54 // This class holds the actual result.
55 // </synopsis>
56 
57 // <motivation>
58 // It is possible to give a TaQL command resulting in a TableExprNode
59 // to make it possible to make expressions of columns.
60 // </motivation>
61 
62 //# <todo asof="$DATE:$">
63 //# A List of bugs, limitations, extensions or planned refinements.
64 //# </todo>
65 
66 
68 {
69 public:
70  // Construct from a Table.
71  TaQLResult (const Table& = Table());
72 
73  // Construct from a TableExprNode.
74  explicit TaQLResult (const TableExprNode&);
75 
76  // Is the result a Table?
77  Bool isTable() const
78  { return itsNode.isNull(); }
79 
80  // Return the result as a Table.
81  // It throws an exception if it is not a Table.
82  Table table() const;
83 
84  // Make it possible to convert automatically to a Table
85  //# (for backwards compatibility).
86  operator Table() const
87  { return table(); }
88 
89  // Return the result as a TableExprNode.
90  // It throws an exception if it is not a TableExprNode.
91  TableExprNode node() const;
92 
93 private:
96 };
97 
98 }
99 #endif
Main interface class to a read/write table.
Definition: Table.h:157
Handle class for a table column expression tree.
Definition: ExprNode.h:156
Table table() const
Return the result as a Table.
Bool isTable() const
Is the result a Table?
Definition: TaQLResult.h:77
TableExprNode itsNode
Definition: TaQLResult.h:95
Class to hold the result of a TaQL command.
Definition: TaQLResult.h:67
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
TableExprNode node() const
Return the result as a TableExprNode.
Bool isNull() const
Does the node contain no actual node?
Definition: ExprNode.h:272
TaQLResult(const Table &=Table())
Construct from a Table.