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)
 Remove a registered data compressor. More...
 
static std::vector< CompressionRegisterEntry >::const_iterator findCompressorTypeConst (const std::string &typeName)
 Search a compressor with type name and return its corresponding registration entry. More...
 
static std::vector< CompressionRegisterEntry >::const_iterator findCompressorTypeConst (const RuntimeType &rtType)
 Search a compressor with type name and return 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 list of all names of currently registered DataCompressors. More...
 

Static Protected Member Functions

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

Static Protected Attributes

static std::vector< CompressionRegisterEntry > _dataCompressorTypes
 The list of RuntimeTypes 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
 Set addStateToTree version number that can be accessed via getAddStateVersion() More...
 
bool isOfAllowedType (const std::vector< const RuntimeType * > &types) const
 Check if this object's type is equal to or derived from one of the types given in the argument. More...
 
virtual bool isRefCountedBase () const
 Returns if the instance is derived from RefCountedBase. More...
 
virtual std::string detailString () const
 Return 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
 Write the objects state to the data stream object. More...
 
virtual void readFrom (AbstractPersistenceInputStream *, int)
 Read the objects state from the data stream object. More...
 
- Protected Member Functions inherited from ml::Base
virtual char * getPersistentState () const
 Returns a C string describing the object's internal state. More...
 
virtual void setPersistentState (const char *)
 Restores the object's internal state from a string that had been previously generated using getPersistentState(). More...
 
virtual void clearPersistentState (char *) const
 Disposes a string previously allocated by getPersistentState(). 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

Build a data compressor instance from a RumtimeType, even if it is not registered.

Parameters
rtTypemust be the valid RuntimeType of the class to be registered The compressor class must be derived from DataCompressor.
errreturns ML_RESULT_OK in case of success, otherwise 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

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

Parameters
rtTypeis the 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

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

Parameters
typeNameis the 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. On an empty typeName string always NULL is returned.

Parameters
typeNameis the 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

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

Parameters
rtTypeis the 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

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

Parameters
typeNameis the 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 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

Remove a registered data compressor.

Parameters
rtTypeis the RuntimeType 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 RuntimeTypes of available DataCompressors.

Definition at line 120 of file mlDataCompressorFactory.h.


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