Loading...
Searching...
No Matches
ExprConeNode.h
Go to the documentation of this file.
//# ExprConeNode.h: Class representing a cone search in table select expression
//# Copyright (C) 2005
//# 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: casa-feedback@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
#ifndef TABLES_EXPRCONENODE_H
#define TABLES_EXPRCONENODE_H
//# Includes
#include <casacore/casa/aips.h>
#include <casacore/tables/TaQL/ExprFuncNode.h>
#include <casacore/tables/TaQL/ExprFuncNodeArray.h>
namespace casacore { //# NAMESPACE CASACORE - BEGIN
// <summary>
// Class representing a cone search in table select expression
// </summary>
// <use visibility=local>
// <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="">
// </reviewed>
// <prerequisite>
//# Classes you should understand before using this one.
// <li> <linkto class=TableExprFuncNode>TableExprFuncNode</linkto>
// </prerequisite>
// <synopsis>
// The class represents a cone search.
// It is a specialization of the TableExprFuncNode class.
// Currently the implementation is straightforward, but in the future
// it can do smarter things.
// For instance:
// <ul>
// <li> If the cone positions and radii are constant, one can use
// an integer zone number (e.g. floor(dec)) to avoid the much
// more expensive sine/cosine calculations. Each cone will get a
// minzone and maxzone value (derived from cone position and radius).
// <li> Multiple cones can be ordered on minzone and maxzone.
// </ul>
// </synopsis>
class TableExprConeNode : public TableExprFuncNode
{
public:
// Constructor
TableExprConeNode (FunctionType, NodeDataType,
const TableExprNodeSet& source,
const vector<TENShPtr>& nodes,
const Block<Int>& dtypeOper,
uInt origin);
// Destructor
~TableExprConeNode();
// 'get' Functions to get the desired result of a function.
// <group>
Bool getBool (const TableExprId& id);
Int64 getInt (const TableExprId& id);
// </group>
// Check the data and value types of the operands.
// It sets the exptected data and value types of the operands.
// Set the value type of the function result and returns
// the data type of the function result.
static NodeDataType checkOperands (Block<Int>& dtypeOper,
ValueType& resVT,
Block<Int>& vtypeOper,
FunctionType,
const std::vector<TENShPtr>&);
private:
// Find the number of elements in an argument.
// It returns -1 if unknown.
static Int findNelem (const TENShPtr& node);
uInt origin_p;
};
class TableExprConeNodeArray : public TableExprFuncNodeArray
{
public:
// Constructor
TableExprConeNodeArray (TableExprFuncNode::FunctionType, NodeDataType,
const TableExprNodeSet& source,
const vector<TENShPtr>& nodes,
const Block<Int>& dtypeOper,
uInt origin);
// Destructor
~TableExprConeNodeArray();
// 'get' Functions to get the desired result of a function.
// <group>
MArray<Bool> getArrayBool (const TableExprId& id);
MArray<Int64> getArrayInt (const TableExprId& id);
// </group>
private:
uInt origin_p;
};
} //# NAMESPACE CASACORE - END
#endif
casacore::Block
Definition Block.h:140
casacore::MArray
Definition MArray.h:68
casacore::TableExprConeNodeArray::getArrayInt
MArray< Int64 > getArrayInt(const TableExprId &id)
casacore::TableExprConeNodeArray::TableExprConeNodeArray
TableExprConeNodeArray(TableExprFuncNode::FunctionType, NodeDataType, const TableExprNodeSet &source, const vector< TENShPtr > &nodes, const Block< Int > &dtypeOper, uInt origin)
Constructor.
casacore::TableExprConeNodeArray::~TableExprConeNodeArray
~TableExprConeNodeArray()
Destructor.
casacore::TableExprConeNodeArray::getArrayBool
MArray< Bool > getArrayBool(const TableExprId &id)
'get' Functions to get the desired result of a function.
casacore::TableExprConeNodeArray::origin_p
uInt origin_p
Definition ExprConeNode.h:127
casacore::TableExprConeNode::origin_p
uInt origin_p
Definition ExprConeNode.h:101
casacore::TableExprConeNode::TableExprConeNode
TableExprConeNode(FunctionType, NodeDataType, const TableExprNodeSet &source, const vector< TENShPtr > &nodes, const Block< Int > &dtypeOper, uInt origin)
Constructor.
casacore::TableExprConeNode::~TableExprConeNode
~TableExprConeNode()
Destructor.
casacore::TableExprConeNode::checkOperands
static NodeDataType checkOperands(Block< Int > &dtypeOper, ValueType &resVT, Block< Int > &vtypeOper, FunctionType, const std::vector< TENShPtr > &)
Check the data and value types of the operands.
casacore::TableExprConeNode::findNelem
static Int findNelem(const TENShPtr &node)
Find the number of elements in an argument.
casacore::TableExprConeNode::getInt
Int64 getInt(const TableExprId &id)
casacore::TableExprConeNode::getBool
Bool getBool(const TableExprId &id)
'get' Functions to get the desired result of a function.
casacore::TableExprFuncNodeArray::TableExprFuncNodeArray
TableExprFuncNodeArray(TableExprFuncNode::FunctionType, NodeDataType, ValueType, const TableExprNodeSet &source, const vector< TENShPtr > &nodes, const Block< Int > &dtypeOper, const TaQLStyle &)
Constructor.
casacore::TableExprFuncNode::FunctionType
FunctionType
Definition ExprFuncNode.h:79
casacore::TableExprFuncNode::TableExprFuncNode
TableExprFuncNode(FunctionType, NodeDataType, ValueType, const TableExprNodeSet &source, const vector< TENShPtr > &nodes, const Block< Int > &dtypeOper, const TableExprInfo &=TableExprInfo())
Constructor.
casacore::TableExprId
Definition TableExprId.h:95
casacore::TableExprNodeRep::NodeDataType
NodeDataType
Define the data types of a node.
Definition ExprNodeRep.h:205
casacore::TableExprNodeRep::ValueType
ValueType
Define the value types.
Definition ExprNodeRep.h:220
casacore::TableExprNodeSet
Definition ExprNodeSet.h:87
casacore
this file contains all the compiler specific defines
Definition mainpage.dox:28
casacore::uInt
unsigned int uInt
Definition aipstype.h:49
casacore::Int64
long long Int64
Define the extra non-standard types used by Casacore (like proposed uSize, Size).
Definition aipsxtype.h:36
casacore::TENShPtr
std::shared_ptr< TableExprNodeRep > TENShPtr
Definition ExprNodeRep.h:55
casacore::Int
int Int
Definition aipstype.h:48
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition aipstype.h:40