cartobase  4.5.0
carto::Thread Class Referenceabstract

Short usage: More...

#include <cartobase/thread/thread.h>

Inheritance diagram for carto::Thread:

Public Member Functions

 Thread ()
 
virtual ~Thread ()
 
virtual void launch ()
 This is the function which should actually called to run a thread. More...
 
virtual void start ()
 Call launch(), not start() More...
 
virtual void run ()
 Call launch(), not run() More...
 
virtual void stop ()
 
virtual void reset ()
 
virtual void join ()
 
virtual void detach ()
 
void setSuicideSafe (bool x=true)
 In suicide-safe mode, Thread can be deleted (or auto-deleted) while the threaded job is still running: doPostLaunch() and stop() are not executed. More...
 
bool isSuicideSafe () const
 
virtual void setCancellable (bool value, bool callStop)
 
virtual void cancel ()
 
virtual bool isActive () const
 
virtual bool isCurrent () const
 

Static Public Member Functions

static bool currentIsMainThread ()
 
static void * bootstrap (void *thread)
 

Protected Member Functions

virtual void testCancel ()
 
virtual void doStart ()
 
virtual void doRun ()=0
 
virtual void doStop ()
 
virtual void doPreLaunch ()
 
virtual void doPostLaunch ()
 

Protected Attributes

bool _detached
 
bool _cancellable
 
bool _callStop
 

Detailed Description

Short usage:

Definition at line 52 of file thread.h.

Constructor & Destructor Documentation

carto::Thread::Thread ( )
virtual carto::Thread::~Thread ( )
virtual

Member Function Documentation

static void* carto::Thread::bootstrap ( void *  thread)
static
virtual void carto::Thread::cancel ( )
virtual
static bool carto::Thread::currentIsMainThread ( )
static
virtual void carto::Thread::detach ( )
virtual
virtual void carto::Thread::doPostLaunch ( )
protectedvirtual
virtual void carto::Thread::doPreLaunch ( )
protectedvirtual
virtual void carto::Thread::doRun ( )
protectedpure virtual

Implemented in carto::LoopThread.

virtual void carto::Thread::doStart ( )
protectedvirtual
virtual void carto::Thread::doStop ( )
protectedvirtual
virtual bool carto::Thread::isActive ( ) const
virtual
virtual bool carto::Thread::isCurrent ( ) const
virtual
bool carto::Thread::isSuicideSafe ( ) const
virtual void carto::Thread::join ( )
virtual
virtual void carto::Thread::launch ( )
virtual

This is the function which should actually called to run a thread.

virtual void carto::Thread::reset ( )
virtual
virtual void carto::Thread::run ( )
virtual

Call launch(), not run()

virtual void carto::Thread::setCancellable ( bool  value,
bool  callStop 
)
virtual
void carto::Thread::setSuicideSafe ( bool  x = true)

In suicide-safe mode, Thread can be deleted (or auto-deleted) while the threaded job is still running: doPostLaunch() and stop() are not executed.

Warning: it doesn't imply the thread is detached (if not, you may have to join() it to cleanup).

virtual void carto::Thread::start ( )
virtual

Call launch(), not start()

virtual void carto::Thread::stop ( )
virtual
virtual void carto::Thread::testCancel ( )
protectedvirtual

Member Data Documentation

bool carto::Thread::_callStop
protected

Definition at line 101 of file thread.h.

bool carto::Thread::_cancellable
protected

Definition at line 100 of file thread.h.

bool carto::Thread::_detached
protected

Definition at line 99 of file thread.h.


The documentation for this class was generated from the following file: