![]() |
Qore Programming Language - C/C++ Library 2.1.1
|
Base class for private data of stream implementations in C++. More...
#include <StreamBase.h>
Public Member Functions | |
| DLLLOCAL bool | check (ExceptionSink *xsink) |
| Checks that the current thread is the same as when the instance was created or assigned via unassignThread() and reassignThread() and that the stream has not yet been closed. | |
| virtual DLLLOCAL const char * | getName ()=0 |
| Returns the name of the class. | |
| DLLLOCAL int | getThreadId () |
| Get currently assigned thread id. | |
| DLLLOCAL void | reassignThread (ExceptionSink *xsink) |
| Reassigns current thread as thread used for stream manipulation, see check() | |
| DLLLOCAL void | unassignThread (ExceptionSink *xsink) |
| Unassigns current thread as thread used for stream manipulation, see check() | |
Public Member Functions inherited from AbstractPrivateData | |
| virtual DLLLOCAL void | deref () |
| decrements the reference count of the object without the possibility of throwing a Qore-language exception | |
| virtual DLLLOCAL void | deref (ExceptionSink *xsink) |
| decrements the reference count of the object | |
| DLLLOCAL void | ref () const |
| increments the reference count of the object | |
Public Member Functions inherited from QoreReferenceCounter | |
| DLLEXPORT | QoreReferenceCounter () |
| Creates the reference counter object. | |
| DLLEXPORT | QoreReferenceCounter (const QoreReferenceCounter &old) |
| Creates a new object with a reference count of 1. | |
| DLLEXPORT | ~QoreReferenceCounter () |
| destroys the reference counter object | |
| DLLEXPORT bool | is_unique () const |
| Returns true if the reference count is 1. | |
| DLLEXPORT bool | optRef () |
| Make a strong reference only if the object is valid. | |
| DLLEXPORT int | reference_count () const |
| Gets the reference count. | |
| DLLEXPORT bool | ROdereference () const |
| Atomically decrements the reference count. | |
| DLLEXPORT void | ROreference () const |
| Atomically increments the reference count. | |
Protected Member Functions | |
| StreamBase () | |
| Constructor. | |
Protected Member Functions inherited from AbstractPrivateData | |
| virtual DLLLOCAL | ~AbstractPrivateData () |
| as these objects are reference counted, the destructor should be called only when the reference count = 0 and not manually | |
Base class for private data of stream implementations in C++.
|
inline |
Checks that the current thread is the same as when the instance was created or assigned via unassignThread() and reassignThread() and that the stream has not yet been closed.
| xsink | the exception sink |
| STREAM-THREAD-ERROR | if the current thread is not the same as when the instance was created |
References getName(), q_gettid(), and ExceptionSink::raiseException().
Referenced by OutputStream::check(), InputStream::peekHelper(), and InputStream::readHelper().
|
pure virtual |
Returns the name of the class.
Referenced by OutputStream::check(), check(), InputStream::readHelper(), reassignThread(), and unassignThread().
|
inline |
Reassigns current thread as thread used for stream manipulation, see check()
| xsink | the exception sink |
| STREAM-THREAD-ERROR | if the current thread is already assigned to another thread |
References getName(), q_gettid(), and ExceptionSink::raiseException().
|
inline |
Unassigns current thread as thread used for stream manipulation, see check()
| xsink | the exception sink |
| STREAM-THREAD-ERROR | if the current thread is not the same as assigned |
References getName(), q_gettid(), and ExceptionSink::raiseException().