MeVisLab Toolbox Reference
ml::DataCompressorFactory Class Reference

Factory for ML data compression algorithms. More...

#include <mlDataCompressorFactory.h>

Inheritance diagram for ml::DataCompressorFactory:
ml::Base

Static Public Member Functions

static DataCompressorcreateCompressor (const std::string &typeName, MLErrorCode *errCode=nullptr)
 Factory and registration support for data compressors.
static MLErrorCode registerCompressor (const RuntimeType *rtType)
static MLErrorCode unregisterCompressor (const RuntimeType &rtType)
static std::vector< CompressionRegisterEntry >::const_iterator findCompressorTypeConst (const std::string &typeName)
static std::vector< CompressionRegisterEntry >::const_iterator findCompressorTypeConst (const RuntimeType &rtType)
static const std::vector< CompressionRegisterEntry > & getRegisteredDataCompressors ()
 Provides constant access to the list of available DataCompressors.
static std::vector< std::string > getRegisteredDataCompressorNames ()
 Returns a list of all names of currently registered DataCompressors.

Static Protected Member Functions

static DataCompressor_createCompressor (const RuntimeType *rtType, MLErrorCode &err)
static std::vector< CompressionRegisterEntry >::iterator _findCompressorType (const std::string &typeName)
static std::vector< CompressionRegisterEntry >::iterator _findCompressorType (const RuntimeType &rtType)

Static Protected Attributes

static std::vector< CompressionRegisterEntry > _dataCompressorTypes
 The list of runtime types of available DataCompressors.

Additional Inherited Members

Public Types inherited from ml::Base
enum  PersistenceInterface { PersistenceByString , PersistenceByTreeNode , PersistenceByStream }
 This enum describes the different persistence interfaces available. More...
Public Member Functions inherited from ml::Base
 Base ()
 Constructor.
virtual ~Base ()
 Destructor.
virtual BasedeepCopy () const
bool isOfAllowedType (const std::vector< const RuntimeType * > &types) const
virtual bool isRefCountedBase () const
 Returns whether the instance is derived from RefCountedBase.
virtual std::string detailString () const
virtual bool implementsPersistence (PersistenceInterface) const
virtual std::string persistentState () const
 Returns a string describing the object's internal state.
virtual void setPersistentState (const std::string &state)
virtual void addStateToTree (TreeNode *) const
 Attaches the object state as children of the given parent node.
virtual void readStateFromTree (TreeNode *)
 Reads the object state from the children of the given parent node.
virtual void writeTo (AbstractPersistenceOutputStream *) const
virtual void readFrom (AbstractPersistenceInputStream *, int)

Detailed Description

Factory for ML data compression algorithms.

Definition at line 35 of file mlDataCompressorFactory.h.

Member Function Documentation

◆ _createCompressor()

DataCompressor * ml::DataCompressorFactory::_createCompressor ( const RuntimeType * rtType,
MLErrorCode & err )
staticprotected

Builds a data compressor instance from a runtime type, even if it is not registered.

Parameters
rtTypeMust be the valid runtime type of the class to be registered. The compressor class must be derived from DataCompressor.
errReturns ML_RESULT_OK in case of success; otherwise, it returns a code describing the problem.
Returns
A pointer to an instance of the compressor or NULL in error cases.

◆ _findCompressorType() [1/2]

std::vector< CompressionRegisterEntry >::iterator ml::DataCompressorFactory::_findCompressorType ( const RuntimeType & rtType)
staticprotected

Searches a compressor with type name and return its corresponding registration entry.

Parameters
rtTypeThe runtime type of the compressor class to find.
Returns
An iterator to the instance of the registered data compressor or _dataCompressorTypes.end() on failure.

◆ _findCompressorType() [2/2]

std::vector< CompressionRegisterEntry >::iterator ml::DataCompressorFactory::_findCompressorType ( const std::string & typeName)
staticprotected

Searches a compressor with type name and return its corresponding registration entry.

Parameters
typeNameThe name of the of the compressor class to find.
Returns
An iterator to the instance of the registered data compressor or _dataCompressorTypes.end() on failure.

◆ createCompressor()

DataCompressor * ml::DataCompressorFactory::createCompressor ( const std::string & typeName,
MLErrorCode * errCode = nullptr )
static

Factory and registration support for data compressors.

Creates a compressor of a given type or NULL on failure, for example, if the type does not exist. The created instance must be deleted with delete. For an empty typeName string, NULL is always returned.

Parameters
typeNameThe registered name of the compressor type to be created.
errCodeWill be ignored if NULL (the default). If non-NULL, it will return ML_RESULT_OK in case of success or another error code to describe the reason for the failure.
Returns
A pointer to a new instance of the registered data compressor or NULL on failure.

◆ findCompressorTypeConst() [1/2]

std::vector< CompressionRegisterEntry >::const_iterator ml::DataCompressorFactory::findCompressorTypeConst ( const RuntimeType & rtType)
static

Searches a compressor with type name and returns its corresponding registration entry.

Parameters
rtTypeThe runtime type of the compressor class to find.
Returns
A constant iterator to the instance of the registered data compressor or _dataCompressorTypes.end() on failure.

◆ findCompressorTypeConst() [2/2]

std::vector< CompressionRegisterEntry >::const_iterator ml::DataCompressorFactory::findCompressorTypeConst ( const std::string & typeName)
static

Searches a compressor with type name and returns its corresponding registration entry.

Parameters
typeNameThe name of the of the compressor class to find.
Returns
A constant iterator to the instance of the registered data compressor or _dataCompressorTypes.end() on failure.

◆ getRegisteredDataCompressorNames()

std::vector< std::string > ml::DataCompressorFactory::getRegisteredDataCompressorNames ( )
static

Returns a list of all names of currently registered DataCompressors.

◆ getRegisteredDataCompressors()

const std::vector< CompressionRegisterEntry > & ml::DataCompressorFactory::getRegisteredDataCompressors ( )
static

Provides constant access to the list of available DataCompressors.

◆ registerCompressor()

MLErrorCode ml::DataCompressorFactory::registerCompressor ( const RuntimeType * rtType)
static

Registers a data compressor.

Parameters
rtTypeMust be the valid RuntimeType of the class to be registered The compressor class must be derived from DataCompressor.
Returns
ML_RESULT_OK in case of success or a code describing the nature of the error.

◆ unregisterCompressor()

MLErrorCode ml::DataCompressorFactory::unregisterCompressor ( const RuntimeType & rtType)
static

Removes a registered data compressor.

Parameters
rtTypeThe runtime type of the class to be unregistered.
Returns
ML_RESULT_OK on successful unregistration of the compressor type or an MLErrorCode describing the problem.

Member Data Documentation

◆ _dataCompressorTypes

std::vector<CompressionRegisterEntry> ml::DataCompressorFactory::_dataCompressorTypes
staticprotected

The list of runtime types of available DataCompressors.

Definition at line 120 of file mlDataCompressorFactory.h.


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