latest version v1.9 - last update 10 Apr 2010 |
This is the low-level base class for data transformers. More...
#include <ltiDataTransformer.h>
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 |
dataTransformer & | copy (const dataTransformer &other) |
dataTransformer & | operator= (const dataTransformer &other) |
const parameters & | getParameters () const |
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.
Type for the elements in a buffer must be restricted to unsigned bytes.
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
other | the object to be copied |
virtual lti::dataTransformer::~dataTransformer | ( | ) | [virtual] |
destructor
Operates on the given argument.
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. |
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.
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. |
Implemented in lti::dataCodec.
virtual bool lti::dataTransformer::apply | ( | buffer & | srcdest | ) | const [pure virtual] |
Operates on the given argument.
srcdest | vector with the input data which will also receive the transformed data. The vector will be resized to fit the transformed data. |
Implemented in lti::dataCodec.
virtual bool lti::dataTransformer::apply | ( | bufferElement * | srcdest, | |
int | nsrc, | |||
int & | ndest | |||
) | const [pure virtual] |
Operates on the given arguments.
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. |
Implemented in lti::dataCodec.
dataTransformer& lti::dataTransformer::copy | ( | const dataTransformer & | other | ) |
copy data of "other" functor.
other | the functor to be copied |
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
other | the functor to be copied |
Reimplemented from lti::functor.
Reimplemented in lti::ascii85Codec, lti::asciiHexCodec, lti::binarizationCodec, lti::combinedCodec, lti::dataCodec, lti::identityCodec, and lti::runLengthCodec.