qb
2.0.0.0
C++17 Actor Framework
|
Thread-safe console output class. More...
#include <io.h>
Public Member Functions | |
cout ()=default | |
Default constructor. | |
cout (cout const &)=delete | |
Deleted copy constructor. | |
~cout () | |
Destructor that flushes output. | |
template<typename T> | |
std::stringstream & | operator<< (T const &data) |
Stream insertion operator. | |
std::stringstream & | operator<< (std::ostream &(*manip)(std::ostream &)) |
Thread-safe console output class.
This class provides a thread-safe wrapper around std::cout. It uses a mutex to ensure that output operations from multiple threads don't interleave, resulting in garbled output.
Example usage:
qb::io::cout::~cout | ( | ) |
Destructor that flushes output.
When the cout object is destroyed, its buffered content is output to std::cout in a thread-safe manner.
|
inline |
Stream insertion operator.
Allows data to be inserted into the output stream using the standard C++ stream insertion syntax.
T | Type of data to insert |
data | The data to insert |