LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::dataTransformer Class Reference

This is the low-level base class for data transformers. More...

#include <ltiDataTransformer.h>

Inheritance diagram for lti::dataTransformer:
Inheritance graph
[legend]
Collaboration diagram for lti::dataTransformer:
Collaboration graph
[legend]

List of all members.

Classes

class  buffer
 The buffers with the data to be transformed (or the transformed data) are manipulated in container instances of the buffer type. More...

Public Types

typedef ubyte bufferElement

Public Member Functions

 dataTransformer ()
 dataTransformer (const parameters &par)
 dataTransformer (const dataTransformer &other)
virtual ~dataTransformer ()
virtual const char * getTypeName () const
virtual bool apply (bufferElement *srcdest, int nsrc, int &ndest) const =0
virtual bool apply (buffer &srcdest) const =0
virtual bool apply (const bufferElement *src, int nsrc, bufferElement *dest, int &ndest) const =0
virtual bool apply (const buffer &src, buffer &dest) const =0
dataTransformercopy (const dataTransformer &other)
dataTransformeroperator= (const dataTransformer &other)
const parametersgetParameters () const

Detailed Description

This is the low-level base class for data transformers.

Most notable examples for such transformers are coding or encryption functors. This an abstract class.


Member Typedef Documentation

Type for the elements in a buffer must be restricted to unsigned bytes.


Constructor & Destructor Documentation

lti::dataTransformer::dataTransformer (  ) 

default constructor

lti::dataTransformer::dataTransformer ( const parameters par  ) 

Construct a functor using the given parameters.

lti::dataTransformer::dataTransformer ( const dataTransformer other  ) 

copy constructor

Parameters:
other the object to be copied
virtual lti::dataTransformer::~dataTransformer (  )  [virtual]

destructor


Member Function Documentation

virtual bool lti::dataTransformer::apply ( const buffer src,
buffer dest 
) const [pure virtual]

Operates on the given argument.

Parameters:
src vector with the input data. All elements of the vector are transformed.
dest vector which will receive the transformed data. The vector is resized so that it fits the data.
Returns:
true if apply successful or false otherwise.

Implemented in lti::dataCodec.

virtual bool lti::dataTransformer::apply ( const bufferElement src,
int  nsrc,
bufferElement dest,
int &  ndest 
) const [pure virtual]

Operates on a copy of the given arguments.

Parameters:
src pointer to an array of bufferElement which contains the source data
nsrc the number of input bytes that should be transformed.
dest pointer to an array of bufferElement which will receive the transformed data. The array must be allocated by the caller.
ndest When called, must contain the size of the output buffer. When the function returns, it contains the number of bytes actually used, or -1 if the buffer was too small.
Returns:
true if apply successful or false otherwise.

Implemented in lti::dataCodec.

virtual bool lti::dataTransformer::apply ( buffer srcdest  )  const [pure virtual]

Operates on the given argument.

Parameters:
srcdest vector with the input data which will also receive the transformed data. The vector will be resized to fit the transformed data.
Returns:
true if apply successful or false otherwise.

Implemented in lti::dataCodec.

virtual bool lti::dataTransformer::apply ( bufferElement srcdest,
int  nsrc,
int &  ndest 
) const [pure virtual]

Operates on the given arguments.

Parameters:
srcdest pointer to an array of bufferElement. The input array must be allocated and have enough space for input as well as output data.
nsrc the number of input bytes that should be transformed.
ndest The caller must set this to the number of bytes of the buffer that can be used for the result. After returning, it will contain the number of bytes that are actually used. If buffer was too small, it will contain notEnoughSpace.
Returns:
true if apply successful or false otherwise.

Implemented in lti::dataCodec.

dataTransformer& lti::dataTransformer::copy ( const dataTransformer other  ) 

copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

Reimplemented in lti::ascii85Codec, lti::asciiHexCodec, lti::binarizationCodec, lti::combinedCodec, lti::dataCodec, lti::identityCodec, and lti::runLengthCodec.

const parameters& lti::dataTransformer::getParameters (  )  const

returns used parameters

Reimplemented from lti::functor.

Reimplemented in lti::binarizationCodec, and lti::dataCodec.

virtual const char* lti::dataTransformer::getTypeName (  )  const [virtual]

returns the name of this type ("dataTransformer")

Reimplemented from lti::functor.

Reimplemented in lti::ascii85Codec, lti::asciiHexCodec, lti::binarizationCodec, lti::combinedCodec, lti::dataCodec, lti::identityCodec, and lti::runLengthCodec.

dataTransformer& lti::dataTransformer::operator= ( const dataTransformer other  ) 

alias for copy member

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

Reimplemented in lti::ascii85Codec, lti::asciiHexCodec, lti::binarizationCodec, lti::combinedCodec, lti::dataCodec, lti::identityCodec, and lti::runLengthCodec.


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

Generated on Sat Apr 10 15:28:01 2010 for LTI-Lib by Doxygen 1.6.1