# class ThreadedSource | Data source with own thread. More...
Contains pure virtuals
Full name | `TelEngine::ThreadedSource`
Definition | `#include <yatephone.h>`
Inherits | TelEngine::DataSource [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- virtual void destroyed ()
- bool start (const char* name = "ThreadedSource", Thread::Priority prio = Thread::Normal)
- void stop ()
- Thread* thread () const
- bool running () const

#### Protected Methods

- inline explicit ThreadedSource (const char* format = "slin")
- virtual void run ()
- virtual void cleanup ()
- bool looping (bool runConsumers = false) const

## Detailed Description

A data source with a thread of its own

void destroyed () | ### 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) | ### start

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 () | ### stop

Stops and destroys the worker thread if running

Thread* thread () | ### thread

[const]

Return a pointer to the worker thread

Returns: Pointer to running worker thread or NULL

bool running () | ### running

[const]

Check if the data thread is running

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

inline explicit ThreadedSource (const char* format = "slin") | ### ThreadedSource

[protected]

Threaded Source constructor

Parameters:

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

void run () | ### run

[protected pure virtual]

The worker method. You have to reimplement it as you need

void cleanup () | ### cleanup

[protected virtual]

The cleanup after thread method, deletes the source if already dereferenced and set for asynchronous deletion

bool looping (bool runConsumers = false) | ### looping

[protected const]

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

Generated by: paulc on bussard on Fri Dec 21 16:28:34 2012, using kdoc 2.0a54.