The Fib multimedia system
Fib is a system for storing multimedia data (like images or films).
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
fib::cDomainIntegerBasis Class Reference

#include <cDomainIntegerBasis.h>

Inheritance diagram for fib::cDomainIntegerBasis:
Collaboration diagram for fib::cDomainIntegerBasis:

List of all members.

Public Member Functions

doubleFib getScalingFactor () const
doubleFib scale (const longFib lValue) const
virtual bool operator== (const cDomain &domain) const
virtual bool isUnscaledElement (const longFib dValue) const =0
virtual longFib roundUnscaled (const longFib lValue) const =0
virtual longFib getMaximumUnscaled () const =0
virtual longFib getMinimumUnscaled () const =0
virtual longFib getNullUnscaled () const =0
virtual cDomainIntegerBasisclone () const =0
virtual bool storeUnscaledValue (longFib lValue, ostream &stream, char &cRestBits, unsigned char &uiRestBitPosition) const =0
virtual doubleFib restoreValue (cReadBits &iBitStream, intFib &outStatus) const
virtual longFib restoreIntegerValue (cReadBits &iBitStream, intFib &outStatus) const =0
- Public Member Functions inherited from fib::cDomainSingle
virtual bool isScalar () const
virtual bool isVector () const
virtual bool isElement (const doubleFib dValue) const =0
virtual bool isInBoundaries (const doubleFib dValue) const =0
virtual doubleFib round (const doubleFib dValue) const =0
virtual doubleFib getMaximum () const =0
virtual doubleFib getMinimum () const =0
virtual doubleFib getNull () const =0
virtual unsignedIntFib getCompressedSizeForValue () const =0
virtual bool storeValue (doubleFib dValue, ostream &stream, char &cRestBits, unsigned char &uiRestBitPosition) const =0
- Public Member Functions inherited from fib::cDomain
virtual ~cDomain ()=0
virtual string getType () const =0
virtual bool isReference () const
virtual bool equal (const cDomain &domain) const
virtual unsignedIntFib getCompressedSize () const =0
virtual bool storeXml (ostream &ostream) const =0
virtual intFib restoreXml (const TiXmlElement *pXmlElement)=0
virtual bool store (ostream &stream, char &cRestBits, unsigned char &uiRestBitPosition) const =0
virtual intFib restore (cReadBits &iBitStream)=0

Static Public Member Functions

static cDomainIntegerBasiscreateGoodDomain (const list< longFib > &liValues)
- Static Public Member Functions inherited from fib::cDomainSingle
static cDomainSinglecreateGoodDomain (list< doubleFib > &liValues)
- Static Public Member Functions inherited from fib::cDomain
static cDomainrestoreXml (const TiXmlElement *pXmlElement, intFib &outStatus)
static cDomainrestore (cReadBits &iBitStream, intFib &outStatus)

Protected Member Functions

 cDomainIntegerBasis (const doubleFib dInScalingFactor)
unsigned int getCompressedSizeForScalingFactor () const
bool storeScalingFactor (ostream &stream, char &cRestBits, unsigned char &uiRestBitPosition) const
intFib restoreScalingFactor (cReadBits &iBitStream)
doubleFib setXmlScaling (const char *szXmlScalingFactor)

Protected Attributes

doubleFib dScalingFactor

Detailed Description

Definition at line 52 of file cDomainIntegerBasis.h.


Constructor & Destructor Documentation

fib::cDomainIntegerBasis::cDomainIntegerBasis ( const doubleFib  dInScalingFactor)
protected

The constructor for scalar/ number domains.

Parameters:
dInScalingFactorthe scaling factor for the domain the scaling factor has to be greater 0.0

Member Function Documentation

virtual cDomainIntegerBasis* fib::cDomainIntegerBasis::clone ( ) const
pure virtual

This Method clones this object.

Returns:
a clone of this object

Implements fib::cDomainSingle.

Implemented in fib::cDomainInteger, fib::cDomainIntegerBit, fib::cDomainNaturalNumber, and fib::cDomainNaturalNumberBit.

static cDomainIntegerBasis* fib::cDomainIntegerBasis::createGoodDomain ( const list< longFib > &  liValues)
static

This function creates creates a good domain wich contains all the numbers of the given list liValues. A domain is better than an other domain, if it takes less storage bits to store the numbers and the domain. Beware: You have to care that the returned domain is deleted. (if one was returned)

Parameters:
liValuesthe list with the values, for which a domain is to create
Returns:
a new domain which contains all the given values liValues
unsigned int fib::cDomainIntegerBasis::getCompressedSizeForScalingFactor ( ) const
protected

This method evaluades the size for the scaling factor in bits in the compressed file form.

See also:
storeScalingFactor()
Returns:
the size of the domain in bits in the compressed form
virtual longFib fib::cDomainIntegerBasis::getMaximumUnscaled ( ) const
pure virtual

This method returns the biggest value in the unscaled domain.

Returns:
the biggest value in the unscaled domain

Implemented in fib::cDomainInteger, fib::cDomainIntegerBit, fib::cDomainNaturalNumber, and fib::cDomainNaturalNumberBit.

virtual longFib fib::cDomainIntegerBasis::getMinimumUnscaled ( ) const
pure virtual

This method returns the smalest value in the unscaled domain.

Returns:
the smalest value in the unscaled domain

Implemented in fib::cDomainInteger, fib::cDomainIntegerBit, fib::cDomainNaturalNumber, and fib::cDomainNaturalNumberBit.

virtual longFib fib::cDomainIntegerBasis::getNullUnscaled ( ) const
pure virtual

This method returns the nullvalue of the unscaled domain. The nullvalue is the value 0 rounded to an value in the unscaled domain.

Returns:
the nullvalue of the domain

Implemented in fib::cDomainInteger, fib::cDomainIntegerBit, fib::cDomainNaturalNumber, and fib::cDomainNaturalNumberBit.

doubleFib fib::cDomainIntegerBasis::getScalingFactor ( ) const

This method returns the scalingfactor of the domain.

Returns:
the scalingfactor of the domain
virtual bool fib::cDomainIntegerBasis::isUnscaledElement ( const longFib  dValue) const
pure virtual

This method checks if the given value is an element of the unscaled domain. If the value dValue is an element of the unscaled domain true is returned, else false.

Parameters:
dValuethe value for which to check, if it is an element of the unscaled domain
Returns:
if the value dValue is an element of the unscaled domain true true is returned, else false

Implemented in fib::cDomainInteger, fib::cDomainIntegerBit, fib::cDomainNaturalNumber, and fib::cDomainNaturalNumberBit.

virtual bool fib::cDomainIntegerBasis::operator== ( const cDomain domain) const
virtual

This Method checks if the given domain is equal to this domain.

Parameters:
domainthe domain which should be equal to this domain
Returns:
true if the given domain is equal to this domain, else false

Reimplemented from fib::cDomain.

Reimplemented in fib::cDomainInteger, fib::cDomainIntegerBit, fib::cDomainNaturalNumber, and fib::cDomainNaturalNumberBit.

virtual longFib fib::cDomainIntegerBasis::restoreIntegerValue ( cReadBits iBitStream,
intFib outStatus 
) const
pure virtual

This method restores the a unscaled integer value of the domain from the stream iBitStream, wher it is stored in the compressed fib -format.

See also:
storeValue
restoreValue
storeUnscaledValue
cFibElement::restore
Parameters:
iBitStreamthe stream where this value is stored to in, because this stream is an cReadBits, any number of bits can be readed from it
outStatusAn reference to an integervalue where the errorvalue can be stored to. If the pointer is NULL no errorvalue will be given back. possible errorvalues are:
  • 0 loading successful
  • -1 loading error, invalid stream
  • -2 loading error, invalid data in stream
  • 1 loading warning, invalid data in stream, error could be corrected
  • 2 loading warning, invalid data in stream, maybe the loaded object is wrong

Implemented in fib::cDomainInteger, fib::cDomainIntegerBit, fib::cDomainNaturalNumber, and fib::cDomainNaturalNumberBit.

intFib fib::cDomainIntegerBasis::restoreScalingFactor ( cReadBits iBitStream)
protected

This method restores the scalingfactore from a bitstream, wher it is stored in the compressed fib -format.

See also:
storeScalingFactor
restore
Parameters:
iBitStreamthe stream where the scalingfactore is stored in, because the stream is an cReadBits, any number of bits can be readed from it
Returns:
an integervalue with the errorvalue possible errorvalues are:
  • 0 loading successful
  • -1 loading error, invalid pXmlElement
  • -2 loading error, invalid data in pXmlElement
  • 1 loading warning, invalid data in pXmlElement, error could be corrected
  • 2 loading warning, invalid data in pXmlElement, maybe the loaded object is wrong
virtual doubleFib fib::cDomainIntegerBasis::restoreValue ( cReadBits iBitStream,
intFib outStatus 
) const
virtual

This method restores the a value of the domain from the stream iBitStream wher it is stored in the compressed fib -format.

See also:
storeValue
cFibElement::restore
Parameters:
iBitStreamthe stream where this value is stored to in, because this stream is an cReadBits, any number of bits can be readed from it
outStatusAn reference to an integervalue where the errorvalue can be stored to. If the pointer is NULL no errorvalue will be given back. possible errorvalues are:
  • 0 loading successful
  • -1 loading error, invalid stream
  • -2 loading error, invalid data in stream
  • 1 loading warning, invalid data in stream, error could be corrected
  • 2 loading warning, invalid data in stream, maybe the loaded object is wrong

Implements fib::cDomainSingle.

virtual longFib fib::cDomainIntegerBasis::roundUnscaled ( const longFib  lValue) const
pure virtual

This method round the given value dValue to an value in the unscaled domain of this object. The rounded vale will be the unscaled value with the minimal distance to the given value lValue. If more of these exists the smales will be returned.

Parameters:
lValuethe value which should be rounded
Returns:
the rounded unscaled value of lValue

Implemented in fib::cDomainInteger, fib::cDomainIntegerBit, fib::cDomainNaturalNumber, and fib::cDomainNaturalNumberBit.

doubleFib fib::cDomainIntegerBasis::scale ( const longFib  lValue) const

This method returns the scaled value of the given value lValue.

Parameters:
lValuethe value to scale
Returns:
the scaled value of the given value lValue
doubleFib fib::cDomainIntegerBasis::setXmlScaling ( const char *  szXmlScalingFactor)
protected

This function sets the scalingfactor. The scalingfactor is given as the scalingfactor in xml -format.

Parameters:
szXmlScalingFactorthe scalingfactor readed from an fib -xml -format
bool fib::cDomainIntegerBasis::storeScalingFactor ( ostream &  stream,
char &  cRestBits,
unsigned char &  uiRestBitPosition 
) const
protected

This method stores the scalingfactor of this domain in the compressed fib -format into the given stream. It is needed because the stream can yust store byts but the size of fib -elements can be any number of bits. Because of that ther have to be a possibility to exchange the missing bits betwean the fib -elements.

See also:
cFibElement::store
Parameters:
streamthe stream where this domain should be stored to
cRestBitsthe not yet writen bits which should be stored
uiRestBitPositionthe number of bits in the cRestBits which should be writen respectively containing valid information
Returns:
true if the scalingfactor of the domain is stored, else false
virtual bool fib::cDomainIntegerBasis::storeUnscaledValue ( longFib  lValue,
ostream &  stream,
char &  cRestBits,
unsigned char &  uiRestBitPosition 
) const
pure virtual

This method stores the given unscaled value lValue in the compressed fib -format for the domain into the given stream. It is needed because the stream can yust store byts but the size of fib -elements can be any number of bits. Because of that ther have to be a possibility to exchange the missing bits betwean the fib -elements.

See also:
cFibElement::store
Parameters:
lValuethe value to store
streamthe stream where this domain should be stored to
cRestBitsthe not yet writen bits which should be stored
uiRestBitPositionthe number of bits in the cRestBits which should be writen respectively containing valid information
Returns:
true if the domain is stored, else false

Implemented in fib::cDomainInteger, fib::cDomainIntegerBit, fib::cDomainNaturalNumber, and fib::cDomainNaturalNumberBit.


Member Data Documentation

doubleFib fib::cDomainIntegerBasis::dScalingFactor
protected

The scaling factor for the integer domains.

Definition at line 57 of file cDomainIntegerBasis.h.


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