ThreadedSource Class Reference

Data source with own thread. More...

#include <yatephone.h>

Inheritance diagram for ThreadedSource:

DataSource DataNode Mutex RefObject Lockable GenObject

List of all members.

Public Member Functions

virtual void destroyed ()
bool start (const char *name="ThreadedSource", Thread::Priority prio=Thread::Normal)
void stop ()
Threadthread () 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


Detailed Description

Data source with own thread.

A data source with a thread of its own


Constructor & Destructor Documentation

ThreadedSource ( const char *  format = "slin"  )  [inline, explicit, protected]

Threaded Source constructor

Parameters:
format Name of the data format, default "slin" (Signed Linear)


Member Function Documentation

virtual void destroyed (  )  [virtual]

The destruction notification, checks that the thread is gone

Reimplemented from DataSource.

bool start ( const char *  name = "ThreadedSource",
Thread::Priority  prio = Thread::Normal 
)

Starts the worker thread

Parameters:
name Static name of this thread
prio Thread's priority
Returns:
True if started, false if an error occured

void stop (  ) 

Stops and destroys the worker thread if running

Thread* thread (  )  const

Return a pointer to the worker thread

Returns:
Pointer to running worker thread or NULL

bool running (  )  const

Check if the data thread is running

Returns:
True if the data thread was started and is running

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

bool looping ( bool  runConsumers = false  )  const [protected]

Check if the calling thread should keep looping the worker method

Parameters:
runConsumers True to keep running as long consumers are attached
Returns:
True if the calling thread should remain in the run() method


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

Generated on Sat May 28 18:28:23 2011 for Yate by  doxygen 1.5.6