12 #ifndef ECL_CONTAINERS_ARRAY_FORMATTERS_HPP_ 13 #define ECL_CONTAINERS_ARRAY_FORMATTERS_HPP_ 20 #include <ecl/config/macros.hpp> 21 #include <ecl/formatters/common.hpp> 22 #include <ecl/formatters/number.hpp> 23 #include <ecl/formatters/floats.hpp> 24 #include "../common/formatters.hpp" 25 #include "../array.hpp" 63 template<
typename Type,
size_t N>
67 virtual ~ArrayFormatter()
106 template<
typename Byte,
size_t N>
117 ByteArrayFormatter() : ready_to_format(false)
126 ByteArrayFormatter<Byte,N>& operator()(
const Array<Byte,N> &array)
128 begin_iterator = array.
begin();
129 end_iterator = array.
end();
130 ready_to_format =
true;
140 ByteArrayFormatter<Byte,N>& operator()(
const Stencil<
Array<Byte,N> > &stencil)
142 begin_iterator = stencil.begin();
143 end_iterator = stencil.end();
144 ready_to_format =
true;
163 begin_iterator = begin_iter;
164 end_iterator = end_iter;
165 ready_to_format =
true;
169 virtual ~ByteArrayFormatter()
181 template <
typename OutputStream,
typename CharType,
size_t M>
182 friend OutputStream& operator << (OutputStream& ostream, const ByteArrayFormatter<CharType,M> &formatter)
ecl_assert_throw_decl(StandardException);
187 bool ready_to_format;
194 template <
typename OutputStream,
typename CharType,
size_t M>
195 OutputStream& operator <<(OutputStream& ostream, const ByteArrayFormatter<CharType, M> &formatter)
199 "either there is no data available, or you have tried to use the " 200 "formatter more than once in a single streaming operation. " 201 "C++ produces unspecified results when functors are used multiply " 202 "in the same stream sequence, so this is not permitted here.") );
207 for ( iter = formatter.begin_iterator; iter != formatter.end_iterator; ++iter )
209 ostream << format(*iter) <<
" ";
294 virtual ~ArrayFormatter()
321 virtual ~ArrayFormatter()
Fixed size container with a few bells and whistles.
const Type * const_iterator
#define LOC
Stringify the line of code you are at.
#define ecl_assert_throw(expression, exception)
Debug mode throw with a logical condition check.
Standard exception type, provides code location and error string.
TFSIMD_FORCE_INLINE const tfScalar & w() const
#define ecl_assert_throw_decl(exception)
Assure throw exception declaration.