imebra  build 2011-09-18_22-24-41
puntoexe::imebra::codecs::codecFactory Class Reference

This class maintains a list of the available codecs. More...

#include <codecFactory.h>

Inheritance diagram for puntoexe::imebra::codecs::codecFactory:
puntoexe::baseObject

List of all members.

Public Member Functions

void registerCodec (ptr< codec > pCodec)
 Register a new codec.
ptr< dataSetload (ptr< streamReader > pStream, imbxUint32 maxSizeBufferLoad=0xffffffff)
 Build a dataSet structure from the specified stream of data.

Static Public Member Functions

static ptr< codecgetCodec (std::wstring transferSyntax)
 Get a pointer to the codec that can handle the requested transfer syntax.
static ptr< codecFactorygetCodecFactory ()
 Retrieve the only reference to the codecFactory instance.

Detailed Description

This class maintains a list of the available codecs.

It is used to retrieve the right codec when the transfer syntax is known, or to automatically select the right codec that can parse the specified stream of data.

An instance of this class is automatically allocated by the library and can be retrieved using the static function codecFactory::getCodecFactory().


Member Function Documentation

ptr< codec > puntoexe::imebra::codecs::codecFactory::getCodec ( std::wstring  transferSyntax) [static]

Get a pointer to the codec that can handle the requested transfer syntax.

All the registered codecs are queried until the codec that can handle the specified transfer syntax replies.

A new instance of the requested codec is allocated and its pointer is returned.

Parameters:
transferSyntaxa string with the requested transfer syntax.
Returns:
a pointer to a imebra codec that can handle the requested transfer syntax, or 0 if the function didn't find any valid codec. The returned pointer references a new instance of the codec, not the instance registered using registerCodec()
ptr< codecFactory > puntoexe::imebra::codecs::codecFactory::getCodecFactory ( ) [static]

Retrieve the only reference to the codecFactory instance.

An instance of codecFactory class is statically allocated by the imebra framework.

The applications should use only the statically allocated instance of codecFactory.

Returns:
a pointer to the only instance of the codecFactory class.
ptr< dataSet > puntoexe::imebra::codecs::codecFactory::load ( ptr< streamReader pStream,
imbxUint32  maxSizeBufferLoad = 0xffffffff 
)

Build a dataSet structure from the specified stream of data.

The function selects automatically the codec that can read the specified stream.

Parameters:
pStreamthe stream that contain the data to be parsed
maxSizeBufferLoadif a loaded buffer exceedes the size in the parameter then it is not loaded immediatly but it will be loaded on demand. Some codecs may ignore this parameter. Set to 0xffffffff to load all the buffers immediatly
Returns:
a pointer to the dataSet containing the parsed data
void puntoexe::imebra::codecs::codecFactory::registerCodec ( ptr< codec pCodec)

Register a new codec.

This function is called by the framework during the library's startup, in order to register all the imebra codecs. The codecs distributed with the imebra library are automatically registered.

Parameters:
pCodeca pointer to the codec to register

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