Panda3D
|
This class provides a locking wrapper around an arbitrary ostream pointer. More...
#include "streamWrapper.h"
Public Member Functions | |
OStreamWrapper (ostream *stream, bool owns_pointer) | |
OStreamWrapper (ostream &stream) | |
ostream * | get_ostream () const |
Returns the ostream this object is wrapping. | |
bool | put (char c) |
Atomically writes a single character to the stream. | |
void | seek_write (streamsize pos, const char *buffer, streamsize num_bytes, bool &fail) |
Atomically seeks to a particular offset from the beginning of the file, and writes a number of bytes to the stream. | |
void | write (const char *buffer, streamsize num_bytes, bool &fail) |
Atomically writes a number of bytes to the stream. | |
void | write (const char *buffer, streamsize num_bytes) |
Atomically writes a number of bytes to the stream, without error detection. |
This class provides a locking wrapper around an arbitrary ostream pointer.
A thread may use this class to perform an atomic seek/write operation.
Definition at line 81 of file streamWrapper.h.
ostream * OStreamWrapper::get_ostream | ( | ) | const [inline] |
Returns the ostream this object is wrapping.
Definition at line 152 of file streamWrapper.I.
bool OStreamWrapper::put | ( | char | c | ) | [inline] |
Atomically writes a single character to the stream.
Returns true on success, false on failure.
Definition at line 163 of file streamWrapper.I.
References StreamWrapperBase::acquire(), and StreamWrapperBase::release().
void OStreamWrapper::seek_write | ( | streamsize | pos, |
const char * | buffer, | ||
streamsize | num_bytes, | ||
bool & | fail | ||
) |
Atomically seeks to a particular offset from the beginning of the file, and writes a number of bytes to the stream.
Returns whether a failure condition was detected by the operation.
Definition at line 209 of file streamWrapper.cxx.
References StreamWrapperBase::acquire(), and StreamWrapperBase::release().
void OStreamWrapper::write | ( | const char * | buffer, |
streamsize | num_bytes, | ||
bool & | fail | ||
) |
Atomically writes a number of bytes to the stream.
Returns whether a failure condition was detected by the operation.
Definition at line 192 of file streamWrapper.cxx.
References StreamWrapperBase::acquire(), and StreamWrapperBase::release().
void OStreamWrapper::write | ( | const char * | buffer, |
streamsize | num_bytes | ||
) |
Atomically writes a number of bytes to the stream, without error detection.
Definition at line 178 of file streamWrapper.cxx.
References StreamWrapperBase::acquire(), and StreamWrapperBase::release().