14 #ifndef ECL_CONTAINERS_PUSH_AND_POP_FORMATTERS_HPP_
15 #define ECL_CONTAINERS_PUSH_AND_POP_FORMATTERS_HPP_
26 #include "../common/formatters.hpp"
27 #include "../push_and_pop.hpp"
65 template<
typename Type,
size_t N>
69 virtual ~PushAndPopFormatter()
105 template<
typename Byte,
size_t N>
116 BytePushAndPopFormatter() : ready_to_format(
false)
127 push_and_pop_container = &push_and_pop;
128 ready_to_format =
true;
144 template <
typename OutputStream,
typename CharType,
size_t M>
145 friend OutputStream&
operator << (OutputStream& ostream,
const BytePushAndPopFormatter<CharType,M> &formatter);
149 bool ready_to_format;
156 template <
typename OutputStream,
typename CharType,
size_t M>
160 "either there is no data available, or you have tried to use the "
161 "formatter more than once in a single streaming operation. "
162 "C++ produces unspecified results when functors are used multiply "
163 "in the same stream sequence, so this is not permitted here.") );
167 for (
unsigned int i = 0; i < formatter.push_and_pop_container->size(); ++i ) {
168 ostream << format((*(formatter.push_and_pop_container))[i]) <<
" ";
190 class ECL_PUBLIC PushAndPopFormatter< unsigned char,N >
194 return formatter(container);