#include <yatephone.h>
Inheritance diagram for DataSource:
Public Member Functions | |
DataSource (const char *format="slin") | |
virtual void | destroyed () |
virtual void * | getObject (const String &name) const |
void | Forward (const DataBlock &data, unsigned long tStamp=invalidStamp()) |
bool | attach (DataConsumer *consumer, bool override=false) |
bool | detach (DataConsumer *consumer) |
void | clear () |
Mutex * | mutex () |
DataTranslator * | getTranslator () const |
void | synchronize (unsigned long tStamp) |
unsigned long | nextStamp () const |
Protected Attributes | |
unsigned long | m_nextStamp |
DataTranslator * | m_translator |
ObjList | m_consumers |
Mutex | m_mutex |
Friends | |
class | DataTranslator |
DataSource | ( | const char * | format = "slin" |
) | [inline] |
Source constructor
format | Name of the data format, default "slin" (Signed Linear) |
virtual void destroyed | ( | ) | [virtual] |
Source's destruct notification - detaches all consumers
Reimplemented from RefObject.
Reimplemented in ThreadedSource.
virtual void* getObject | ( | const String & | name | ) | const [virtual] |
Get a pointer to a derived class given that class name
name | Name of the class we are asking for |
Reimplemented from GenObject.
void Forward | ( | const DataBlock & | data, | |
unsigned long | tStamp = invalidStamp() | |||
) |
Forwards the data to its consumers
data | The raw data block to forward; an empty block ends data | |
tStamp | Timestamp of data - typically samples |
bool attach | ( | DataConsumer * | consumer, | |
bool | override = false | |||
) |
Attach a data consumer
consumer | Data consumer to attach | |
override | Attach as temporary source override |
bool detach | ( | DataConsumer * | consumer | ) |
Detach a data consumer
consumer | Data consumer to detach |
void clear | ( | ) |
Detach all data consumers
Mutex* mutex | ( | ) | [inline] |
Get the mutex that serializes access to this data source
DataTranslator* getTranslator | ( | ) | const [inline] |
Get the master translator object if this source is part of a translator
void synchronize | ( | unsigned long | tStamp | ) |
Synchronize the source and attached consumers with another timestamp
tStamp | New timestamp of data - typically samples |
unsigned long nextStamp | ( | ) | const [inline] |
Get the next expected position in the data stream