sipxmedialib
Version 3.3
|
An abstraction definition of a stream data source. More...
#include <StreamDataSource.h>
Public Member Functions | |
Creators | |
StreamDataSource (int iFlags=0) | |
Constructors a StreamDataSource given optional flags. More... | |
virtual | ~StreamDataSource () |
Destructor. More... | |
Manipulators | |
virtual OsStatus | open ()=0 |
Opens the data source. More... | |
virtual OsStatus | close ()=0 |
Closes the data source. More... | |
virtual OsStatus | destroyAndDelete ()=0 |
Destroys and deletes the data source object. More... | |
virtual OsStatus | read (char *szBuffer, int iLength, int &iLengthRead)=0 |
virtual OsStatus | peek (char *szBuffer, int iLength, int &iLengthRead)=0 |
Identical to read, except the stream pointer is not advanced. More... | |
virtual OsStatus | interrupt () |
Interrupts any time consuming operation. More... | |
virtual OsStatus | seek (unsigned int iLocation)=0 |
Moves the stream pointer to the an absolute location. More... | |
void | setListener (StreamDataSourceListener *pListener) |
Accessors | |
virtual OsStatus | getLength (int &iLength)=0 |
Gets the length of the stream (if available) More... | |
virtual OsStatus | getPosition (int &iPosition)=0 |
Gets the current position within the stream. More... | |
virtual OsStatus | toString (UtlString &string)=0 |
Renders a string describing this data source. More... | |
int | getFlags () |
Gets the flags specified at time of construction. More... | |
Protected Member Functions | |
StreamDataSource (const StreamDataSource &rStreamDataSource) | |
Copy constructor (not supported) More... | |
StreamDataSource & | operator= (const StreamDataSource &rhs) |
Assignment operator (not supported) More... | |
void | fireEvent (StreamDataSourceEvent event) |
Fires a data source event to the interested consumer. More... | |
Private Attributes | |
StreamDataSourceListener * | mpListener |
data source listener More... | |
int | miFlags |
flags specified during construction More... | |
An abstraction definition of a stream data source.
StreamDataSource | ( | int | iFlags = 0 | ) |
Constructors a StreamDataSource given optional flags.
|
virtual |
Destructor.
|
protected |
Copy constructor (not supported)
|
pure virtual |
Opens the data source.
Implemented in StreamHttpDataSource, StreamBufferDataSource, and StreamFileDataSource.
|
pure virtual |
Closes the data source.
Implemented in StreamHttpDataSource, StreamBufferDataSource, and StreamFileDataSource.
|
pure virtual |
Destroys and deletes the data source object.
Implemented in StreamHttpDataSource, StreamBufferDataSource, and StreamFileDataSource.
|
pure virtual |
Reads iLength bytes of data from the data source and places the data into the passed szBuffer buffer.
szBuffer | - Buffer to place data |
iLength | - Max length to read |
iLengthRead | - The actual amount of data read. |
Implemented in StreamHttpDataSource, StreamBufferDataSource, and StreamFileDataSource.
|
pure virtual |
Identical to read, except the stream pointer is not advanced.
szBuffer | - Buffer to place data |
iLength | - Max length to read |
iLengthRead | - The actual amount of data read. |
Implemented in StreamHttpDataSource, StreamBufferDataSource, and StreamFileDataSource.
|
virtual |
Interrupts any time consuming operation.
For example, some data sources may require network access (e.g. http) to read or fetch data. Invoking an interrupt() will cause any time consuming or blocking calls to exit with more quickly with an OS_INTERRUPTED return code.
Reimplemented in StreamHttpDataSource.
|
pure virtual |
Moves the stream pointer to the an absolute location.
iLocation | - The desired seek location |
Implemented in StreamHttpDataSource, StreamBufferDataSource, and StreamFileDataSource.
void setListener | ( | StreamDataSourceListener * | pListener | ) |
Sets a listener to receive StreamDataSourceEvent events for this data source.
|
pure virtual |
Gets the length of the stream (if available)
Implemented in StreamHttpDataSource, StreamBufferDataSource, and StreamFileDataSource.
|
pure virtual |
Gets the current position within the stream.
Implemented in StreamHttpDataSource, StreamBufferDataSource, and StreamFileDataSource.
|
pure virtual |
Renders a string describing this data source.
Implemented in StreamHttpDataSource, StreamBufferDataSource, and StreamFileDataSource.
int getFlags | ( | ) |
Gets the flags specified at time of construction.
|
protected |
Assignment operator (not supported)
|
protected |
Fires a data source event to the interested consumer.
|
private |
data source listener
|
private |
flags specified during construction