casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Searcher.h
Go to the documentation of this file.
00001 //# Copyright (C) 2004
00002 //# Associated Universities, Inc. Washington DC, USA.
00003 //#
00004 //# This library is free software; you can redistribute it and/or modify it
00005 //# under the terms of the GNU Library General Public License as published by
00006 //# the Free Software Foundation; either version 2 of the License, or (at your
00007 //# option) any later version.
00008 //#
00009 //# This library is distributed in the hope that it will be useful, but WITHOUT
00010 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012 //# License for more details.
00013 //#
00014 //# You should have received a copy of the GNU Library General Public License
00015 //# along with this library; if not, write to the Free Software Foundation,
00016 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00017 //#
00018 //# Correspondence concerning AIPS++ should be addressed as follows:
00019 //#        Internet email: aips2-request@nrao.edu.
00020 //#        Postal address: AIPS++ Project Office
00021 //#                        National Radio Astronomy Observatory
00022 //#                        520 Edgemont Road
00023 //#                        Charlottesville, VA 22903-2475 USA
00024 #ifndef SEARCHER_H_
00025 #define SEARCHER_H_
00026 
00027 #include <spectrallines/Splatalogue/SplatResult.h>
00028 #include <string>
00029 #include <vector>
00030 
00031 namespace casa {
00032 
00033 //Interface needed to support molecular line searching and identification.
00034 
00035 class Searcher {
00036 public:
00037         Searcher();
00038 
00039         //Set all search parameters back to their defaults.
00040         virtual void reset() = 0;
00041 
00042         //Returns whether or not a connection has been established to the database
00043         //provider.
00044         virtual bool isConnected() const = 0;
00045 
00046         //Provide a way to interrupt long searches.
00047         virtual void stopSearch() = 0;
00048 
00049         //Search Parameters
00050         virtual void setChemicalNames( const vector<string>& chemNames ) = 0;
00051         virtual void setSpeciesNames( const vector<string>& speciesNames ) = 0;
00052         virtual void setFrequencyRange( double minValue, double maxValue ) = 0;
00053         virtual void setIntensityRange( double minValue, double maxValue ) = 0;
00054         virtual void setSmu2Range( double minValue, double maxValue ) = 0;
00055         virtual void setLogaRange( double minValue, double maxValue ) = 0;
00056         virtual void setElRange( double minValue, double maxValue ) = 0;
00057         virtual void setEuRange( double minValue, double maxValue ) = 0;
00058         virtual void setQNS( const vector<string>& qns ) = 0;
00059 
00060 
00061         //Filters
00062         virtual void setFilterTop20( bool filter = true) = 0;
00063         virtual void setFilterPlanetaryAtmosphere( bool filter = true ) = 0;
00064         virtual void setFilterHotCores(bool filter = true) = 0;
00065         virtual void setFilterDarkClouds(bool filter = true) = 0;
00066         virtual void setFilterDiffuseClouds( bool filter = true) = 0;
00067         virtual void setFilterComets(bool filter = true) = 0;
00068         virtual void setFilterAgbPpnPn(bool filter = true) = 0;
00069         virtual void setFilterExtragalactic(bool filter = true) = 0;
00070 
00071         //Support for scolling
00072         virtual void setSearchResultLimit( int limit ) = 0;
00073 
00074         //Doing the search
00075         virtual vector<SplatResult> doSearch(string& errorMsg, int offset ) = 0;
00076         virtual long doSearchCount( string& errorMsg ) = 0;
00077 
00078         //Information about the database
00079         virtual string getCreatedDate() const = 0;
00080         virtual string tableInfo( const string& tableName, string& errorMessage ) const= 0;
00081 
00082         virtual ~Searcher();
00083 };
00084 
00085 } /* namespace casa */
00086 #endif /* SEARCHER_H_ */