AshtechData.hpp

Go to the documentation of this file.
00001 #pragma ident "$Id: AshtechData.hpp 861 2007-11-01 14:18:26Z ocibu $"
00002 
00003 //============================================================================
00004 //
00005 //  This file is part of GPSTk, the GPS Toolkit.
00006 //
00007 //  The GPSTk is free software; you can redistribute it and/or modify
00008 //  it under the terms of the GNU Lesser General Public License as published
00009 //  by the Free Software Foundation; either version 2.1 of the License, or
00010 //  any later version.
00011 //
00012 //  The GPSTk is distributed in the hope that it will be useful,
00013 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 //  GNU Lesser General Public License for more details.
00016 //
00017 //  You should have received a copy of the GNU Lesser General Public
00018 //  License along with GPSTk; if not, write to the Free Software Foundation,
00019 //  Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 //  
00021 //  Copyright 2004, The University of Texas at Austin
00022 //
00023 //============================================================================
00024 
00025 //============================================================================
00026 //
00027 //This software developed by Applied Research Laboratories at the University of
00028 //Texas at Austin, under contract to an agency or agencies within the U.S. 
00029 //Department of Defense. The U.S. Government retains all rights to use,
00030 //duplicate, distribute, disclose, or release this software. 
00031 //
00032 //Pursuant to DoD Directive 523024 
00033 //
00034 // DISTRIBUTION STATEMENT A: This software has been approved for public 
00035 //                           release, distribution is unlimited.
00036 //
00037 //=============================================================================
00038 
00039 #ifndef ASHTECHDATA_HPP
00040 #define ASHTECHDATA_HPP
00041 
00047 #include <map>
00048 #include <iostream>
00049 
00050 #include <Exception.hpp>
00051 #include <DayTime.hpp>
00052 #include <StringUtils.hpp>
00053 #include <BinUtils.hpp>
00054 
00055 #include <FFData.hpp>
00056 #include <FFStream.hpp>
00057 #include <DataStatus.hpp>
00058 
00059 namespace gpstk
00060 {
00061 
00062    class AshtechStream;
00063 
00064    class AshtechData : public FFData, public CRCDataStatus
00065    {
00066    public:
00067       AshtechData() throw() : checksum(0), ascii(false){}
00068 
00069       // Returns whether or not this AshtechData is valid.
00070       bool isValid() const {return good();}
00071 
00073       virtual bool isData() const {return true;}
00074 
00078       virtual std::string encode() const throw() { return std::string(); }
00079          
00083       virtual void decode(const std::string& str)
00084          throw(std::exception, FFStreamError)
00085       {std::cout<<"AshtechData::decode()"<<std::endl;}
00086 
00088       virtual std::string getName() const {return "hdr";}
00089 
00091       virtual bool checkId(std::string hdrId) const {return false;}
00092 
00096       void dump(std::ostream& out) const throw();
00097 
00098       static int debugLevel;
00099       static bool hexDump;
00100 
00101       std::string id;
00102       bool ascii;
00103 
00104       // Note that this doesn't appear in the RID message. Also there is reason
00105       // to believe it isn't trustworthy except in the PBN and MPC messages.
00106       uint16_t checksum;
00107 
00108       static const std::string preamble;
00109       static const std::string trailer;
00110 
00111    protected:
00112       virtual void reallyPutRecord(FFStream& ffs) const
00113          throw(std::exception, StringUtils::StringException, 
00114                FFStreamError)
00115       {
00116          gpstk::FFStreamError e("Writing of AshtecData is not supported.");
00117          GPSTK_THROW(e);
00118       }
00119 
00120       virtual void reallyGetRecord(FFStream& ffs)
00121          throw(std::exception, FFStreamError, EndOfFile);
00122 
00123       virtual void readHeader(AshtechStream& stream)
00124          throw(FFStreamError, EndOfFile);
00125 
00126       virtual void readBody(AshtechStream& stream)
00127          throw(FFStreamError, EndOfFile);
00128       
00129    }; // class AshtechData
00130 } // namespace gpstk
00131 
00132 #endif

Generated on Wed Feb 8 03:30:57 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1