00001 #pragma ident "$Id: AshtechData.hpp 861 2007-11-01 14:18:26Z ocibu $"
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
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
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
00105
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 };
00130 }
00131
00132 #endif