Parent template for the byte push and pop formatters. More...
#include <formatters.hpp>
Public Member Functions | |
BytePushAndPopFormatter () | |
BytePushAndPopFormatter< Byte, N > & | operator() (const ecl::PushAndPop< Byte, N > &push_and_pop) |
virtual | ~BytePushAndPopFormatter () |
Private Attributes | |
const ecl::PushAndPop< Byte, N > * | push_and_pop_container |
bool | ready_to_format |
Friends | |
template<typename OutputStream , typename CharType , size_t M> | |
OutputStream & | operator<< (OutputStream &ostream, const BytePushAndPopFormatter< CharType, M > &formatter) ecl_assert_throw_decl(StandardException) |
Parent template for the byte push and pop formatters.
We dont accept arguments for this class, it is simply designed to present byte arrays in hex format byte by byte. If you want specialised formatting, iterate over it with the Format<char> (or signed/unsigned char) class.
Do not use this class directly, rather call it via either the PushAndPop or Format classes explicitly. This makes the code more readable. e.g.
PushAndPop<unsigned char>::Formatter format_array_1;
Format< PushAndPop<unsigned char,4> > format_array_2; // same thing
Byte | : byte type, signed char/char/unsigned char. |
N | : the size of the container to be formatted. |
Definition at line 106 of file push_and_pop/formatters.hpp.
ecl::formatters::BytePushAndPopFormatter< Byte, N >::BytePushAndPopFormatter | ( | ) | [inline] |
Default constructor that simply sets up the formatter for use. There is only one formatting style for this - a byte by byte view of the array in hex format, so we don't accept any arguments. If you want specialised formatting for your array, iterate it element by element with the Format<signed char> class.
Definition at line 116 of file push_and_pop/formatters.hpp.
virtual ecl::formatters::BytePushAndPopFormatter< Byte, N >::~BytePushAndPopFormatter | ( | ) | [inline, virtual] |
Definition at line 132 of file push_and_pop/formatters.hpp.
BytePushAndPopFormatter<Byte,N>& ecl::formatters::BytePushAndPopFormatter< Byte, N >::operator() | ( | const ecl::PushAndPop< Byte, N > & | push_and_pop | ) | [inline] |
The format operator. Use this when inserting into a stream. It returns a template on which the stream will perform the formatting to create the requested output.
array | : the array to format. |
Definition at line 125 of file push_and_pop/formatters.hpp.
OutputStream& operator<< | ( | OutputStream & | ostream, |
const BytePushAndPopFormatter< CharType, M > & | formatter | ||
) | [friend] |
Insertion operator for sending the formatter (for character arrays) to an output stream.
OutputStream | : the type of the output stream to be inserted into. |
M | : the size of the container to be formatted. |
ostream | : the output stream. |
formatter | : the formatter to be inserted. |
StandardException | : throws if the formatter is used multiply in one stream operation [debug mode only]. |
Definition at line 157 of file push_and_pop/formatters.hpp.
const ecl::PushAndPop<Byte,N>* ecl::formatters::BytePushAndPopFormatter< Byte, N >::push_and_pop_container [private] |
Definition at line 148 of file push_and_pop/formatters.hpp.
bool ecl::formatters::BytePushAndPopFormatter< Byte, N >::ready_to_format [private] |
Definition at line 149 of file push_and_pop/formatters.hpp.