#include <yatephone.h>
Public Member Functions | |
virtual void | destroyed () |
bool | start (const char *name="ThreadedSource", Thread::Priority prio=Thread::Normal) |
void | stop () |
Thread * | thread () const |
bool | running () const |
bool | asyncDelete () const |
Protected Member Functions | |
ThreadedSource (const char *format="slin") | |
void | asyncDelete (bool async) |
void | clearThread () |
virtual void | run ()=0 |
virtual void | cleanup () |
virtual bool | zeroRefsTest () |
Friends | |
class | ThreadedSourcePrivate |
ThreadedSource | ( | const char * | format = "slin" |
) | [inline, protected] |
Threaded Source constructor
format | Name of the data format, default "slin" (Signed Linear) |
virtual void destroyed | ( | ) | [virtual] |
The destruction notification, stops the thread
Reimplemented from DataSource.
bool start | ( | const char * | name = "ThreadedSource" , |
|
Thread::Priority | prio = Thread::Normal | |||
) |
Starts the worker thread
name | Static name of this thread | |
prio | Thread's priority |
void stop | ( | ) |
Stops and destroys the worker thread if running
Thread* thread | ( | ) | const |
Return a pointer to the worker thread
bool running | ( | ) | const |
Check if the data thread is running
bool asyncDelete | ( | ) | const [inline] |
Get the current status of the asynchronous deletion flag
void asyncDelete | ( | bool | async | ) | [inline, protected] |
Derived classes should call this method to let the source to be destroyed asynchronously in the data thread
void clearThread | ( | ) | [inline, protected] |
Clear the worker thread pointer
virtual void run | ( | ) | [protected, pure virtual] |
The worker method. You have to reimplement it as you need
virtual void cleanup | ( | ) | [protected, virtual] |
The cleanup after thread method, deletes the source if already dereferenced and set for asynchronous deletion
virtual bool zeroRefsTest | ( | ) | [protected, virtual] |
Override so destruction can be delayed after all references were lost to let the data pumping thread end normally
Reimplemented from RefObject.