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

lti::asciiHexCodec Class Reference

Encodes a byte array to an array of hexadecimal digits or performs the corresponding decoding method, depending on the parameters. More...

#include <ltiAsciiHexCodec.h>

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

List of all members.

Public Member Functions

 asciiHexCodec ()
 asciiHexCodec (const parameters &par)
 asciiHexCodec (const asciiHexCodec &other)
virtual ~asciiHexCodec ()
virtual const char * getTypeName () const
asciiHexCodeccopy (const asciiHexCodec &other)
asciiHexCodecoperator= (const asciiHexCodec &other)
virtual functorclone () const
virtual int estimateEncodedSize (int originalSize) const
virtual int estimateDecodedSize (int originalSize) const

Protected Member Functions

virtual bool decodeImplementation (const buffer &src, buffer &dest, int nsrc, int &ndest) const
virtual bool encodeImplementation (const buffer &src, buffer &dest, int nsrc, int &ndest) const

Detailed Description

Encodes a byte array to an array of hexadecimal digits or performs the corresponding decoding method, depending on the parameters.


Constructor & Destructor Documentation

lti::asciiHexCodec::asciiHexCodec (  ) 

default constructor

lti::asciiHexCodec::asciiHexCodec ( const parameters par  ) 

Construct a functor using the given parameters.

lti::asciiHexCodec::asciiHexCodec ( const asciiHexCodec other  ) 

copy constructor

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

destructor


Member Function Documentation

virtual functor* lti::asciiHexCodec::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements lti::functor.

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

copy data of "other" functor.

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

Reimplemented from lti::dataCodec.

virtual bool lti::asciiHexCodec::decodeImplementation ( const buffer src,
buffer dest,
int  nsrc,
int &  ndest 
) const [protected, virtual]

Implementation of on-copy data decoder.

This method must not, under no circumstances, resize the destination vector.

Returns:
true if the decoding could be performed successfully.
Parameters:
src the source of the data.
dest the destination for the decoded data.
nsrc tells how many elements of the src vector must be decoded.
ndest tells how many elements of the destination vector can be used for the decoded data. When the method returns, this value tells how many elements were actually used, or notEnoughSpace if not enough elements were available.

Implements lti::dataCodec.

virtual bool lti::asciiHexCodec::encodeImplementation ( const buffer src,
buffer dest,
int  nsrc,
int &  ndest 
) const [protected, virtual]

Implementation of on-copy data encoder.

This method must not, under no circumstances, resize the destination vector.

Returns:
true if the decoding could be performed successfully.
Parameters:
src the source of the data.
dest the destination for the encoded data.
nsrc tells how many elements of the src vector must be decoded.
ndest tells how many elements of the destination vector can be used for the decoded data. When the method returns, this value tells how many elements were actually used, or notEnoughSpace if not enough elements were available.

Implements lti::dataCodec.

virtual int lti::asciiHexCodec::estimateDecodedSize ( int  originalSize  )  const [virtual]

Computes the default buffer size for decoded data.

The source of the original data buffer is given as argument. The default is to return the given value.

Parameters:
originalSize the size of the data buffer to be decoded
Returns:
the estimated size of the encoded data.

Reimplemented from lti::dataCodec.

virtual int lti::asciiHexCodec::estimateEncodedSize ( int  originalSize  )  const [virtual]

Computes the default buffer size for encoded data.

The source of the original data buffer is given as argument. The default is to return the given value.

Parameters:
originalSize the size of the data buffer to be encoded
Returns:
the estimated size of the encoded data.

Reimplemented from lti::dataCodec.

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

returns the name of this type ("asciiHexCodec")

Reimplemented from lti::dataCodec.

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

alias for copy member

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

Reimplemented from lti::dataCodec.


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

Generated on Sat Apr 10 15:27:59 2010 for LTI-Lib by Doxygen 1.6.1