casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
LogFilterExpr.h
Go to the documentation of this file.
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: LogFilterExpr.h 20551 2009-03-25 00:11:33Z Malte.Marquarding $
00027 
00028 #ifndef TABLES_LOGFILTEREXPR_H
00029 #define TABLES_LOGFILTEREXPR_H
00030 
00031 
00032 //# Includes
00033 #include <tables/Tables/TableExprData.h>
00034 
00035 namespace casa { //# NAMESPACE CASA - BEGIN
00036 
00037 //# Forward Declarations
00038 class TableExprNode;
00039 class LogMessage;
00040 
00041 
00042 // <summary>
00043 // Class to deal with a TaQL expression to filter messages.
00044 // </summary>
00045 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos="">
00046 // </reviewed>
00047 
00048 // This program tests the class TableExprData.
00049 // This example shows how a data set consisting of two vectors
00050 // of scalars can be used.
00051 
00052 
00053 class LogFilterExpr : public TableExprData
00054 {
00055 public:
00056   // Construct it from an expression which gets parsed.
00057   LogFilterExpr (const String& expr);
00058 
00059   // Copy constructor (copy semantics).
00060   LogFilterExpr (const LogFilterExpr&);
00061 
00062   virtual ~LogFilterExpr();
00063 
00064   // Assignment (copy semantics).
00065   LogFilterExpr& operator= (const LogFilterExpr&);
00066 
00067   // Does this message match the expression?
00068   Bool matches (const LogMessage& message);
00069 
00070   // Get the data.
00071   // <group>
00072   virtual Double getDouble (const Block<Int>& fieldNrs) const;
00073   virtual String getString (const Block<Int>& fieldNrs) const;
00074   // </group>
00075 
00076   // Get the data type of the various values.
00077   virtual DataType dataType (const Block<Int>& fieldNrs) const;
00078 
00079 private:
00080   TableExprNode*    itsExpr;
00081   const LogMessage* itsMessage;
00082 };
00083 
00084 
00085 
00086 } //# NAMESPACE CASA - END
00087 
00088 #endif