OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ossimNmeaMessageSequencer Class Reference

#include <ossimNmeaMessageSequencer.h>

Public Member Functions

 ossimNmeaMessageSequencer ()
 
 ossimNmeaMessageSequencer (const ossimFilename &file)
 
 ossimNmeaMessageSequencer (const std::string &str)
 
 ~ossimNmeaMessageSequencer ()
 
void initialize (const ossimFilename &file)
 
void initialize (const std::string &str)
 
virtual bool next (ossimNmeaMessage &msg)
 
virtual void reset ()
 
virtual bool valid () const
 

Protected Member Functions

void destroy ()
 

Protected Attributes

std::istream * m_inputStream
 

Detailed Description

Definition at line 7 of file ossimNmeaMessageSequencer.h.

Constructor & Destructor Documentation

◆ ossimNmeaMessageSequencer() [1/3]

ossimNmeaMessageSequencer::ossimNmeaMessageSequencer ( )

Definition at line 5 of file ossimNmeaMessageSequencer.cpp.

7 {
8 
9 }

◆ ossimNmeaMessageSequencer() [2/3]

ossimNmeaMessageSequencer::ossimNmeaMessageSequencer ( const ossimFilename file)

Definition at line 11 of file ossimNmeaMessageSequencer.cpp.

References initialize().

12 :m_inputStream(0)
13 {
14  initialize(file);
15 }
void initialize(const ossimFilename &file)

◆ ossimNmeaMessageSequencer() [3/3]

ossimNmeaMessageSequencer::ossimNmeaMessageSequencer ( const std::string &  str)

Definition at line 17 of file ossimNmeaMessageSequencer.cpp.

References initialize().

18 :m_inputStream(0)
19 {
20  initialize(str);
21 }
void initialize(const ossimFilename &file)

◆ ~ossimNmeaMessageSequencer()

ossimNmeaMessageSequencer::~ossimNmeaMessageSequencer ( )

Definition at line 24 of file ossimNmeaMessageSequencer.cpp.

References destroy().

Member Function Documentation

◆ destroy()

void ossimNmeaMessageSequencer::destroy ( )
protected

Definition at line 41 of file ossimNmeaMessageSequencer.cpp.

References m_inputStream.

Referenced by initialize(), and ~ossimNmeaMessageSequencer().

42 {
43  if(m_inputStream)
44  {
45  delete m_inputStream;
46  m_inputStream = 0;
47  }
48 }

◆ initialize() [1/2]

void ossimNmeaMessageSequencer::initialize ( const ossimFilename file)

Definition at line 29 of file ossimNmeaMessageSequencer.cpp.

References ossimString::c_str(), destroy(), and m_inputStream.

Referenced by ossimNmeaMessageSequencer().

30 {
31  destroy();
32  m_inputStream = new std::ifstream(file.c_str());
33 }
std::basic_ifstream< char > ifstream
Class for char input file streams.
Definition: ossimIosFwd.h:44
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396

◆ initialize() [2/2]

void ossimNmeaMessageSequencer::initialize ( const std::string &  str)

Definition at line 35 of file ossimNmeaMessageSequencer.cpp.

References destroy(), and m_inputStream.

36 {
37  destroy();
39 }
std::basic_istringstream< char > istringstream
Class for char input memory streams.
Definition: ossimIosFwd.h:32

◆ next()

bool ossimNmeaMessageSequencer::next ( ossimNmeaMessage msg)
virtual

Definition at line 50 of file ossimNmeaMessageSequencer.cpp.

References m_inputStream, and ossimNmeaMessage::parseMessage().

51 {
52  bool result = false;
53 
54  try {
56  result = true;
57  }
58  catch (...)
59  {
60  result = false;
61  }
62 
63  return result;
64 }
virtual void parseMessage(std::istream &in)
Parses a standard formatted NMEA message.

◆ reset()

void ossimNmeaMessageSequencer::reset ( void  )
virtual

Definition at line 78 of file ossimNmeaMessageSequencer.cpp.

References m_inputStream.

79 {
80  if(m_inputStream)
81  {
82  m_inputStream->clear();
83  m_inputStream->seekg(0);
84  }
85 }

◆ valid()

bool ossimNmeaMessageSequencer::valid ( ) const
virtual

Definition at line 66 of file ossimNmeaMessageSequencer.cpp.

References m_inputStream.

67 {
68  bool result = false;
69 
70  if(m_inputStream)
71  {
72  result = m_inputStream->good();
73  }
74 
75  return result;
76 }

Member Data Documentation

◆ m_inputStream

std::istream* ossimNmeaMessageSequencer::m_inputStream
protected

Definition at line 25 of file ossimNmeaMessageSequencer.h.

Referenced by destroy(), initialize(), next(), reset(), and valid().


The documentation for this class was generated from the following files: