11 #ifndef LARCORE_COREUTILS_DUMPUTILS_H
12 #define LARCORE_COREUTILS_DUMPUTILS_H
17 #include <type_traits>
28 template <
typename Coll>
36 template <
typename Stream,
typename Array>
39 if (n == 0) { out <<
"}";
return; }
43 while (++i < n) out <<
"; " << (*++it);
59 template <
typename Array>
76 template <
typename Stream>
81 explicit operator std::string()
const
82 { std::ostringstream sstr; this->
operator()(sstr);
return sstr.str(); }
98 template <
typename Stream>
103 explicit operator std::string()
const
104 { std::ostringstream sstr; this->operator()(sstr);
return sstr.str(); }
154 template <
typename Vector>
170 template <
typename Stream>
172 { out <<
"{ " <<
v.X() <<
"; " <<
v.Y() <<
"; " <<
v.Z() <<
" }"; }
175 explicit operator std::string()
const
176 { std::ostringstream sstr; this->
operator()(sstr);
return sstr.str(); }
182 template <
typename T>
188 template <
typename T>
227 template <
size_t N,
typename Array>
264 template <
typename Vector>
300 template <
typename Vector3D>
335 template <
typename Stream,
typename Array>
336 Stream& operator<< (Stream&& out, ArrayDumper<Array>&& manip)
337 { manip(std::forward<Stream>(out));
return out; }
369 template <
typename Stream,
typename Vector>
370 Stream& operator<< (Stream&& out, VectorDumper<Vector>&& manip)
371 { manip(std::forward<Stream>(out));
return out; }
403 template <
typename String,
typename Vector>
405 {
return s + std::string(manip);}
408 template <
typename Vector>
410 {
return std::string(s) + manip;}
413 template <
typename String,
typename Vector>
415 {
return std::string(manip) +
s;}
418 template <
typename Vector>
420 {
return manip + std::string(s);}
423 template <
typename String,
typename Vector>
425 {
return s += std::string(manip); }
433 #endif // LARCORE_COREUTILS_DUMPUTILS_H
auto vector3D(Vector3D const &v)
Returns a manipulator which will print the specified vector.
ArrayDumper< Array_t > This_t
void operator()(Stream &&out) const
Inserts the content of the referenced array into the specified stream.
String operator+(String const &s, VectorDumper< Vector > const &manip)
Concatenates a vector to the specified string.
ArrayDumper & operator=(This_t const &from)=delete
auto cbegin(FixedBins< T, C > const &) noexcept
void dumpArray(Stream &&out, Array &&a, size_t n)
Inserts n of elements of a in the specified stream.
recob::tracking::Vector_t Vector3D
size_t n
Number of elements to be printed.
VectorDumper< Vector_t > This_t
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
ArrayDumper(Array_t a, size_t n)
auto array(Array const &a)
Returns a manipulator which will print the specified array.
Vector_t const & v
A reference to the vector to be printed.
auto ptr_cbegin(Coll const &v)
Array_t const & a
A reference to the array to be printed.
VectorDumper(Vector_t const &v)
Dumps the first N elements of an array.
String & operator+=(String &s, VectorDumper< Vector > const &manip)
Appends a string rendering of a vector to the specified string.
void operator()(Stream &&out) const
Inserts the content of the stored vector into the specified stream.
Array_t a
A reference to the array to be printed.
VectorDumper & operator=(This_t const &from)=delete
then echo File list $list not found else cat $list while read file do echo $file sed s
process_name largeant stream1 can override from command line with o or output physics producers generator N
ArrayDumper(Array_t const &a, size_t n)
size_t n
Number of elements to be printed.
Manipulator managing the dump of the vector content into a stream.