Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

DataSource Class Reference

#include <yatephone.h>

Inheritance diagram for DataSource:

DataNode RefObject GenObject ThreadedSource List of all members.

Public Member Functions

 DataSource (const char *format="slin")
virtual ~DataSource ()
virtual void * getObject (const String &name) const
void Forward (const DataBlock &data, unsigned long tStamp=(unsigned long)-1)
bool attach (DataConsumer *consumer, bool override=false)
bool detach (DataConsumer *consumer)
void clear ()
Mutexmutex ()
DataTranslatorgetTranslator () const
void synchronize (unsigned long tStamp)

Protected Attributes

DataTranslatorm_translator
ObjList m_consumers
Mutex m_mutex

Friends

class DataTranslator

Detailed Description

A data source


Constructor & Destructor Documentation

DataSource const char *  format = "slin"  )  [inline]
 

Source constructor

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

virtual ~DataSource  )  [virtual]
 

Source's destructor - detaches all consumers


Member Function Documentation

bool attach DataConsumer consumer,
bool  override = false
 

Attach a data consumer

Parameters:
consumer Data consumer to attach
override Attach as temporary source override
Returns:
True on success, false on failure

void clear  ) 
 

Detach all data consumers

bool detach DataConsumer consumer  ) 
 

Detach a data consumer

Parameters:
consumer Data consumer to detach
Returns:
True on success, false on failure

void Forward const DataBlock data,
unsigned long  tStamp = (unsigned long)-1
 

Forwards the data to its consumers

Parameters:
data The raw data block to forward; an empty block ends data
tStamp Timestamp of data - typically samples

virtual void* getObject const String name  )  const [virtual]
 

Get a pointer to a derived class given that class name

Parameters:
name Name of the class we are asking for
Returns:
Pointer to the requested class or NULL if this object doesn't implement it

Reimplemented from GenObject.

DataTranslator* getTranslator  )  const [inline]
 

Get the master translator object if this source is part of a translator

Returns:
A pointer to the DataTranslator object or NULL

Mutex* mutex  )  [inline]
 

Get the mutex that serializes access to this data source

Returns:
Pointer to DataSource's mutex object

void synchronize unsigned long  tStamp  ) 
 

Synchronize the source and attached consumers with another timestamp

Parameters:
tStamp New timestamp of data - typically samples


The documentation for this class was generated from the following file:
Generated on Fri Jul 7 03:11:38 2006 for Yate by  doxygen 1.4.4