Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
STREAM::JStream Struct Reference

Auxiliary class for format stream. More...

#include <JStreamAvailable.hh>

Public Member Functions

 JStream (std::ostream &out, const std::string &message)
 Constructor.
 
template<class T >
std::ostream & operator<< (const T &value)
 Write value to output stream.
 

Private Member Functions

template<class T >
std::ostream & print (std::ostream &out, const T &value, const JLANG::JBool< true > &option)
 Print value if given option is true.
 
template<class T >
std::ostream & print (std::ostream &out, const T &value, const JLANG::JBool< false > &option)
 Print value if given option is true.
 

Private Attributes

std::ostream & out
 
std::string message
 

Detailed Description

Auxiliary class for format stream.

Definition at line 41 of file JStreamAvailable.hh.

Constructor & Destructor Documentation

◆ JStream()

STREAM::JStream::JStream ( std::ostream & out,
const std::string & message )
inline

Constructor.

Parameters
outoutput stream
messagemessage printed in case operator std::ostream<< is unavailable

Definition at line 49 of file JStreamAvailable.hh.

49 :
50 out (out),
52 {}
std::ostream & out

Member Function Documentation

◆ operator<<()

template<class T >
std::ostream & STREAM::JStream::operator<< ( const T & value)
inline

Write value to output stream.

Parameters
valuevalue
Returns
this JStream

Definition at line 62 of file JStreamAvailable.hh.

63 {
64 using namespace JPP;
65
67 }
Test availability of stream operators.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary template class for type bool.
Definition JBool.hh:21
std::ostream & print(std::ostream &out, const T &value, const JLANG::JBool< true > &option)
Print value if given option is true.

◆ print() [1/2]

template<class T >
std::ostream & STREAM::JStream::print ( std::ostream & out,
const T & value,
const JLANG::JBool< true > & option )
inlineprivate

Print value if given option is true.

Parameters
outoutput stream
valuevalue
optiontrue
Returns
output stream

Definition at line 79 of file JStreamAvailable.hh.

80 {
81 return out << value;
82 }

◆ print() [2/2]

template<class T >
std::ostream & STREAM::JStream::print ( std::ostream & out,
const T & value,
const JLANG::JBool< false > & option )
inlineprivate

Print value if given option is true.

Parameters
outoutput stream
valuevalue
optionfalse
Returns
output stream

Definition at line 93 of file JStreamAvailable.hh.

94 {
95 return out << message;
96 }

Member Data Documentation

◆ out

std::ostream& STREAM::JStream::out
private

Definition at line 98 of file JStreamAvailable.hh.

◆ message

std::string STREAM::JStream::message
private

Definition at line 99 of file JStreamAvailable.hh.


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