KaMPIng 0.1.1
Flexible and (near) zero-overhead C++ bindings for MPI
Loading...
Searching...
No Matches
kamping::measurements::internal::ScalarOrVectorPrinter< T > Struct Template Reference

Able to print either a single value or a vector of value to the given outstream. More...

#include <printer.hpp>

Collaboration diagram for kamping::measurements::internal::ScalarOrVectorPrinter< T >:

Public Member Functions

 ScalarOrVectorPrinter (std::ostream &outstream)
 Constructs a printer printing to the given outstream.
 
void operator() (std::vector< T > const &vec) const
 Outputs the content of the given vector to outstream.
 
void operator() (T const &scalar) const
 Outputs the given scalar to outstream.
 

Public Attributes

std::ostream & _outstream
 Outstream used for printing.
 

Detailed Description

template<typename T>
struct kamping::measurements::internal::ScalarOrVectorPrinter< T >

Able to print either a single value or a vector of value to the given outstream.

Template Parameters
Valuetype to print.

Constructor & Destructor Documentation

◆ ScalarOrVectorPrinter()

template<typename T >
kamping::measurements::internal::ScalarOrVectorPrinter< T >::ScalarOrVectorPrinter ( std::ostream & outstream)
inline

Constructs a printer printing to the given outstream.

Parameters
outstreamOutstream to print on.

Member Function Documentation

◆ operator()() [1/2]

template<typename T >
void kamping::measurements::internal::ScalarOrVectorPrinter< T >::operator() ( std::vector< T > const & vec) const
inline

Outputs the content of the given vector to outstream.

Parameters
vecVector whose elements are comma-separated printed to the outstream.

◆ operator()() [2/2]

template<typename T >
void kamping::measurements::internal::ScalarOrVectorPrinter< T >::operator() ( T const & scalar) const
inline

Outputs the given scalar to outstream.

Parameters
scalarScalar to be printed.

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