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

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)
 

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.

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

◆ BytePushAndPopFormatter()

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.

◆ ~BytePushAndPopFormatter()

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

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

Member Function Documentation

◆ operator()()

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

◆ operator<<

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

◆ push_and_pop_container

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.

◆ ready_to_format

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 Mon Feb 28 2022 22:18:43