casacore
Loading...
Searching...
No Matches
TableParseSortKey.h
Go to the documentation of this file.
1//# TableParseSortKey.h: Class to manage a key in a TaQL SORT command
2//# Copyright (C) 1994-2022
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_TABLEPARSESORTKEY_H
27#define TABLES_TABLEPARSESORTKEY_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/tables/TaQL/ExprNode.h>
32#include <casacore/casa/Utilities/Sort.h>
33
34
35namespace casacore { //# NAMESPACE CASACORE - BEGIN
36
37 // <summary>
38 // Helper class for sort keys in TableParse
39 // </summary>
40
41 // <use visibility=local>
42
43 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
44 // </reviewed>
45
46 // <synopsis>
47 // An object of this class is used to hold the sort expression
48 // and sort order of a single sort key.
49 // </synopsis>
50
51
53 {
54 public:
55 // Construct from a given expression.
56 // The order is not given.
58
59 // Construct from a given expression.
60 // The order is not given.
62
63 // Construct from a given expression and order.
65
66 // Get the expression node.
67 const TableExprNode& node() const
68 { return node_p; }
69
70 // Get the sort order.
72 { return order_p; }
73
74 // Is the order given?
76 { return given_p; }
77
78 // Add the values of the sort key to the Sort object by reading the
79 // values of the expression into an array.
80 // The array has to be deletedlater after the full sort is done.
81 std::shared_ptr<ArrayBase> addSortValues (Sort& sort,
82 Sort::Order mainOrder,
83 const Vector<rownr_t>&) const;
84
85 private:
86 // Check if the node results in a scalar and does not contain
87 // aggregate functions.
88 void checkNode() const;
89
93 };
94
95
96} //# NAMESPACE CASACORE - END
97
98#endif
Sort on one or more keys, ascending and/or descending.
Definition Sort.h:245
Order
Enumerate the sort order:
Definition Sort.h:256
TableParseSortKey()
Construct from a given expression.
TableParseSortKey(const TableExprNode &, Sort::Order)
Construct from a given expression and order.
Sort::Order order() const
Get the sort order.
const TableExprNode & node() const
Get the expression node.
void checkNode() const
Check if the node results in a scalar and does not contain aggregate functions.
Bool orderGiven() const
Is the order given?
TableParseSortKey(const TableExprNode &)
Construct from a given expression.
std::shared_ptr< ArrayBase > addSortValues(Sort &sort, Sort::Order mainOrder, const Vector< rownr_t > &) const
Add the values of the sort key to the Sort object by reading the values of the expression into an arr...
this file contains all the compiler specific defines
Definition mainpage.dox:28
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40