class DataTranslator

An unidirectional data translator (codec). More...

Full nameTelEngine::DataTranslator
Definition#include <telephony.h>
InheritsTelEngine::DataConsumer [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Static Methods

Protected Static Methods


Detailed Description

The DataTranslator holds a translator (codec) capable of unidirectional conversion of data from one type to another

 DataTranslator (const char *sFormat, const char *dFormat)

DataTranslator

Construct a data translator

Parameters:
sFormatName of the source format (data received from the consumer)
dFormatName of the destination format (data supplied to the source)

 DataTranslator (const char *sFormat, DataSource *source = 0)

DataTranslator

Creates a data translator from an existing source does not increment the source's reference counter

Parameters:
sFormatName of the source format (data received from the consumer)
sourceOptional pointer to a DataSource object

 ~DataTranslator ()

~DataTranslator

Destroys the translator and its source

DataSource * getTransSource ()

getTransSource

[const virtual]

Get the data source of a translator object

Returns: A pointer to the DataSource object or NULL

Reimplemented from DataConsumer.

String  srcFormats (const String &dFormat = "slin")

srcFormats

[static]

Get a textual list of formats supported for a given output format

Parameters:
dFormatName of destination format

Returns: Space separated list of source formats

String  destFormats (const String &sFormat = "slin")

destFormats

[static]

Get a textual list of formats supported for a given input format

Parameters:
sFormatName of source format

Returns: Space separated list of destination formats

int  cost (const String &sFormat, const String &dFormat)

cost

[static]

Finds the cost of a translator given the source and destination format names

Parameters:
sFormatName of the source format (data received from the consumer)
dFormatName of the destination format (data supplied to the source)

Returns: Cost of best (cheapest) codec or -1 if no known codec exists

DataTranslator * create (const String &sFormat, const String &dFormat)

create

[static]

Creates a translator given the source and destination format names

Parameters:
sFormatName of the source format (data received from the consumer)
dFormatName of the destination format (data supplied to the source)

Returns: A pointer to a DataTranslator object or NULL if no known codec exists

bool  attachChain (DataSource *source, DataConsumer *consumer)

attachChain

[static]

Attach a consumer to a source, possibly trough a chain of translators

Parameters:
sourceSource to attach the chain to
consumerConsumer where the chain ends

Returns: True if successfull, false if no translator chain could be built

bool  detachChain (DataSource *source, DataConsumer *consumer)

detachChain

[static]

Detach a consumer from a source, possibly trough a chain of translators

Parameters:
sourceSource to dettach the chain from
consumerConsumer where the chain ends

Returns: True if successfull, false if source and consumers were not attached

void  install (TranslatorFactory *factory)

install

[protected static]

Install a Translator Factory in the list of known codecs

Parameters:
factoryA pointer to a TranslatorFactory instance

void  uninstall (TranslatorFactory *factory)

uninstall

[protected static]

Remove a Translator Factory from the list of known codecs

Parameters:
factoryA pointer to a TranslatorFactory instance


Generated by: kk on nyx on Sat Jun 4 19:29:41 2005, using kdoc 2.0a54.