libMesh
|
#include <thread_buffered_syncbuf.h>
Classes | |
class | ThreadLocalBuffer |
A class that wraps a thread-local string. More... | |
Public Member Functions | |
ThreadBufferedSyncbuf (std::streambuf &sink, bool flush_on_newline=true) | |
~ThreadBufferedSyncbuf () | |
Defaulted destructor defined in implementation so we don't need to include threads.h. More... | |
Protected Member Functions | |
int_type | overflow (int_type ch) override |
std::streamsize | xsputn (const char *s, std::streamsize n) override |
int | sync () override |
Private Member Functions | |
ThreadLocalBuffer & | thread_local_buffer () |
One ThreadLocalBuffer instance per thread, constructed on first use with *this. More... | |
void | emit_from_thread_local_buffer (std::string &b, bool force_flush) |
Emit from the thread local buffer to our wrapped _sink . More... | |
Private Attributes | |
std::streambuf & | _sink |
Wrapped output sink. More... | |
const bool | _flush_on_newline |
Whether to flush our sink to terminal/file on terminating new-line characters ( ) More... | |
std::unique_ptr< Threads::spin_mutex > | _mu |
Serialization for commits to the shared sink. More... | |
Definition at line 32 of file thread_buffered_syncbuf.h.
|
explicit |
Definition at line 23 of file thread_buffered_syncbuf.C.
|
default |
Defaulted destructor defined in implementation so we don't need to include threads.h.
|
private |
Emit from the thread local buffer to our wrapped _sink
.
Definition at line 67 of file thread_buffered_syncbuf.C.
Referenced by overflow(), sync(), xsputn(), and libMesh::ThreadBufferedSyncbuf::ThreadLocalBuffer::~ThreadLocalBuffer().
|
overrideprotected |
Definition at line 30 of file thread_buffered_syncbuf.C.
References _flush_on_newline, emit_from_thread_local_buffer(), and thread_local_buffer().
|
overrideprotected |
Definition at line 55 of file thread_buffered_syncbuf.C.
References emit_from_thread_local_buffer(), and thread_local_buffer().
|
private |
One ThreadLocalBuffer instance per thread, constructed on first use with *this.
Definition at line 61 of file thread_buffered_syncbuf.C.
Referenced by overflow(), sync(), and xsputn().
|
overrideprotected |
Definition at line 44 of file thread_buffered_syncbuf.C.
References _flush_on_newline, emit_from_thread_local_buffer(), and thread_local_buffer().
|
private |
Whether to flush our sink to terminal/file on terminating new-line characters (
)
Definition at line 88 of file thread_buffered_syncbuf.h.
Referenced by overflow(), and xsputn().
|
private |
Serialization for commits to the shared sink.
Definition at line 91 of file thread_buffered_syncbuf.h.
Referenced by emit_from_thread_local_buffer().
|
private |
Wrapped output sink.
Definition at line 86 of file thread_buffered_syncbuf.h.
Referenced by emit_from_thread_local_buffer().