![]() |
Libftpp
A modern C++ library
|
Thread-Safe I/O Stream. More...
#include <thread_safe_iostream.hpp>
Public Member Functions | |
| template<typename T > | |
| ThreadSafeIOStream & | operator>> (T &value) |
| ThreadSafeIOStream & | operator<< (std::ostream &(*funct)(std::ostream &)) |
| template<typename T > | |
| ThreadSafeIOStream & | operator<< (const T &value) |
| void | setPrefix (const std::string &prefix) |
| template<typename T > | |
| void | prompt (const std::string &question, T &dest) |
Thread-Safe I/O Stream.
This class provides a thread-safe wrapper around standard input and output streams. It ensures that multiple threads can safely read from and write to the console without interleaving their output. It also supports setting a prefix for each output line to identify the source thread.
Definition at line 30 of file thread_safe_iostream.hpp.
|
inline |
Definition at line 63 of file thread_safe_iostream.hpp.
| ThreadSafeIOStream & ThreadSafeIOStream::operator<< | ( | std::ostream &(*)(std::ostream &) | funct | ) |
Definition at line 12 of file thread_safe_iostream.cpp.
|
inline |
Definition at line 40 of file thread_safe_iostream.hpp.
|
inline |
Definition at line 92 of file thread_safe_iostream.hpp.
| void ThreadSafeIOStream::setPrefix | ( | const std::string & | prefix | ) |
Definition at line 6 of file thread_safe_iostream.cpp.
Referenced by Thread::Thread().