Yate
Public Member Functions | Protected Member Functions | Friends | List of all members
DataConsumer Class Referenceabstract

#include <yatephone.h>

Inheritance diagram for DataConsumer:
DataNode RefObject GenObject DataTranslator

Public Member Functions

 DataConsumer (const char *format="slin")
 
virtual void destroyed ()
 
virtual void * getObject (const String &name) const
 
virtual unsigned long Consume (const DataBlock &data, unsigned long tStamp, unsigned long flags)=0
 
DataSourcegetConnSource () const
 
DataSourcegetOverSource () const
 
virtual DataSourcegetTransSource () const
 
- Public Member Functions inherited from DataNode
 DataNode (const char *format=0)
 
virtual int costFormat (const DataFormat &format)
 
virtual bool setFormat (const DataFormat &format)
 
const DataFormatgetFormat () const
 
unsigned long timeStamp () const
 
virtual bool valid () const
 
virtual bool control (NamedList &params)
 
virtual void attached (bool added)
 
- Public Member Functions inherited from RefObject
 RefObject ()
 
virtual ~RefObject ()
 
virtual bool alive () const
 
bool ref ()
 
bool deref ()
 
int refcount () const
 
virtual void destruct ()
 
- Public Member Functions inherited from GenObject
 GenObject ()
 
virtual ~GenObject ()
 
virtual const StringtoString () const
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 

Protected Member Functions

virtual bool synchronize (DataSource *source)
 
- Protected Member Functions inherited from RefObject
virtual void zeroRefs ()
 
bool resurrect ()
 

Friends

class DataSource
 

Additional Inherited Members

- Public Types inherited from DataNode
enum  DataFlags {
  DataStart = 0x0001, DataEnd = 0x0002, DataMark = 0x0004, DataSilent = 0x0008,
  DataMissed = 0x0010, DataError = 0x0020, DataPrivate = 0x0100
}
 
- Static Public Member Functions inherited from DataNode
static unsigned long invalidStamp ()
 
- Static Public Member Functions inherited from RefObject
static bool alive (const RefObject *obj)
 
static bool efficientIncDec ()
 
- Static Public Member Functions inherited from GenObject
static void * getObject (const String &name, const GenObject *obj)
 
static bool getObjCounting ()
 
static void setObjCounting (bool enable)
 
static NamedCountergetObjCounter (const String &name, bool create=true)
 
static ObjListgetObjCounters ()
 
- Protected Attributes inherited from DataNode
DataFormat m_format
 
unsigned long m_timestamp
 

Detailed Description

A data consumer

Constructor & Destructor Documentation

DataConsumer ( const char *  format = "slin")
inlineexplicit

Consumer constructor

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

Member Function Documentation

virtual unsigned long Consume ( const DataBlock data,
unsigned long  tStamp,
unsigned long  flags 
)
pure virtual

Consumes the data sent to it from a source

Parameters
dataThe raw data block to process
tStampTimestamp of data - typically samples
flagsIndicator flags associated with the data block
Returns
Number of samples actually consumed, use invalidStamp() to indicate that all data was consumed, return zero for consumers that become invalid
virtual void destroyed ( )
virtual

Destruct notification - complains loudly if still attached to a source

Reimplemented from RefObject.

DataSource* getConnSource ( ) const
inline

Get the data source of this object if it's connected

Returns
A pointer to the DataSource object or NULL
virtual void* getObject ( const String name) const
virtual

Get a pointer to a derived class given that class name

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

Reimplemented from RefObject.

Reimplemented in DataTranslator.

DataSource* getOverSource ( ) const
inline

Get the override data source of this object if it's connected

Returns
A pointer to the DataSource object or NULL
virtual DataSource* getTransSource ( ) const
inlinevirtual

Get the data source of a translator object

Returns
A pointer to the DataSource object or NULL

Reimplemented in DataTranslator.

virtual bool synchronize ( DataSource source)
protectedvirtual

Synchronize the consumer with a source

Parameters
sourceData source to copy the timestamp from
Returns
True if we could synchronize with the source

Reimplemented in DataTranslator.


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