00001 //# LogFilterExpr.h: Class to deal with a TaQL expression to filter messages 00002 //# Copyright (C) 2000 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This program is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU General Public License as published by the Free 00007 //# Software Foundation; either version 2 of the License, or (at your option) 00008 //# any later version. 00009 //# 00010 //# This program is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 00013 //# more details. 00014 //# 00015 //# You should have received a copy of the GNU General Public License along 00016 //# with this program; if not, write to the Free Software Foundation, Inc., 00017 //# 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be addressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# $Id$ 00027 00028 #ifndef TABLES_LOGFILTEREXPR_H 00029 #define TABLES_LOGFILTEREXPR_H 00030 00031 00032 //# Includes 00033 #include <casacore/casa/aips.h> 00034 #include <casacore/tables/TaQL/TableExprData.h> 00035 00036 namespace casacore { //# NAMESPACE CASACORE - BEGIN 00037 00038 //# Forward Declarations 00039 class TableExprNode; 00040 class LogMessage; 00041 00042 00043 // <summary> 00044 // Class to deal with a TaQL expression to filter messages. 00045 // </summary> 00046 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos=""> 00047 // </reviewed> 00048 00049 // This program tests the class TableExprData. 00050 // This example shows how a data set consisting of two vectors 00051 // of scalars can be used. 00052 00053 00054 class LogFilterExpr : public TableExprData 00055 { 00056 public: 00057 // Construct it from an expression which gets parsed. 00058 LogFilterExpr (const String& expr); 00059 00060 // Copy constructor (copy semantics). 00061 LogFilterExpr (const LogFilterExpr&); 00062 00063 virtual ~LogFilterExpr(); 00064 00065 // Assignment (copy semantics). 00066 LogFilterExpr& operator= (const LogFilterExpr&); 00067 00068 // Does this message match the expression? 00069 Bool matches (const LogMessage& message); 00070 00071 // Get the data. 00072 // <group> 00073 virtual Double getDouble (const Block<Int>& fieldNrs) const; 00074 virtual String getString (const Block<Int>& fieldNrs) const; 00075 // </group> 00076 00077 // Get the data type of the various values. 00078 virtual DataType dataType (const Block<Int>& fieldNrs) const; 00079 00080 private: 00081 TableExprNode* itsExpr; 00082 const LogMessage* itsMessage; 00083 }; 00084 00085 00086 00087 } //# NAMESPACE CASACORE - END 00088 00089 #endif