Data source with own thread. More...
#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 |
Protected Member Functions | |
ThreadedSource (const char *format="slin") | |
virtual void | run ()=0 |
virtual void | cleanup () |
bool | looping (bool runConsumers=false) const |
Friends | |
class | ThreadedSourcePrivate |
Data source with own thread.
A data source with a thread of its own
ThreadedSource | ( | const char * | format = "slin" |
) | [inline, protected] |
Threaded Source constructor
format | Name of the data format, default "slin" (Signed Linear) |
virtual void cleanup | ( | ) | [protected, virtual] |
The cleanup after thread method, deletes the source if already dereferenced and set for asynchronous deletion
virtual void destroyed | ( | ) | [virtual] |
The destruction notification, checks that the thread is gone
Reimplemented from DataSource.
bool looping | ( | bool | runConsumers = false |
) | const [protected] |
Check if the calling thread should keep looping the worker method
runConsumers | True to keep running as long consumers are attached |
virtual void run | ( | ) | [protected, pure virtual] |
The worker method. You have to reimplement it as you need
bool running | ( | ) | const |
Check if the data thread is running
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