Public Member Functions | Private Attributes | List of all members
ana2019::ColorStream Class Reference

Public Member Functions

 ColorStream (std::ostream &os, unsigned int col=36)
 ~ColorStream ()
template<typename T >
std::ostream & operator<< (const T &t)

Private Attributes

std::ostream & fOS

Detailed Description

a very dumb implementation of a stream-wrapper that makes the text in one sequence of <<s some color and resets afterwards. helps output stick out since the SpectrumLoaders are fairly chatty in between useful output. resets the stream when it's destroyed so that subsequent text doesn't show up with color. use like: ColorStream(std::cout) << "This text, and this number " << 5736 << " show up as cyan!" << std::endl; ColorStream(std::cout, 31) << "This text is red!" << std::endl; std::cout << "This text has no special coloring" << std::endl;

Definition at line 164 of file generate_fd_fake_events.C.

Constructor & Destructor Documentation

ana2019::ColorStream::ColorStream ( std::ostream &  os,
unsigned int  col = 36 

Definition at line 167 of file generate_fd_fake_events.C.

References col, and printf().

168  : fOS(os)
169  {
170  // printf so that it definitely all goes into the same stream with no flushes in between
171  printf("\033[%d;1m", col);
172  }
Int_t col[ntarg]
Definition: Style.C:29
printf("%d Experimental points found\n", nlines)
ana2019::ColorStream::~ColorStream ( )

Definition at line 173 of file generate_fd_fake_events.C.

174  {
175  fOS << "\033[0;0m";
176  }

Member Function Documentation

template<typename T >
std::ostream& ana2019::ColorStream::operator<< ( const T t)

Definition at line 179 of file generate_fd_fake_events.C.

References confusionMatrixTree::t.

180  {
181  return fOS << t;
182  }

Member Data Documentation

std::ostream& ana2019::ColorStream::fOS

Definition at line 185 of file generate_fd_fake_events.C.

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