FFStream.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 
45 #ifndef GNSSTK_FFSTREAM_HPP
46 #define GNSSTK_FFSTREAM_HPP
47 
48 #include <iostream>
49 #include <fstream>
50 #include <string>
51 #include <typeinfo>
52 
53 #include "FFStreamError.hpp"
54 #include "FFData.hpp"
55 #include "StringUtils.hpp"
56 
57 namespace gnsstk
58 {
65 
67 
119  class FFStream : public std::fstream
120  {
121  public:
123  FFStream();
124 
126  virtual ~FFStream();
127 
133  FFStream( const char* fn, std::ios::openmode mode=std::ios::in );
134 
140  FFStream( const std::string& fn, std::ios::openmode mode=std::ios::in );
141 
146  virtual void open( const char* fn, std::ios::openmode mode );
147 
152  virtual void open( const std::string& fn, std::ios::openmode mode );
153 
155  void dumpState(std::ostream& s = std::cout) const;
156 
167  inline void conditionalThrow(void);
168 
170  static bool isFFStream(std::istream& i);
171 
173  FFStreamError mostRecentException;
174 
176  unsigned int recordNumber;
177 
179  std::string filename;
180 
182  friend class FFData;
183 
184 
185  protected:
186 
187 
193  virtual void tryFFStreamGet(FFData& rec);
194 
195 
201  virtual void tryFFStreamPut(const FFData& rec);
202 
203  private:
205  void init(const char* fn, std::ios::openmode mode);
206 
207  }; // End of class 'FFStream'
208 
210 
211 
212  void FFStream ::
214  {
215  if (exceptions() & std::fstream::failbit)
216  {
218  }
219  }
220 
221 } // End of namespace gnsstk
222 #endif // GNSSTK_FFSTREAM_HPP
gnsstk::FFData
Definition: FFData.hpp:87
gnsstk::FFStream::filename
std::string filename
file name
Definition: FFStream.hpp:179
gnsstk::FFStream::tryFFStreamPut
virtual void tryFFStreamPut(const FFData &rec)
Definition: FFStream.cpp:284
gnsstk::FFStream
Definition: FFStream.hpp:119
StringUtils.hpp
FFStreamError.hpp
gnsstk::FFStream::init
void init(const char *fn, std::ios::openmode mode)
Initialize internal data structures according to file name & mode.
Definition: FFStream.cpp:115
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::FFStream::recordNumber
unsigned int recordNumber
keeps track of the number of records read
Definition: FFStream.hpp:176
gnsstk::FFStream::open
virtual void open(const char *fn, std::ios::openmode mode)
Definition: FFStream.cpp:100
gnsstk::FFStream::mostRecentException
FFStreamError mostRecentException
This stores the most recently thrown exception.
Definition: FFStream.hpp:173
gnsstk::FFStream::isFFStream
static bool isFFStream(std::istream &i)
Check if the input stream is the kind of RinexObsStream.
Definition: FFStream.cpp:125
gnsstk::FFStream::FFStream
FFStream()
Default constructor, initialize internal data.
Definition: FFStream.cpp:49
gnsstk::FFStream::tryFFStreamGet
virtual void tryFFStreamGet(FFData &rec)
Definition: FFStream.cpp:162
GNSSTK_THROW
#define GNSSTK_THROW(exc)
Definition: Exception.hpp:366
example5.fn
string fn
Definition: example5.py:10
gnsstk::FFStream::dumpState
void dumpState(std::ostream &s=std::cout) const
A function to help debug FFStreams.
Definition: FFStream.cpp:141
FFData.hpp
gnsstk::FFStream::~FFStream
virtual ~FFStream()
Virtual destructor, close the stream etc.
Definition: FFStream.cpp:56
gnsstk::FFStream::conditionalThrow
void conditionalThrow(void)
Definition: FFStream.hpp:213


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