This CStdOutStream derived class allow printing to standard out, normally the console text output.
Please notice CStdOutStream's are binary streams, so "char *" data types only should be used if textual outputs are desired.
- See also
- CStream
Definition at line 29 of file CStdOutStream.h.
|
| CStdOutStream () |
| Constructor. More...
|
|
virtual | ~CStdOutStream () |
| Destructor. More...
|
|
uint64_t | Seek (uint64_t Offset, CStdOutStream::TSeekOrigin Origin=sFromBeginning) |
| It has no efect in this class. More...
|
|
uint64_t | getTotalBytesCount () |
| It has no efect in this class. More...
|
|
uint64_t | getPosition () |
| It has no efect in this class. More...
|
|
size_t | ReadBuffer (void *Buffer, size_t Count) |
| Reads a block of bytes from the stream into Buffer - Exceptions
-
std::exception | On any error, or if ZERO bytes are read. |
More...
|
|
template<typename T > |
size_t | ReadBufferFixEndianness (T *ptr, size_t ElementCount) |
| Reads a sequence of elemental datatypes, taking care of reordering their bytes from the MRPT stream standard (little endianness) to the format of the running architecture. More...
|
|
virtual size_t | ReadBufferImmediate (void *Buffer, size_t Count) |
| Reads a block of bytes from the stream into Buffer, and returns the amound of bytes actually read, without waiting for more extra bytes to arrive (just those already enqued in the stream). More...
|
|
void | WriteBuffer (const void *Buffer, size_t Count) |
| Writes a block of bytes to the stream from Buffer. More...
|
|
template<typename T > |
void | WriteBufferFixEndianness (const T *ptr, size_t ElementCount) |
| Writes a sequence of elemental datatypes, taking care of reordering their bytes from the running architecture to MRPT stream standard (little endianness). More...
|
|
size_t | CopyFrom (mrpt::utils::CStream *Source, size_t Count) |
| Copies a specified number of bytes from one stream to another. More...
|
|
void | WriteObject (const CSerializable *o) |
| Writes an object to the stream. More...
|
|
CSerializablePtr | ReadObject () |
| Reads an object from stream, its class determined at runtime, and returns a smart pointer to the object. More...
|
|
void | ReadObject (CSerializable *existingObj) |
| Reads an object from stream, where its class must be the same as the supplied object, where the loaded object will be stored in. More...
|
|
CStream & | operator<< (const CSerializablePtr &pObj) |
| Write an object to a stream in the binary MRPT format. More...
|
|
CStream & | operator<< (const CSerializable &obj) |
| Write an object to a stream in the binary MRPT format. More...
|
|
CStream & | operator>> (CSerializablePtr &pObj) |
|
CStream & | operator>> (CSerializable &obj) |
|
virtual int | printf (const char *fmt,...) MRPT_printf_format_check(2 |
| Writes a string to the stream in a textual form. More...
|
|
template<typename T > |
virtual int void | printf_vector (const char *fmt, const std::vector< T > &V) |
| Prints a vector in the format [A,B,C,...] using CStream::printf, and the fmt string for each vector element. More...
|
|
void | sendMessage (const utils::CMessage &msg) |
| Send a message to the device. More...
|
|
bool | receiveMessage (utils::CMessage &msg) |
| Tries to receive a message from the device. More...
|
|
bool | getline (std::string &out_str) |
| Reads from the stream until a '
' character is found ('' characters are ignored). More...
|
|
virtual size_t mrpt::utils::CStream::ReadBufferImmediate |
( |
void * |
Buffer, |
|
|
size_t |
Count |
|
) |
| |
|
inlinevirtualinherited |
Reads a block of bytes from the stream into Buffer, and returns the amound of bytes actually read, without waiting for more extra bytes to arrive (just those already enqued in the stream).
Note that this method will fallback to ReadBuffer() in most CStream classes but in some hardware-related classes.
- Exceptions
-
std::exception | On any error, or if ZERO bytes are read. |
Reimplemented in mrpt::hwdrivers::CInterfaceFTDI.
Definition at line 113 of file CStream.h.
Send a message to the device.
Note that only the low byte from the "type" field will be used.
For frames of size < 255 the frame format is an array of bytes in this order:
<START_FLAG> <HEADER> <LENGTH> <BODY> <END_FLAG>
<START_FLAG> = 0x69
<HEADER> = A header byte
<LENGHT> = Number of bytes of BODY
<BODY> = N x bytes
<END_FLAG> = 0X96
Total length = <LENGTH> + 4
For frames of size > 255 the frame format is an array of bytes in this order:
<START_FLAG> <HEADER> <HIBYTE(LENGTH)> <LOBYTE(LENGTH)> <BODY> <END_FLAG>
<START_FLAG> = 0x79
<HEADER> = A header byte
<LENGHT> = Number of bytes of BODY
<BODY> = N x bytes
<END_FLAG> = 0X96
Total length = <LENGTH> + 5
- Exceptions
-
std::exception | On communication errors |