LibreOffice Module sw (master) 1
|
class for an observable thread More...
#include <observablethread.hxx>
Public Member Functions | |
virtual | ~ObservableThread () override |
void | SetListener (std::weak_ptr< IFinishedThreadListener > const &pThreadListener, const oslInterlockedCount nThreadID) |
Public Member Functions inherited from salhelper::SimpleReferenceObject | |
SimpleReferenceObject () | |
void | acquire () |
void | release () |
Protected Member Functions | |
ObservableThread () | |
virtual void SAL_CALL | run () override |
intrinsic function of the thread More... | |
virtual void | threadFunction ()=0 |
virtual void SAL_CALL | onTerminated () override |
method called, when thread has finished its work More... | |
Protected Member Functions inherited from salhelper::SimpleReferenceObject | |
virtual | ~SimpleReferenceObject () COVERITY_NOEXCEPT_FALSE |
Private Attributes | |
oslInterlockedCount | mnThreadID |
std::weak_ptr< IFinishedThreadListener > | mpThreadListener |
Additional Inherited Members | |
Static Public Member Functions inherited from salhelper::SimpleReferenceObject | |
static void * | operator new (std::size_t nSize) |
static void * | operator new (std::size_t nSize, std::nothrow_t const &rNothrow) |
static void | operator delete (void *pPtr) |
static void | operator delete (void *pPtr, std::nothrow_t const &rNothrow) |
Protected Attributes inherited from salhelper::SimpleReferenceObject | |
oslInterlockedCount | m_nCount |
class for an observable thread
OD 2007-01-29 #i73788# Note: A thread is ref-counted. Thus, an instance of a derived class has to to be hold via a reference. The thread itself assures during its execution, that the ref-count is increased. Its execution starts with its <run()> method and ends with its <onTerminated()> method. Note: A thread can be only observed by one or none thread observer in order to notify, that the thread has finished its work.
Definition at line 39 of file observablethread.hxx.
|
overridevirtual |
Definition at line 33 of file observablethread.cxx.
|
protected |
Definition at line 28 of file observablethread.cxx.
|
overrideprotectedvirtual |
method called, when thread has finished its work
Important note: Do not override this method again. Instead override <threadFinished()>. Otherwise, it's not guaranteed, that the ref-count is decreased at the end of its execution and that the observer is notified, that the thread has finished its work.
Definition at line 51 of file observablethread.cxx.
References mnThreadID, mpThreadListener, and salhelper::SimpleReferenceObject::release().
|
overrideprotectedvirtual |
intrinsic function of the thread
Important note: Do not override this method again. Instead override <threadFunction()>. Otherwise, it's not guaranteed, that its ref-count is increased during the execution of the thread.
Definition at line 44 of file observablethread.cxx.
References salhelper::SimpleReferenceObject::acquire(), and threadFunction().
void ObservableThread::SetListener | ( | std::weak_ptr< IFinishedThreadListener > const & | pThreadListener, |
const oslInterlockedCount | nThreadID | ||
) |
Definition at line 37 of file observablethread.cxx.
References mnThreadID, and mpThreadListener.
Referenced by ThreadListener::ListenToThread().
|
protectedpure virtual |
Implemented in SwAsyncRetrieveInputStreamThread.
Referenced by run().
|
private |
Definition at line 80 of file observablethread.hxx.
Referenced by onTerminated(), and SetListener().
|
private |
Definition at line 82 of file observablethread.hxx.
Referenced by onTerminated(), and SetListener().