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. More...
 
static MLErrorCode registerCompressor (const RuntimeType *rtType)
 Registers a data compressor. More...
 
static MLErrorCode unregisterCompressor (const RuntimeType &rtType)
 Removes a registered data compressor. More...
 
static std::vector< CompressionRegisterEntry >::const_iterator findCompressorTypeConst (const std::string &typeName)
 Searches a compressor with type name and returns its corresponding registration entry. More...
 
static std::vector< CompressionRegisterEntry >::const_iterator findCompressorTypeConst (const RuntimeType &rtType)
 Searches a compressor with type name and returns its corresponding registration entry. More...
 
static const std::vector< CompressionRegisterEntry > & getRegisteredDataCompressors ()
 Provides constant access to the list of available DataCompressors. More...
 
static std::vector< std::string > getRegisteredDataCompressorNames ()
 Returns a list of all names of currently registered DataCompressors. More...
 

Static Protected Member Functions

static DataCompressor_createCompressor (const RuntimeType *rtType, MLErrorCode &err)
 Builds a data compressor instance from a runtime type, even if it is not registered. More...
 
static std::vector< CompressionRegisterEntry >::iterator _findCompressorType (const std::string &typeName)
 Searches a compressor with type name and return its corresponding registration entry. More...
 
static std::vector< CompressionRegisterEntry >::iterator _findCompressorType (const RuntimeType &rtType)
 Searches a compressor with type name and return its corresponding registration entry. More...
 

Static Protected Attributes

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

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. More...
 
virtual ~Base ()
 Destructor. More...
 
virtual BasedeepCopy () const
 Creates a deep copy of the given object. More...
 
bool isOfAllowedType (const std::vector< const RuntimeType * > &types) const
 Checks whether this object's type is equal to or derived from one of the types given in the argument. More...
 
virtual bool isRefCountedBase () const
 Returns whether the instance is derived from RefCountedBase. More...
 
virtual std::string detailString () const
 Returns a string describing this object. More...
 
virtual bool implementsPersistence (PersistenceInterface) const
 Override this method to declare which persistence interfaces are implemented by your derived class. More...
 
virtual std::string persistentState () const
 Returns a string describing the object's internal state. More...
 
virtual void setPersistentState (const std::string &state)
 Restores the object's internal state from a string that had been previously generated using persistentState(). More...
 
virtual void addStateToTree (TreeNode *) const
 Attaches the object state as children of the given parent node. More...
 
virtual void readStateFromTree (TreeNode *)
 Reads the object state from the children of the given parent node. More...
 
virtual void writeTo (AbstractPersistenceOutputStream *) const
 Writes the objects state to the data stream object. More...
 
virtual void readFrom (AbstractPersistenceInputStream *, int)
 Reads the objects state from the data stream object. More...
 

Detailed Description

Factory for ML data compression algorithms.

Definition at line 35 of file mlDataCompressorFactory.h.

Member Function Documentation

◆ _createCompressor()

static 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]

static 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]

static 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()

static 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]

static 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]

static 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()

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

Returns a list of all names of currently registered DataCompressors.

◆ getRegisteredDataCompressors()

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

Provides constant access to the list of available DataCompressors.

◆ registerCompressor()

static 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()

static 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: