25#ifndef _COMM_BUFFERS_H__
26#define _COMM_BUFFERS_H__
34typedef unsigned __int8 uint8_t;
43 void Put(
const std::string line);
49 bool Get(std::string& line);
52 std::deque<std::string> m_buffer;
68 LineBuffer() : m_line_count(0), m_last_ch(
'\n') {}
71 std::vector<uint8_t> m_buff;
94 std::deque<std::string> m_lines;
95 std::vector<uint8_t> m_line;
96 enum class State { PrefixWait, Data, CsDigit1, CsDigit2 } m_state;
Assembles input characters to lines.
void Put(uint8_t ch)
Add a single character.
std::vector< uint8_t > GetLine()
Retrieve a line from buffer, return empty line if none available.
bool HasLine() const
Return true if a line is available to be returned by GetLine().
Assemble characters to NMEA0183 sentences.
bool HasSentence() const
Return true if a sentence is available to be returned by GetSentence()
std::string GetSentence()
Retrieve a sentence from buffer.
void Put(uint8_t ch)
Add a single character, possibly making a sentence available.
Synchronized buffer for outbound, line oriented data.
void Put(const std::string line)
Insert line in buffer.
bool Get(std::string &line)
Retrieve a line in buffer.