Stream one message to both the original console and the session log. More...
#include <application_runtime.h>


Public Member Functions | |
| TeeBuffer (std::streambuf *console, std::streambuf *file, std::mutex &mutex) | |
| Bind two destinations to a caller-owned synchronization lock. | |
Protected Member Functions | |
| std::streamsize | xsputn (const char *data, std::streamsize size) override |
| Write a block to both outputs under the shared lock. | |
| int | overflow (int character) override |
| Mirror a single character not handled by a put area. | |
| int | sync () override |
| Synchronize the two outputs without interleaving other writes. | |
Private Attributes | |
| std::streambuf * | console_ |
| std::streambuf * | file_ |
| std::mutex & | mutex_ |
Detailed Description
Stream one message to both the original console and the session log.
Definition at line 41 of file application_runtime.h.
Constructor & Destructor Documentation
◆ TeeBuffer()
|
inline |
Bind two destinations to a caller-owned synchronization lock.
- Parameters
-
[in] console Original console stream buffer. [in] file Session-log stream buffer. [in,out] mutex Lock shared by the stdout and stderr tee buffers.
Definition at line 86 of file application_runtime.h.
Member Function Documentation
◆ overflow()
|
inlineoverrideprotected |
Mirror a single character not handled by a put area.
- Parameters
-
character Streambuf integer character, or the EOF sentinel.
- Returns
- The written character, or EOF on either write failure.
Treat an EOF sentinel as a no-op, not as a byte to write.
Definition at line 62 of file application_runtime.h.
◆ sync()
|
inlineoverrideprotected |
Synchronize the two outputs without interleaving other writes.
- Returns
- Zero if both sync calls succeed, otherwise -1.
A console sync failure short-circuits the file sync.
Definition at line 75 of file application_runtime.h.
◆ xsputn()
|
inlineoverrideprotected |
Write a block to both outputs under the shared lock.
- Parameters
-
data Borrowed character block. size Character count.
- Returns
- The shorter of the two writes, exposing failure of either output.
Keep the lock across both writes so competing diagnostics appear in the same order in the console and session log.
Definition at line 52 of file application_runtime.h.
Field Documentation
◆ console_
|
private |
Definition at line 42 of file application_runtime.h.
◆ file_
|
private |
Definition at line 43 of file application_runtime.h.
◆ mutex_
|
private |
Definition at line 44 of file application_runtime.h.
The documentation for this class was generated from the following file:
- modules/pangea/application_runtime.h