This file is indexed.

/usr/include/casacore/tables/TaQL/ExprAggrNode.h is in casacore-dev 2.2.0-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
//# ExprAggrNode.h: TaQL node representing a scalar aggregate function
//# Copyright (C) 2013
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//#        Internet email: aips2-request@nrao.edu.
//#        Postal address: AIPS++ Project Office
//#                        National Radio Astronomy Observatory
//#                        520 Edgemont Road
//#                        Charlottesville, VA 22903-2475 USA
//#
//# $Id: TaQLNode.h 21051 2011-04-20 11:46:29Z gervandiepen $

#ifndef TABLES_EXPRAGGRNODE_H
#define TABLES_EXPRAGGRNODE_H

//# Includes
#include <casacore/casa/aips.h>
#include <casacore/tables/TaQL/ExprFuncNode.h>


namespace casacore { //# NAMESPACE CASACORE - BEGIN

  //# Forward Declarations.
  class TableExprGroupFuncBase;
  class TableExprGroupFuncSet;

// <summary>
// TaQL node representing a scalar aggregate function
// </summary>

// <use visibility=local>

// <reviewed reviewer="" date="" tests="tTableGram">
// </reviewed>

// <synopsis>
// A TableExprAggrNode object is a special TableExprFuncNode object.
// Instead of operating on a single row, it operates on a group of table
// rows, usually formed by means of the GROUPBY clause.
// It aggregates the values in the rows in the group by means of an
// aggregation function derived from TableExprGroupFuncBase.
// Several standard aggregation functions (e.g., gmean, gmin, gsum) are
// defined in TaQL and implemented this way.
//
// There are two types of aggregate function implementations:
// <ul>
//  <li> Immediate aggregate functions calculate the results while the
//       groups are being formed. In this way they step sequentially through
//       the data.
//       This is only possible for functions that do not have to keep
//       to many data in memory.
//  <li> Lazy aggregate functions calculate the results after the groups are
//       formed using the vector of TableExprIds they get per group.
//       In this way only data for a single group might need to be kept in
//       memory. It is used, for instance, to calculate the median.
// </ul>
// Note that this class handles operands that are a scalar or array.
// If array, all values in the array are used as individual values.
// Class TableExprAggrNodeArray handles aggregate functions giving an
// array result (e.g., function <src>gaggr</src>).
//
// It is also possible to define an aggregate function in a UDF derived
// from class UDFBase. Such an aggregate function is instantiated as a
// TableExprUDFNode(Array) object, not as TabeExprAggrNode(Array).
// These functions are always lazy.
// </synopsis> 

  class TableExprAggrNode: public TableExprFuncNode
  {
  public:
    // Constructor.
    TableExprAggrNode (FunctionType, NodeDataType, ValueType,
		       const TableExprNodeSet& source);

    // Check the operands of the aggregate function and return the
    // result's data type.
    static NodeDataType checkOperands (Block<Int>& dtypeOper,
                                       ValueType& resVT, FunctionType ftype,
                                       PtrBlock<TableExprNodeRep*>& nodes);

    // Get the nodes representing an aggregate function.
    virtual void getAggrNodes (vector<TableExprNodeRep*>& aggr);

    // Get the operand node.
    TableExprNodeRep* operand()
      { return (operands().empty()  ?  0 : operands()[0]); }

    // Create the correct aggregate function object.
    // It is also kept in case it is a lazy aggregate function.
    virtual CountedPtr<TableExprGroupFuncBase> makeGroupAggrFunc();

    // Is the aggregate function a lazy or an immediate one?
    virtual Bool isLazyAggregate() const;

    // Functions to get the result of an aggregate function.
    // <group>
    virtual Bool      getBool     (const TableExprId& id);
    virtual Int64     getInt      (const TableExprId& id);
    virtual Double    getDouble   (const TableExprId& id);
    virtual DComplex  getDComplex (const TableExprId& id);
    virtual String    getString   (const TableExprId& id);
    virtual MVTime    getDate     (const TableExprId& id);
    // </group>

  private:
    // Do the actual creation of the correct aggregate function object.
    TableExprGroupFuncBase* doMakeGroupAggrFunc();

    //# Data members.
    CountedPtr<TableExprGroupFuncBase> itsFunc;
  };


} //# NAMESPACE CASACORE - END

#endif