Jpp  17.3.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
JEEP::JCommunicator Class Reference

Auxiliary class to control standard input and output. More...

#include <JCommunicator.hh>

Public Member Functions

 JCommunicator ()
 Default constructor. More...
 
 JCommunicator (const bool verbose)
 Constructor. More...
 
bool getVerbose () const
 Get verbose mode. More...
 
void setVerbose (const bool verbose=true)
 Set verbose mode. More...
 
std::istream & getInputStream (std::istream &in=std::cin) const
 Get current input stream. More...
 
std::ostream & getOutputStream (std::ostream &out=std::cout) const
 Get current output stream. More...
 
std::ostream & getErrorStream (std::ostream &out=std::cerr) const
 Get current error stream. More...
 

Protected Attributes

bool verbose_
 

Detailed Description

Auxiliary class to control standard input and output.

Definition at line 23 of file JCommunicator.hh.

Constructor & Destructor Documentation

JEEP::JCommunicator::JCommunicator ( )
inline

Default constructor.

Definition at line 28 of file JCommunicator.hh.

28  :
29  verbose_(true)
30  {}
JEEP::JCommunicator::JCommunicator ( const bool  verbose)
inline

Constructor.

Parameters
verbosedisable I/O if false; else enable

Definition at line 38 of file JCommunicator.hh.

38  :
40  {}
int verbose
Definition: elog.cc:70

Member Function Documentation

bool JEEP::JCommunicator::getVerbose ( ) const
inline

Get verbose mode.

Returns
if true I/O enabled; else disabled

Definition at line 48 of file JCommunicator.hh.

49  {
50  return verbose_;
51  }
void JEEP::JCommunicator::setVerbose ( const bool  verbose = true)
inline

Set verbose mode.

Parameters
verbosedisable I/O if false; else enable

Definition at line 59 of file JCommunicator.hh.

60  {
61  verbose_ = verbose;
62  }
int verbose
Definition: elog.cc:70
std::istream& JEEP::JCommunicator::getInputStream ( std::istream &  in = std::cin) const
inline

Get current input stream.

This method returns the given input stream if the verbose option is set, else a streamer that does not read any input.

Parameters
ininput stream
Returns
input stream

Definition at line 73 of file JCommunicator.hh.

74  {
75  return (verbose_ ? in : JLANG::null);
76  }
static JNullStream null
Null I/O stream.
Definition: JNullStream.hh:51
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46
std::ostream& JEEP::JCommunicator::getOutputStream ( std::ostream &  out = std::cout) const
inline

Get current output stream.

This method returns the given output stream if the verbose option is set, else a streamer that does not write any output.

Parameters
outoutput stream
Returns
output stream

Definition at line 87 of file JCommunicator.hh.

88  {
89  return (verbose_ ? out : JLANG::null);
90  }
static JNullStream null
Null I/O stream.
Definition: JNullStream.hh:51
std::ostream& JEEP::JCommunicator::getErrorStream ( std::ostream &  out = std::cerr) const
inline

Get current error stream.

This method returns the given error stream if the verbose option is set, else a streamer that does not write any output.

Parameters
outerror stream
Returns
error stream

Definition at line 101 of file JCommunicator.hh.

102  {
103  //return (verbose_ ? out : JLANG::null);
104  return out;
105  }

Member Data Documentation

bool JEEP::JCommunicator::verbose_
protected

Definition at line 109 of file JCommunicator.hh.


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