AshtechData.hpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 //==============================================================================
26 //
27 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
44 #ifndef ASHTECHDATA_HPP
45 #define ASHTECHDATA_HPP
46 
47 #include <map>
48 #include <iostream>
49 
50 #include "gnsstk_export.h"
51 #include "Exception.hpp"
52 #include "StringUtils.hpp"
53 #include "BinUtils.hpp"
54 
55 #include "FFData.hpp"
56 #include "FFStream.hpp"
57 #include "DataStatus.hpp"
58 
59 namespace gnsstk
60 {
61 
62  class AshtechStream;
63 
64  class AshtechData : public FFData, public CRCDataStatus
65  {
66  public:
67  AshtechData() noexcept : ascii(false), checksum(0) {}
68  // Returns whether or not this AshtechData is valid.
69  bool isValid() const {return good();}
70 
72  virtual bool isData() const {return true;}
73 
77  virtual std::string encode() const noexcept { return std::string(); }
78 
82  virtual void decode(const std::string& str)
83  {std::cout<<"AshtechData::decode()"<<std::endl;}
84 
86  virtual std::string getName() const {return "hdr";}
87 
89  virtual bool checkId(std::string hdrId) const {return false;}
90 
94  void dump(std::ostream& out) const noexcept;
95 
96  GNSSTK_EXPORT static int debugLevel;
97  GNSSTK_EXPORT static bool hexDump;
98 
99  std::string id;
100  bool ascii;
101 
102  // Note that this doesn't appear in the RID message. Also there is reason
103  // to believe it isn't trustworthy except in the PBN and MPC messages.
104  uint16_t checksum;
105 
106  GNSSTK_EXPORT static const std::string preamble;
107  GNSSTK_EXPORT static const std::string trailer;
108 
109  protected:
113  virtual void reallyPutRecord(FFStream& ffs) const
114  {
115  gnsstk::FFStreamError e("Writing of AshtecData is not supported.");
116  GNSSTK_THROW(e);
117  }
118 
124  virtual void reallyGetRecord(FFStream& ffs);
125 
130  virtual void readHeader(AshtechStream& stream);
131 
136  virtual void readBody(AshtechStream& stream);
137 
138  }; // class AshtechData
139 } // namespace gnsstk
140 
141 #endif
gnsstk::AshtechData::checksum
uint16_t checksum
Definition: AshtechData.hpp:104
gnsstk::CRCDataStatus
Definition: DataStatus.hpp:91
gnsstk::FFData
Definition: FFData.hpp:87
gnsstk::FFStream
Definition: FFStream.hpp:119
const
#define const
Definition: getopt.c:43
StringUtils.hpp
gnsstk::AshtechData::encode
virtual std::string encode() const noexcept
Definition: AshtechData.hpp:77
gnsstk::AshtechData::decode
virtual void decode(const std::string &str)
Definition: AshtechData.hpp:82
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::AshtechData::isValid
bool isValid() const
Definition: AshtechData.hpp:69
gnsstk::AshtechData::AshtechData
AshtechData() noexcept
Definition: AshtechData.hpp:67
gnsstk::AshtechData::dump
void dump(std::ostream &out) const noexcept
Definition: AshtechData.cpp:162
gnsstk::AshtechStream
Definition: AshtechStream.hpp:54
gnsstk::AshtechData::checkId
virtual bool checkId(std::string hdrId) const
Returns true when the provided id is valid for this message.
Definition: AshtechData.hpp:89
gnsstk::AshtechData::isData
virtual bool isData() const
This class is "data" so this function always returns "true".
Definition: AshtechData.hpp:72
gnsstk::DataStatus::good
bool good() const
Definition: DataStatus.hpp:63
gnsstk::AshtechData::readHeader
virtual void readHeader(AshtechStream &stream)
Definition: AshtechData.cpp:82
gnsstk::AshtechData::reallyGetRecord
virtual void reallyGetRecord(FFStream &ffs)
Definition: AshtechData.cpp:68
DataStatus.hpp
gnsstk::AshtechData::getName
virtual std::string getName() const
Simple accessors for various static thangs.
Definition: AshtechData.hpp:86
gnsstk::AshtechData::trailer
static const GNSSTK_EXPORT std::string trailer
Definition: AshtechData.hpp:107
gnsstk::AshtechData::preamble
static const GNSSTK_EXPORT std::string preamble
Definition: AshtechData.hpp:106
BinUtils.hpp
gnsstk::AshtechData::reallyPutRecord
virtual void reallyPutRecord(FFStream &ffs) const
Definition: AshtechData.hpp:113
gnsstk::AshtechData::debugLevel
static GNSSTK_EXPORT int debugLevel
Definition: AshtechData.hpp:96
Exception.hpp
gnsstk::AshtechData
Definition: AshtechData.hpp:64
GNSSTK_THROW
#define GNSSTK_THROW(exc)
Definition: Exception.hpp:366
FFStream.hpp
FFData.hpp
gnsstk::AshtechData::hexDump
static GNSSTK_EXPORT bool hexDump
Definition: AshtechData.hpp:97
gnsstk::AshtechData::id
std::string id
Definition: AshtechData.hpp:99
gnsstk::AshtechData::readBody
virtual void readBody(AshtechStream &stream)
Definition: AshtechData.cpp:123
gnsstk::AshtechData::ascii
bool ascii
Definition: AshtechData.hpp:100


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:38