NetworkObsStreams.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: $"
00002 
00008 #ifndef GPSTK_NETWORK_OBS_STREAMS_HPP
00009 #define GPSTK_NETWORK_OBS_STREAMS_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 //  Wei Yan - Chinese Academy of Sciences . 2009, 2010, 2011
00030 //
00031 //============================================================================
00032 
00033 #include <iostream>
00034 #include <string>
00035 #include <list>
00036 #include <map>
00037 #include "RinexObsStream.hpp"
00038 #include "DataStructures.hpp"
00039 #include "Synchronize.hpp"
00040 
00041 namespace gpstk
00042 {
00043 
00046 
00047       
00086    class NetworkObsStreams
00087    {
00088    public:
00090       NetworkObsStreams() : synchronizeException(false)
00091       {}
00092 
00094       virtual ~NetworkObsStreams()
00095       { cleanUp(); }
00096          
00099       bool addRinexObsFile(const std::string& obsFile);
00100 
00105       void setReferenceSource(const SourceID& refSource)
00106       { referenceSource = refSource; }
00107 
00108 
00109       void setSynchronizeException(const bool& synException = true)
00110       { synchronizeException = synException; }
00111 
00115       bool readEpochData(gnssDataMap& gdsMap)
00116          throw(SynchronizeException);
00117          
00119       SourceID sourceIDOfRinexObsFile(std::string obsFile);
00120 
00121       RinexObsStream* getRinexObsStream(const SourceID& source)
00122       { return mapSourceStream[source]; }
00123 
00124    protected:
00125 
00127       struct ObsData
00128       {
00129          std::string obsFile;
00130          
00131          SourceID obsSource;
00132 
00133          Synchronize* pSynchro;
00134          RinexObsStream* pObsStream;
00135       };
00136 
00138       std::list<ObsData> allStreamData;
00139 
00141       std::map<SourceID, RinexObsStream*> mapSourceStream;
00142 
00144       std::map<SourceID, Synchronize*> mapSourceSynchro;
00145      
00147       SourceID referenceSource;
00148          
00150       bool synchronizeException;
00151 
00152    private:
00153          // Do some clean operation 
00154       virtual void cleanUp();
00155 
00156    }; // End of class 'NetworkObsStreams'
00157 
00159 
00160 
00161 }  // End of namespace gpstk
00162 
00163 #endif   // NetworkObsStreams
00164 

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