Public Member Functions | Private Attributes | Friends
ecl::formatters::BytePushAndPopFormatter< Byte, N > Class Template Reference

Parent template for the byte push and pop formatters. More...

#include <formatters.hpp>

List of all members.

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)

Detailed Description

template<typename Byte, size_t N>
class ecl::formatters::BytePushAndPopFormatter< Byte, N >

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
Template Parameters:
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.


Constructor & Destructor Documentation

template<typename Byte, size_t N>
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.

template<typename Byte, size_t N>
virtual ecl::formatters::BytePushAndPopFormatter< Byte, N >::~BytePushAndPopFormatter ( ) [inline, virtual]

Definition at line 132 of file push_and_pop/formatters.hpp.


Member Function Documentation

template<typename Byte, size_t N>
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.

Parameters:
array: the array to format.
Returns:
Format<PushAndPop<signed char,N>>& : this formatter readied for use by a stream.

Definition at line 125 of file push_and_pop/formatters.hpp.


Friends And Related Function Documentation

template<typename Byte, size_t N>
template<typename OutputStream , typename CharType , size_t M>
OutputStream& operator<< ( OutputStream &  ostream,
const BytePushAndPopFormatter< CharType, M > &  formatter 
) [friend]

Insertion operator for sending the formatter (for character arrays) to an output stream.

Template Parameters:
OutputStream: the type of the output stream to be inserted into.
M: the size of the container to be formatted.
Parameters:
ostream: the output stream.
formatter: the formatter to be inserted.
Returns:
OutputStream : continue streaming with the updated output stream.
Exceptions:
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.


Member Data Documentation

template<typename Byte, size_t N>
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.

template<typename Byte, size_t N>
bool ecl::formatters::BytePushAndPopFormatter< Byte, N >::ready_to_format [private]

Definition at line 149 of file push_and_pop/formatters.hpp.


The documentation for this class was generated from the following file:


ecl_containers
Author(s): Daniel Stonier
autogenerated on Sun Oct 5 2014 23:35:46