Class template to write to any write-able module in human-readable format.
More...
#include <console.hpp>
List of all members.
Public Types |
typedef Console< Writeable > &(* | ConsoleManipulator )(Console< Writeable > &) |
Public Member Functions |
| Console (Writeable &stream) |
| Constructor.
|
bool | write (const uint8_t *data, uint32_t size) |
| Write buffer to the console.
|
bool | write (const char *text) |
| Write text to the console.
|
bool | writeln (const char *text) |
| Write text to the console, append newline ('
') and flush the stream.
|
bool | write (bool value) |
| Write bool to the console ("true"/"false")
|
template<typename T > |
bool | write (T number) |
| Write integer number to the console.
|
bool | write (float number, uint8_t after_digits=3) |
| Write floating point to the console (wrapper for write_floating(..))
|
bool | write (double number, uint8_t after_digits=3) |
| Write floating point to the console (wrapper for write_floating(..))
|
template<typename T > |
bool | write_floating (T number, uint8_t after_digits=3) |
| Write floating point to the console.
|
void | flush () |
| Flushes the buffer of the console.
|
void | newline () |
| write newline character to stream
|
template<typename T > |
Console< Writeable > & | operator<< (const T &data) |
| operator to print like cout: console << "hello"; calls write(data)
|
Console< Writeable > & | operator<< (ConsoleManipulator manip) |
| applies the function pointed to by the argument and executes it with this as argument operator overload to work with endl function pointer
|
Writeable * | get_stream () |
| Returns a pointer to writeable.
|
Protected Attributes |
Writeable & | stream_ |
Detailed Description
template<typename Writeable>
class Console< Writeable >
Class template to write to any write-able module in human-readable format.
Member Function Documentation
template<typename Writeable >
Flushes the buffer of the console.
- Returns:
- success
template<typename Writeable >
Returns a pointer to writeable.
- Returns:
- writeable
template<typename Writeable >
write newline character to stream
- Returns:
- success
template<typename Writeable >
template<typename T >
Console< Writeable > & Console< Writeable >::operator<< |
( |
const T & |
data | ) |
|
operator to print like cout: console << "hello"; calls write(data)
- Parameters:
-
- Returns:
- success
template<typename Writeable >
Console< Writeable > & Console< Writeable >::operator<< |
( |
ConsoleManipulator |
manip | ) |
|
applies the function pointed to by the argument and executes it with this as argument operator overload to work with endl function pointer
- Parameters:
-
pointer | to the function to be executed |
- Returns:
- return itself (*this)
template<typename Writeable >
bool Console< Writeable >::write |
( |
const uint8_t * |
data, |
|
|
uint32_t |
size |
|
) |
| |
Write buffer to the console.
- Parameters:
-
data | The buffer to write. |
size | The number of bytes to write. |
- Returns:
- success
template<typename Writeable >
Write text to the console.
- Parameters:
-
text | Text to write to console |
- Returns:
- success
template<typename Writeable >
Write bool to the console ("true"/"false")
- Parameters:
-
value | boolean value to be evaluated |
- Returns:
- success
template<typename Writeable >
template<typename T >
Write integer number to the console.
- Parameters:
-
number | integer number (uintX_t/intX_t) |
- Returns:
- success
template<typename Writeable >
bool Console< Writeable >::write |
( |
float |
number, |
|
|
uint8_t |
after_digits = 3 |
|
) |
| |
Write floating point to the console (wrapper for write_floating(..))
- Parameters:
-
- Returns:
- success
- Parameters:
-
number | |
after_digits | digits after decimal point |
- Returns:
- success
template<typename Writeable >
bool Console< Writeable >::write |
( |
double |
number, |
|
|
uint8_t |
after_digits = 3 |
|
) |
| |
Write floating point to the console (wrapper for write_floating(..))
- Parameters:
-
number | |
after_digits | digits after decimal point |
- Returns:
- success
template<typename Writeable >
template<typename T >
Write floating point to the console.
- Parameters:
-
number | floating point number (float/double) |
after_digits | number of digits after decimal point |
- Returns:
- success
template<typename Writeable >
Write text to the console, append newline ('
') and flush the stream.
- Parameters:
-
text | Text to write to console |
- Returns:
- success
The documentation for this class was generated from the following files:
- /home/travis/build/lis-epfl/MAVRIC_Library/hal/common/console.hpp
- /home/travis/build/lis-epfl/MAVRIC_Library/hal/common/console.hxx