|
LRAUV
revA
|
This is a very abstract class that can be implemented by classes that want to receive stream input. More...
#include <InStream.h>

Public Member Functions | |
| virtual | ~InStream () |
| Destructor. More... | |
| virtual InStream & | read (char *buffer, size_t num)=0 |
| reads num bytes from stream to the buffer More... | |
| virtual const char * | getName ()=0 |
| returns name of the stream More... | |
| virtual bool | isReadable ()=0 |
| indicates whether the stream can actually be read from. More... | |
| InStream & | readChar (signed char &value) |
| reads a single byte to the input buffer/stream More... | |
| InStream & | readCharHex (signed char &byte) |
| reads a single unsigned char from the input buffer/stream as 2 hex chars More... | |
| InStream & | readUCharHex (unsigned char &byte) |
| reads a single unsigned char from the input buffer/stream as 2 hex chars More... | |
| virtual InStream & | readLine (char *buf, unsigned int bufsize) |
| InStream & | readShort (short &value) |
| reads a single short from the input buffer/stream More... | |
| InStream & | readShort (unsigned short &value) |
| reads a single short from the input buffer/stream More... | |
| InStream & | readShortHex (short &word) |
| reads a single short from the input buffer/stream as 4 hex chars More... | |
| InStream & | readUShortHex (unsigned short &value) |
| reads a single unsigned short from the input buffer/stream as 4 hex chars More... | |
| InStream & | readUShortCompact (unsigned short &value) |
| reads an unsigned short integer as 1 to 3 bytes, encoded as follows: xxxxxxx0 - 7 bit value, encoded in 1 byte xxxxxx01+1byte - 14 bit value, encoded in 2 bytes xxxxx011+2bytes - 16 bit value, encoded in 3 bytes More... | |
| InStream & | readInt24 (int &medInt) |
| reads a 3-byte integer to the input buffer/stream only works on little-endian machines! More... | |
| InStream & | readInt (int &value) |
| reads a 4-byte integer to the input buffer/stream More... | |
| InStream & | readLongLong (long long &value) |
| reads a 8-byte integer to the input buffer/stream More... | |
| InStream & | readLongLongCompact (long long &value) |
| reads a signed long long integer as 1 to 9 bytes, encoded as follows: 0xxxxxxx - 7 bit value, encoded in 1 byte 10xxxxxx+1byte - 14 bit value, encoded in 2 bytes 110xxxxx+2bytes - 21 bit value, encoded in 3 bytes 1110xxxx+3bytes - 28 bit value, encoded in 4 bytes 11110xxx+4bytes - 35 bit value, encoded in 5 bytes 111110xx+5bytes - 42 bit value, encoded in 6 bytes 1111110x+6bytes - 49 bit value, encoded in 7 bytes 11111110+7bytes - 56 bit value, encoded in 8 bytes 11111111+8bytes - 64 bit value, encoded in 9 bytes More... | |
| InStream & | readFloat (float &value) |
| reads a 4-byte float to the input buffer/stream More... | |
| InStream & | readFloat2 (float &value) |
| reads a 2-byte float to the input buffer/stream More... | |
| InStream & | readFloat3 (float &value) |
| reads a 3-byte float to the input buffer/stream More... | |
| InStream & | readDouble (double &value) |
| reads a 8-byte double to the input buffer/stream More... | |
| virtual InStream & | readUntil (char *buf, unsigned int num, unsigned char match) |
| virtual bool | eof ()=0 |
| Indicates if the end of file has been reached. More... | |
| size_t | bytesRead () |
| Indicates the number of bytes read in the last operation. More... | |
| size_t | getBytesRead () |
| Indicates the number of bytes read in the last operation. More... | |
| size_t | getTotalBytesRead () |
| Indicates the total number of bytes read;. More... | |
Protected Member Functions | |
| InStream () | |
| Protected Constructor for abstract class. More... | |
| void | zeroBytesRead () |
| void | incBytesRead () |
| void | incBytesRead (size_t incRead) |
| void | setBytesRead (size_t lastRead) |
| void | zeroTotalBytesRead () |
Private Member Functions | |
| InStream (const InStream &old) | |
Private Attributes | |
| size_t | lastRead_ |
| size_t | totalBytesRead_ |
This is a very abstract class that can be implemented by classes that want to receive stream input.
Provides basic input functions such as read(), as well as specialized functions for reading in data formats such as readCharHex, etc.
Part of an attempt to avoid the standard template library
|
inlinevirtual |
Destructor.
|
inlineprotected |
Protected Constructor for abstract class.
|
private |
|
inline |
Indicates the number of bytes read in the last operation.
References lastRead_.
Referenced by MtxIOStream::append(), CommandLine::commandIbitMcp3553(), UartStream::fillInBuffer(), MissionManager::LogMission(), MissionStateLogger::NewResume(), MtxIOStream::read(), DeviceIOStream::read(), CodedStr::Read(), SyslogEntry::Read(), DirectoryEntry::Read(), DataEntry::Read(), ElementURI::Read(), DataAccess::Read(), UartStream::read(), EventEntry::Read(), AHRS_sp3003D::readAccelVecBin(), AnalogToDigital::readCounts(), LoadControl::readFaults(), readLine(), readLongLongCompact(), AHRS_sp3003D::readMagneticsBin(), readUntil(), readUShortCompact(), Turbulence_NPS::receive(), CTD_NeilBrown::receive(), PNI_TCM::receiveGetDataResp(), AHRS_sp3003D::receiveHeadingMagBin(), AHRS_sp3003D::receivePitchRollBin(), LoadControl::requestVoltageAndCurrent(), WetLabsBB2FL::runnable(), NAL9602::sendingFillBuffer(), WetLabsBB2FL::starting(), PNI_TCM::starting(), MappedIOStream_Test::test2Read(), StrIOStream_Test::testRead(), and StrIOStream_Test::testReadUntil().
|
pure virtual |
Indicates if the end of file has been reached.
Implemented in NullInStream, UartStream, StrIOStream, NullIOStream, FileInStream, FileIOStream, DeviceIOStream, and MappedIOStream.
Referenced by BinaryLogReader::read(), LogEntry::Read(), SyslogEntry::Read(), EventEntry::Read(), readLine(), and LogEntry::ReadTimestamp().
|
inline |
Indicates the number of bytes read in the last operation.
References lastRead_.
Referenced by UartStream::read(), UartStream::readLines(), UartStream::readUntil(), and NAL9602::retrieveAndQueueIncoming().
|
pure virtual |
returns name of the stream
Implemented in UartStream, FileInStream, FileIOStream, DeviceIOStream, StrIOStream, and MappedIOStream.
Referenced by DirectoryEntry::Read().
|
inline |
Indicates the total number of bytes read;.
References totalBytesRead_.
Referenced by DirectoryEntry::Read(), and DataEntry::Read().
|
inlineprotected |
References lastRead_, and totalBytesRead_.
Referenced by UartStream::flush(), UartStream::flushCRLF(), UartStream::read(), UartStream::readLines(), and UartStream::readUntil().
|
inlineprotected |
References lastRead_, and totalBytesRead_.
|
pure virtual |
indicates whether the stream can actually be read from.
Implemented in NullInStream, UartStream, StrIOStream, FileInStream, FileIOStream, NullIOStream, MappedIOStream, and DeviceIOStream.
Referenced by LogReader::isValid().
|
pure virtual |
reads num bytes from stream to the buffer
Implemented in UartStream, FileIOStream, FileInStream, DeviceIOStream, MappedIOStream, and StrIOStream.
Referenced by CodedStr::Read(), SyslogEntry::Read(), DataEntry::Read(), ElementURI::Read(), DataAccess::Read(), EventEntry::Read(), readChar(), readCharHex(), readDouble(), readFloat(), readFloat2(), readFloat3(), readInt(), readInt24(), readLine(), readLongLong(), readLongLongCompact(), readShort(), readShortHex(), readUCharHex(), readUntil(), readUShortCompact(), and readUShortHex().
|
inline |
reads a single byte to the input buffer/stream
References read().
Referenced by MissionStateLogger::NewResume(), DirectoryEntry::Read(), EventEntry::Read(), readLongLongCompact(), and readUShortCompact().
| InStream & InStream::readCharHex | ( | signed char & | byte | ) |
reads a single unsigned char from the input buffer/stream as 2 hex chars
reads a single unsigned char to the input buffer/stream as 2 hex chars
References read().
Referenced by ElementURI::Read(), and DataAccess::Read().
|
inline |
reads a 8-byte double to the input buffer/stream
References read().
|
inline |
reads a 4-byte float to the input buffer/stream
References read().
Referenced by MissionStateLogger::NewResume(), and MtxIOStream::read().
|
inline |
reads a 2-byte float to the input buffer/stream
References read().
|
inline |
reads a 3-byte float to the input buffer/stream
References read().
|
inline |
reads a 4-byte integer to the input buffer/stream
References read().
Referenced by MtxIOStream::append(), MissionStateLogger::NewResume(), and MtxIOStream::read().
|
inline |
reads a 3-byte integer to the input buffer/stream only works on little-endian machines!
References read().
Referenced by EventEntry::Read().
|
virtual |
References bytesRead(), eof(), lastRead_, and read().
|
inline |
reads a 8-byte integer to the input buffer/stream
References read().
| InStream & InStream::readLongLongCompact | ( | long long & | value | ) |
reads a signed long long integer as 1 to 9 bytes, encoded as follows: 0xxxxxxx - 7 bit value, encoded in 1 byte 10xxxxxx+1byte - 14 bit value, encoded in 2 bytes 110xxxxx+2bytes - 21 bit value, encoded in 3 bytes 1110xxxx+3bytes - 28 bit value, encoded in 4 bytes 11110xxx+4bytes - 35 bit value, encoded in 5 bytes 111110xx+5bytes - 42 bit value, encoded in 6 bytes 1111110x+6bytes - 49 bit value, encoded in 7 bytes 11111110+7bytes - 56 bit value, encoded in 8 bytes 11111111+8bytes - 64 bit value, encoded in 9 bytes
reads a signed long long integer as 1 to 9 bytes, encoded as follows: xxxxxxx0 - 7 bit value, encoded in 1 byte xxxxxx01+1byte - 14 bit value, encoded in 2 bytes xxxxx011+2bytes - 21 bit value, encoded in 3 bytes xxxx0111+3bytes - 28 bit value, encoded in 4 bytes xxx01111+4bytes - 35 bit value, encoded in 5 bytes xx011111+5bytes - 42 bit value, encoded in 6 bytes x0111111+6bytes - 49 bit value, encoded in 7 bytes 01111111+7bytes - 56 bit value, encoded in 8 bytes 11111111+8bytes - 64 bit value, encoded in 9 bytes
References bytesRead(), lastRead_, read(), and readChar().
Referenced by LogEntry::ReadTimestamp(), and StrIOStream_Test::testLongLongCompact().
|
inline |
reads a single short from the input buffer/stream
References read().
Referenced by MissionStateLogger::NewResume(), and DataEntry::Read().
|
inline |
reads a single short from the input buffer/stream
References read().
| InStream & InStream::readShortHex | ( | short & | word | ) |
reads a single short from the input buffer/stream as 4 hex chars
reads a single short to the input buffer/stream as 4 hex chars
References read().
Referenced by CodedStr::Read(), DirectoryEntry::Read(), ElementURI::Read(), and DataAccess::Read().
| InStream & InStream::readUCharHex | ( | unsigned char & | byte | ) |
reads a single unsigned char from the input buffer/stream as 2 hex chars
References read().
Referenced by ElementURI::Read(), and DataAccess::Read().
|
virtual |
References bytesRead(), lastRead_, and read().
Referenced by CodedStr::Read(), ElementURI::Read(), DataAccess::Read(), and StrIOStream_Test::testReadUntil().
| InStream & InStream::readUShortCompact | ( | unsigned short & | value | ) |
reads an unsigned short integer as 1 to 3 bytes, encoded as follows: xxxxxxx0 - 7 bit value, encoded in 1 byte xxxxxx01+1byte - 14 bit value, encoded in 2 bytes xxxxx011+2bytes - 16 bit value, encoded in 3 bytes
References bytesRead(), lastRead_, read(), and readChar().
Referenced by LogEntry::Read(), SyslogEntry::Read(), and EventEntry::Read().
| InStream & InStream::readUShortHex | ( | unsigned short & | value | ) |
reads a single unsigned short from the input buffer/stream as 4 hex chars
reads a single unsigned short to the input buffer/stream as 4 hex chars
References read().
Referenced by ElementURI::Read().
|
inlineprotected |
References lastRead_, and totalBytesRead_.
Referenced by StrIOStream::read(), MappedIOStream::read(), DeviceIOStream::read(), FileInStream::read(), and FileIOStream::read().
|
inlineprotected |
References lastRead_.
Referenced by UartStream::flush(), UartStream::read(), UartStream::readLines(), UartStream::readUntil(), and zeroTotalBytesRead().
|
inlineprotected |
References totalBytesRead_, and zeroBytesRead().
Referenced by FileInStream::setFile().
|
private |
Referenced by bytesRead(), getBytesRead(), incBytesRead(), readLine(), readLongLongCompact(), readUntil(), readUShortCompact(), setBytesRead(), and zeroBytesRead().
|
private |
Referenced by getTotalBytesRead(), incBytesRead(), setBytesRead(), and zeroTotalBytesRead().