URY playd
C++ minimalist audio player
Debug Class Reference

Class for telling the human what playd is doing. More...

#include <errors.hpp>

+ Collaboration diagram for Debug:

Public Member Functions

 Debug ()
 Constructor. More...
 
 ~Debug ()
 Destructor. More...
 
template<typename T >
Debugoperator<< (const T &x)
 Stream operator for shoving objects onto a screen somewhere. More...
 
Debugoperator<< (std::ostream &(*pf)(std::ostream &))
 Specialisation for std::endl, which is actually a function pointer. More...
 

Private Attributes

std::ostringstream oss
 Stream buffer (avoids theoretical threading issues). More...
 

Detailed Description

Class for telling the human what playd is doing.

Definition at line 133 of file errors.hpp.

Constructor & Destructor Documentation

§ Debug()

Debug::Debug ( )
inline

Constructor.

Definition at line 137 of file errors.hpp.

138  {
139  oss << "DEBUG:";
140  }
std::ostringstream oss
Stream buffer (avoids theoretical threading issues).
Definition: errors.hpp:174

§ ~Debug()

Debug::~Debug ( )
inline

Destructor.

Actually shoves things to the screen.

Definition at line 143 of file errors.hpp.

144  {
145  std::cerr << oss.str();
146  }
std::ostringstream oss
Stream buffer (avoids theoretical threading issues).
Definition: errors.hpp:174

Member Function Documentation

§ operator<<() [1/2]

template<typename T >
Debug& Debug::operator<< ( const T &  x)
inline

Stream operator for shoving objects onto a screen somewhere.

Template Parameters
TType of parameter.
Parameters
xObject to write to the stream.
Returns
Chainable reference.

Definition at line 155 of file errors.hpp.

156  {
157  oss << " ";
158  oss << x;
159  return *this;
160  }
std::ostringstream oss
Stream buffer (avoids theoretical threading issues).
Definition: errors.hpp:174

§ operator<<() [2/2]

Debug& Debug::operator<< ( std::ostream &(*)(std::ostream &)  pf)
inline

Specialisation for std::endl, which is actually a function pointer.

Parameters
pfFunction pointer.
Returns
Chainable reference.

Definition at line 167 of file errors.hpp.

168  {
169  oss << pf;
170  return *this;
171  }
std::ostringstream oss
Stream buffer (avoids theoretical threading issues).
Definition: errors.hpp:174

Member Data Documentation

§ oss

std::ostringstream Debug::oss
private

Stream buffer (avoids theoretical threading issues).

Definition at line 174 of file errors.hpp.


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