SimpleFilter.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: SimpleFilter.hpp 1308 2008-07-22 20:01:04Z architest $"
00002 
00008 #ifndef SIMPLEFILTER_HPP
00009 #define SIMPLEFILTER_HPP
00010 
00011 //============================================================================
00012 //
00013 //  This file is part of GPSTk, the GPS Toolkit.
00014 //
00015 //  The GPSTk is free software; you can redistribute it and/or modify
00016 //  it under the terms of the GNU Lesser General Public License as published
00017 //  by the Free Software Foundation; either version 2.1 of the License, or
00018 //  any later version.
00019 //
00020 //  The GPSTk is distributed in the hope that it will be useful,
00021 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 //  GNU Lesser General Public License for more details.
00024 //
00025 //  You should have received a copy of the GNU Lesser General Public
00026 //  License along with GPSTk; if not, write to the Free Software Foundation,
00027 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00028 //
00029 //  Dagoberto Salazar - gAGE ( http://www.gage.es ). 2007, 2008
00030 //
00031 //============================================================================
00032 
00033 
00034 
00035 #include "ProcessingClass.hpp"
00036 
00037 
00038 namespace gpstk
00039 {
00040 
00043 
00044 
00090    class SimpleFilter : public ProcessingClass
00091    {
00092    public:
00093 
00095       SimpleFilter() : minLimit(15000000.0), maxLimit(30000000.0)
00096       { setFilteredType(TypeID::C1); setIndex(); };
00097 
00098 
00105       SimpleFilter( const TypeID& type,
00106                     const double& min,
00107                     const double& max )
00108          : minLimit(min), maxLimit(max)
00109       { setFilteredType(type); setIndex(); };
00110 
00111 
00116       SimpleFilter(const TypeID& type)
00117          : minLimit(15000000.0), maxLimit(30000000.0)
00118       { setFilteredType(type); setIndex(); };
00119 
00120 
00127       SimpleFilter( const TypeIDSet& typeSet,
00128                     const double& min,
00129                     const double& max )
00130          : filterTypeSet(typeSet), minLimit(min), maxLimit(max)
00131       { setIndex(); };
00132 
00133 
00138       SimpleFilter(const TypeIDSet& typeSet)
00139          : filterTypeSet(typeSet), minLimit(15000000.0), maxLimit(30000000.0)
00140       { setIndex(); };
00141 
00142 
00148       virtual satTypeValueMap& Process(satTypeValueMap& gData)
00149          throw(ProcessingException);
00150 
00151 
00155       virtual SimpleFilter& setMinLimit(const double& min)
00156       { minLimit = min; return (*this); };
00157 
00158 
00160       virtual double getMinLimit() const
00161       { return minLimit; };
00162 
00163 
00167       virtual SimpleFilter& setMaxLimit(const double& max)
00168       { maxLimit = max; return (*this); };
00169 
00170 
00172       virtual double getMaxLimit() const
00173       { return maxLimit; };
00174 
00175 
00179       virtual SimpleFilter& addFilteredType(const TypeID& type)
00180       { filterTypeSet.insert(type); return (*this); };
00181 
00182 
00187       virtual SimpleFilter& setFilteredType(const TypeID& type)
00188       { filterTypeSet.clear(); filterTypeSet.insert(type); return (*this); };
00189 
00190 
00195       virtual SimpleFilter& setFilteredType(const TypeIDSet& typeSet)
00196       { filterTypeSet.clear(); filterTypeSet = typeSet; return (*this); };
00197 
00198 
00200       virtual TypeIDSet getFilteredType() const
00201       { return filterTypeSet; };
00202 
00203 
00209       virtual gnssSatTypeValue& Process(gnssSatTypeValue& gData)
00210          throw(ProcessingException)
00211       { Process(gData.body); return gData; };
00212 
00213 
00214 
00219       virtual gnssRinex& Process(gnssRinex& gData)
00220          throw(ProcessingException)
00221       { Process(gData.body); return gData; };
00222 
00223 
00225       virtual int getIndex(void) const;
00226 
00227 
00229       virtual std::string getClassName(void) const;
00230 
00231 
00233       virtual ~SimpleFilter() {};
00234 
00235 
00236    protected:
00237 
00238 
00245       virtual bool checkValue(const double& value) const
00246       { return ( (value>=minLimit) && (value<=maxLimit) ); };
00247 
00248 
00250       TypeIDSet filterTypeSet;
00251 
00253       double minLimit;
00254 
00256       double maxLimit;
00257 
00258 
00259    private:
00260 
00261 
00263       static int classIndex;
00264 
00266       int index;
00267 
00269       void setIndex(void)
00270       { index = classIndex++; };
00271 
00272    }; // End of class 'SimpleFilter'
00273 
00275 
00276 }
00277 #endif  // SIMPLEFILTER_HPP

Generated on Tue May 22 03:31:01 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1