Pruner.cpp

Go to the documentation of this file.
00001 #pragma ident "$Id: Pruner.cpp 1925 2009-05-31 16:43:02Z architest $"
00002 
00009 //============================================================================
00010 //
00011 //  This file is part of GPSTk, the GPS Toolkit.
00012 //
00013 //  The GPSTk is free software; you can redistribute it and/or modify
00014 //  it under the terms of the GNU Lesser General Public License as published
00015 //  by the Free Software Foundation; either version 2.1 of the License, or
00016 //  any later version.
00017 //
00018 //  The GPSTk is distributed in the hope that it will be useful,
00019 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00020 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021 //  GNU Lesser General Public License for more details.
00022 //
00023 //  You should have received a copy of the GNU Lesser General Public
00024 //  License along with GPSTk; if not, write to the Free Software Foundation,
00025 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00026 //
00027 //  Dagoberto Salazar - gAGE ( http://www.gage.es ). 2009
00028 //
00029 //============================================================================
00030 
00031 
00032 #include "Pruner.hpp"
00033 
00034 
00035 namespace gpstk
00036 {
00037 
00038       // Index initially assigned to this class
00039    int Pruner::classIndex = 8400000;
00040 
00041 
00042       // Returns an index identifying this object.
00043    int Pruner::getIndex() const
00044    { return index; }
00045 
00046 
00047       // Returns a string identifying this object.
00048    std::string Pruner::getClassName() const
00049    { return "Pruner"; }
00050 
00051 
00052 
00053       /* Prunes data from a satTypeValueMap object.
00054        *
00055        * @param gData     Data object holding the data.
00056        */
00057    satTypeValueMap& Pruner::Process( satTypeValueMap& gData )
00058       throw(ProcessingException)
00059    {
00060 
00061       try
00062       {
00063 
00064             // Call appropriate GDS method
00065          if( deleteTypeSet.size() > 0 )
00066          {
00067             gData.removeTypeID( deleteTypeSet );
00068          }
00069 
00070          return gData;
00071 
00072       }
00073       catch(Exception& u)
00074       {
00075             // Throw an exception if something unexpected happens
00076          ProcessingException e( getClassName() + ":"
00077                                 + StringUtils::asString( getIndex() ) + ":"
00078                                 + u.what() );
00079 
00080          GPSTK_THROW(e);
00081 
00082       }
00083 
00084    }  // End of method 'Pruner::Process()'
00085 
00086 
00087 
00088       /* Method to add a set of TypeIDs to be deleted.
00089        *
00090        * @param deleteSet     TypeIDSet of data values to be added to the
00091        *                      ones being deleted.
00092        */
00093    Pruner& Pruner::addTypeSet( const TypeIDSet& deleteSet )
00094    {
00095 
00096          // Iterate over 'deleteSet' and add its components to 'deleteTypeSet'
00097       for( TypeIDSet::const_iterator pos = deleteSet.begin();
00098            pos != deleteSet.end();
00099            ++pos )
00100       {
00101          deleteTypeSet.insert(*pos);
00102       }
00103 
00104       return (*this);
00105 
00106    }  // End of method 'Pruner::addTypeSet()'
00107 
00108 
00109 
00110 }  // End of namespace gpstk

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