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::cUnderFunction Class Reference

#include <cUnderFunction.h>

Inheritance diagram for fib::cUnderFunction:
Collaboration diagram for fib::cUnderFunction:

List of all members.

Public Member Functions

virtual ~cUnderFunction ()
virtual bool isValid () const =0
virtual bool isUsedVariable (const cFibVariable *variable) const =0
virtual set< cFibVariable * > getUsedVariables ()=0
virtual bool replaceVariable (cFibVariable *variableOld, cFibVariable *variableNew)=0
virtual doubleFib getValue () const =0
virtual unsignedIntFib getNumberOfUnderFunctions () const =0
virtual cTypeElementgetElementType () const
virtual cDomainSinglegetDomain () const
virtual cDomainSinglegetValueDomain () const
virtual cDomainSinglegetStandardDomain () const
virtual cDomainSinglegetVariableDomain () const
cFibElementgetDefiningFibElement () const
cUnderFunctiongetSuperiorUnderFunction () const
virtual void setDefiningFibElement (cFibElement *fibElement=NULL, bool bCheckDomains=true)
virtual unsignedLongFib getTimeNeed (unsignedLongFib lMaxTime=0) const =0
virtual unsignedLongFib getCompressedSize () const =0
virtual bool storeXml (ostream &stream) const =0
virtual bool store (ostream &stream, char &cRestBits, unsigned char &uiRestBitPosition) const =0
virtual unsignedIntFib getType () const =0
virtual string getUnderFunctionName () const =0
virtual bool equal (const cUnderFunction &underfunction) const =0
virtual bool operator== (const cUnderFunction &underfunction) const
bool operator!= (const cUnderFunction &underfunction) const
virtual cUnderFunctionclone (cUnderFunction *pInSuperiorUnderFunction=NULL, cFibElement *pInDefiningFibElement=NULL) const =0

Static Public Member Functions

static cUnderFunctionrestoreXml (const TiXmlElement *pXmlElement, intFib &outStatus, list< cFibVariable * > &liDefinedVariables, cUnderFunction *pInSuperiorFunction=NULL, cFibElement *pInDefiningFibElement=NULL)
static cUnderFunctionrestore (cReadBits &iBitStream, intFib &outStatus, list< cFibVariable * > &liDefinedVariables, const cDomainSingle *pInValueDomain, const cDomainSingle *pInDomainVariable, cUnderFunction *pInSuperiorFunction=NULL, cFibElement *pInDefiningFibElement=NULL)

Static Public Attributes

static const unsignedIntFib FUNCTION_VALUE = 0
static const unsignedIntFib FUNCTION_VARIABLE = 1
static const unsignedIntFib FUNCTION_LOG = 10
static const unsignedIntFib FUNCTION_SIN = 11
static const unsignedIntFib FUNCTION_ABS = 12
static const unsignedIntFib FUNCTION_ARCSIN = 13
static const unsignedIntFib FUNCTION_ROUND = 14
static const unsignedIntFib FUNCTION_ADD = 20
static const unsignedIntFib FUNCTION_SUB = 21
static const unsignedIntFib FUNCTION_MULT = 22
static const unsignedIntFib FUNCTION_DIV = 23
static const unsignedIntFib FUNCTION_EXP = 24
static const unsignedIntFib FUNCTION_MIN = 25
static const unsignedIntFib FUNCTION_MAX = 26
static const unsignedIntFib FUNCTION_IF = 30
static const unsignedIntFib FUNCTION_MOD = 31

Protected Member Functions

 cUnderFunction (cUnderFunction *pInSuperiorUnderFunction=NULL, cFibElement *pInDefiningFibElement=NULL)
 cUnderFunction (const cUnderFunction &underfunction, cUnderFunction *pInSuperiorUnderFunction=NULL, cFibElement *pInDefiningFibElement=NULL)

Protected Attributes

cUnderFunctionpSuperiorUnderFunction
cFibElementpDefiningFibElement

Friends

class cFunction
class cFunctionIf
class cFunctionOneValue
class cFunctionTwoValue
class cConditionComparison

Detailed Description

Definition at line 69 of file cUnderFunction.h.


Constructor & Destructor Documentation

fib::cUnderFunction::cUnderFunction ( cUnderFunction pInSuperiorUnderFunction = NULL,
cFibElement pInDefiningFibElement = NULL 
)
protected

The constructor of the underfunction.

Parameters:
pInSuperiorUnderFunctionthe underfunction which contains
pInDefiningFibElementthe Fib-element which defines/ uses the new underfunction
fib::cUnderFunction::cUnderFunction ( const cUnderFunction underfunction,
cUnderFunction pInSuperiorUnderFunction = NULL,
cFibElement pInDefiningFibElement = NULL 
)
protected

The copy constructor of the underfunction.

Parameters:
underfunctionthe underfunction which to copy
pSuperiorUnderFunctionthe underfunction which contains
pInDefiningFibElementthe Fib-element which defines/ uses
virtual fib::cUnderFunction::~cUnderFunction ( )
virtual

The destructor of the underfunction.


Member Function Documentation

virtual cUnderFunction* fib::cUnderFunction::clone ( cUnderFunction pInSuperiorUnderFunction = NULL,
cFibElement pInDefiningFibElement = NULL 
) const
pure virtual

This method duplicates this whole underfunction. Underfunctions of this underfunction are also cloned.

Parameters:
pSuperiorUnderFunctionthe underfunction which contains the cloned underfunction
pInDefiningFibElementthe Fib-element which defines/ uses the cloned underfunction
Returns:
the cloned/ duplicated underfunction

Implemented in fib::cFunctionIf, fib::cFunctionVariable, fib::cFunctionValue, fib::cFunctionMod, fib::cFunctionArcsin, fib::cFunctionLog, fib::cFunctionRound, fib::cFunctionExp, fib::cFunctionMax, fib::cFunctionMin, fib::cFunctionAbs, fib::cFunctionSin, fib::cFunctionDiv, fib::cFunctionMult, fib::cFunctionSub, and fib::cFunctionAdd.

virtual bool fib::cUnderFunction::equal ( const cUnderFunction underfunction) const
pure virtual

This method checks if the given underfunction is equal to this underfunction.

Parameters:
underfunctionthe underfunction to compare with this underfunction
Returns:
true if the given underfunction is equal to this underfunction, else false

Implemented in fib::cFunctionTwoValue, fib::cFunctionIf, fib::cFunctionVariable, fib::cFunctionOneValue, and fib::cFunctionValue.

virtual unsignedLongFib fib::cUnderFunction::getCompressedSize ( ) const
pure virtual

This method evaluades the size of the Fib-object in bits in the compressed file form. The optionalpart field of point -elements will be ignored.

See also:
store()
Returns:
the size of the Fib-object in bits in the compressed form

Implemented in fib::cFunctionTwoValue, fib::cFunctionIf, fib::cFunctionOneValue, fib::cFunctionVariable, fib::cFunctionValue, fib::cFunctionMod, fib::cFunctionArcsin, fib::cFunctionLog, and fib::cFunctionRound.

cFibElement* fib::cUnderFunction::getDefiningFibElement ( ) const
Returns:
the Fib-element which defines/ uses this underfunction or a Nullpointer NULL if non such Fib-element exists
virtual cDomainSingle* fib::cUnderFunction::getDomain ( ) const
virtual

Returns a reference to the domain of the underfunction or the nullpointer NULL if no domain is defined for the underfunction. If the nullpointer NULL is returned the standarddomain is valid for the underfunction.

Returns:
a reference to the underfunctiondomain of the underfunction
virtual cTypeElement* fib::cUnderFunction::getElementType ( ) const
virtual

Returns the type of the underfunction. You have to delete the returned object after usage.

Returns:
the type of the underfunction
virtual unsignedIntFib fib::cUnderFunction::getNumberOfUnderFunctions ( ) const
pure virtual
Returns:
the number of underfunctions, a underfunction of this type has

Implemented in fib::cFunctionTwoValue, fib::cFunctionOneValue, fib::cFunctionVariable, and fib::cFunctionValue.

virtual cDomainSingle* fib::cUnderFunction::getStandardDomain ( ) const
virtual

Returns a reference to the standard domain of the underfunction. You have to delete the returned object after usage.

Returns:
a reference to the standard domain of the underfunction
cUnderFunction* fib::cUnderFunction::getSuperiorUnderFunction ( ) const
Returns:
the superior underfunction to this or NULL, if non such exists (the superior underfunction is the underfunction, which contains this underfunction)
virtual unsignedLongFib fib::cUnderFunction::getTimeNeed ( unsignedLongFib  lMaxTime = 0) const
pure virtual

This method evaluades a value for the time needed to evalue the underfunction. This value should not exceed lMaxTime, if the value for the time is greater than lMaxTime the evaluation will be stopt and lMaxTime returned. If lMaxTime is 0 (for infinity) the evaluation won't be stoped, this is the standard case.

See also:
cFibElement::evalueObject()
Parameters:
lMaxTimethe maximum time for the evaluation, the returned exceed this value; the value 0 stands for infinity, so the evaluation won't be stoped
Returns:
a value for the time needed to evalue this underfunction

Implemented in fib::cFunctionTwoValue, fib::cFunctionIf, fib::cFunctionOneValue, fib::cFunctionVariable, and fib::cFunctionValue.

virtual set<cFibVariable*> fib::cUnderFunction::getUsedVariables ( )
pure virtual

This method returns all variables used in this underfunction.

See also:
cFibVariable
Returns:
all variables used in this underfunction

Implemented in fib::cFunctionTwoValue, fib::cFunctionIf, fib::cFunctionOneValue, fib::cFunctionVariable, and fib::cFunctionValue.

virtual doubleFib fib::cUnderFunction::getValue ( ) const
pure virtual
virtual cDomainSingle* fib::cUnderFunction::getValueDomain ( ) const
virtual

Returns a reference to the value domain of the underfunction or the nullpointer NULL if no value domain is defined for the underfunction. If the nullpointer NULL is returned the standarddomain is valid for the underfunction.

Returns:
a reference to the definitionarea of the underfunction
virtual cDomainSingle* fib::cUnderFunction::getVariableDomain ( ) const
virtual

Returns a reference to the domain for variables of the underfunction. You have to delete the returned object after usage.

Returns:
a reference to the domain for variables of the underfunction
virtual bool fib::cUnderFunction::isUsedVariable ( const cFibVariable variable) const
pure virtual

This method checks if the given variable is used in this underfunction.

See also:
cFibVariable
Parameters:
variablethe variable to check if it is used
Returns:
true if the variable is used, else false

Implemented in fib::cFunctionTwoValue, fib::cFunctionIf, fib::cFunctionOneValue, fib::cFunctionVariable, and fib::cFunctionValue.

virtual bool fib::cUnderFunction::isValid ( ) const
pure virtual

This method returns if this underfunction is valid, else false. All values in the underfunction and it's underfunctions must be inside the underfunction domain. All variables must be defined over this underfunction. No underfunction should contain itself or should be contained in one of its underfunctions (no cycles allowed).

Returns:
true if this underfunction is valid, else false

Implemented in fib::cFunctionTwoValue, fib::cFunctionIf, fib::cFunctionOneValue, fib::cFunctionVariable, and fib::cFunctionValue.

bool fib::cUnderFunction::operator!= ( const cUnderFunction underfunction) const

This method checks if the given underfunction is not equal to this underfunction.

Parameters:
underfunctionthe underfunction to compare with this underfunction
Returns:
true if the given underfunction is not equal to this underfunction, else false
virtual bool fib::cUnderFunction::operator== ( const cUnderFunction underfunction) const
virtual

This method checks if the given underfunction is equal to this underfunction.

Parameters:
underfunctionthe underfunction to compare with this underfunction
Returns:
true if the given underfunction is equal to this underfunction, else false
virtual bool fib::cUnderFunction::replaceVariable ( cFibVariable variableOld,
cFibVariable variableNew 
)
pure virtual

This method replace the variable variableOld with the variable variableNew in the underfunction.

See also:
cFibVariable
isVariable()
isUsedVariable()
Parameters:
variableOldthe variable to replace
variableNewthe variable with which the variable variableOld is to replace
Returns:
true if the variable variableOld is replaced with variableNew, else false

Implemented in fib::cFunctionTwoValue, fib::cFunctionIf, fib::cFunctionOneValue, fib::cFunctionVariable, and fib::cFunctionValue.

static cUnderFunction* fib::cUnderFunction::restore ( cReadBits iBitStream,
intFib outStatus,
list< cFibVariable * > &  liDefinedVariables,
const cDomainSingle pInValueDomain,
const cDomainSingle pInDomainVariable,
cUnderFunction pInSuperiorFunction = NULL,
cFibElement pInDefiningFibElement = NULL 
)
static

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

See also:
store
Parameters:
iBitStreamthe stream where the underfunction is stored in, because the stream is an cReadBits, any number of bits can be readed from it
outStatusan 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
liDefinedVariablesa list with the defined variables for the to restore Fib-element, every variable should have it's number (the number under which it is stored) as it's value
pInValueDomainthe domain for value underfunction
pInDomainVariablethe domain for variables
pInSuperiorFunctionthe underfunction which contains the to restore underfunction
pInDefiningFibElementthe Fib-element which defines/ uses the to restore underfunction
Returns:
a pointer to the restored underfunction or NULL
static cUnderFunction* fib::cUnderFunction::restoreXml ( const TiXmlElement *  pXmlElement,
intFib outStatus,
list< cFibVariable * > &  liDefinedVariables,
cUnderFunction pInSuperiorFunction = NULL,
cFibElement pInDefiningFibElement = NULL 
)
static

This method restores a underfunction in the XML -format from an TinyXml element.

Parameters:
pXmlNodea pointer to the TinyXml node wher the underfunction is stored in
outStatusan 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
liDefinedVariablesa list with the defined variables for the to restore Fib-element, every variable should have it's number (the number under which it is stored) as it's value
pInSuperiorFunctionthe underfunction which contains the to restore underfunction
pInDefiningFibElementthe Fib-element which defines/ uses the to restore underfunction
Returns:
the pointers to the restored underfunction, if non could be restored the returned pointer is NULL
virtual void fib::cUnderFunction::setDefiningFibElement ( cFibElement fibElement = NULL,
bool  bCheckDomains = true 
)
virtual

Sets the Fib-element which defines/ uses this underfunction. If the given pointer is the nullpointer (standardvalue), no Fib-element defines this underfunction.

Parameters:
definingFibElementa pointer to the Fib-element which defines/ uses this underfunction
bCheckDomainsget the domains of the defining element and check the underfunctionelements with it

Reimplemented in fib::cFunctionTwoValue, fib::cFunctionIf, fib::cFunctionOneValue, and fib::cFunctionValue.

virtual bool fib::cUnderFunction::store ( ostream &  stream,
char &  cRestBits,
unsigned char &  uiRestBitPosition 
) const
pure virtual

This method stores this Fib-object in the compressed Fib-format into the given stream. It is needed becouse 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:
store
Parameters:
streamthe stream where this Fib-object 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 this Fib-object is stored, else false

Implemented in fib::cFunctionIf, fib::cFunctionVariable, fib::cFunctionValue, fib::cFunctionMod, fib::cFunctionArcsin, fib::cFunctionLog, fib::cFunctionRound, fib::cFunctionExp, fib::cFunctionMax, fib::cFunctionMin, fib::cFunctionAbs, fib::cFunctionSin, fib::cFunctionDiv, fib::cFunctionMult, fib::cFunctionSub, and fib::cFunctionAdd.

virtual bool fib::cUnderFunction::storeXml ( ostream &  stream) const
pure virtual

This method stores this underfunction in the XML -format into the given stream. Variables should have ther number as ther value.

Parameters:
streamthe stream where this underfunctionshould be stored to
Returns:
true if this underfunction is stored, else false

Implemented in fib::cFunctionTwoValue, fib::cFunctionIf, fib::cFunctionVariable, fib::cFunctionOneValue, and fib::cFunctionValue.


Friends And Related Function Documentation

friend class cConditionComparison
friend

Definition at line 75 of file cUnderFunction.h.

friend class cFunction
friend

Definition at line 71 of file cUnderFunction.h.

friend class cFunctionIf
friend

Definition at line 72 of file cUnderFunction.h.

friend class cFunctionOneValue
friend

Definition at line 73 of file cUnderFunction.h.

friend class cFunctionTwoValue
friend

Definition at line 74 of file cUnderFunction.h.


Member Data Documentation

const unsignedIntFib fib::cUnderFunction::FUNCTION_ABS = 12
static

Definition at line 86 of file cUnderFunction.h.

const unsignedIntFib fib::cUnderFunction::FUNCTION_ADD = 20
static

Definition at line 89 of file cUnderFunction.h.

const unsignedIntFib fib::cUnderFunction::FUNCTION_ARCSIN = 13
static

Definition at line 87 of file cUnderFunction.h.

const unsignedIntFib fib::cUnderFunction::FUNCTION_DIV = 23
static

Definition at line 92 of file cUnderFunction.h.

const unsignedIntFib fib::cUnderFunction::FUNCTION_EXP = 24
static

Definition at line 93 of file cUnderFunction.h.

const unsignedIntFib fib::cUnderFunction::FUNCTION_IF = 30
static

Definition at line 96 of file cUnderFunction.h.

const unsignedIntFib fib::cUnderFunction::FUNCTION_LOG = 10
static

Definition at line 84 of file cUnderFunction.h.

const unsignedIntFib fib::cUnderFunction::FUNCTION_MAX = 26
static

Definition at line 95 of file cUnderFunction.h.

const unsignedIntFib fib::cUnderFunction::FUNCTION_MIN = 25
static

Definition at line 94 of file cUnderFunction.h.

const unsignedIntFib fib::cUnderFunction::FUNCTION_MOD = 31
static

Definition at line 97 of file cUnderFunction.h.

const unsignedIntFib fib::cUnderFunction::FUNCTION_MULT = 22
static

Definition at line 91 of file cUnderFunction.h.

const unsignedIntFib fib::cUnderFunction::FUNCTION_ROUND = 14
static

Definition at line 88 of file cUnderFunction.h.

const unsignedIntFib fib::cUnderFunction::FUNCTION_SIN = 11
static

Definition at line 85 of file cUnderFunction.h.

const unsignedIntFib fib::cUnderFunction::FUNCTION_SUB = 21
static

Definition at line 90 of file cUnderFunction.h.

const unsignedIntFib fib::cUnderFunction::FUNCTION_VALUE = 0
static

the definitions for the underfunctions

Definition at line 82 of file cUnderFunction.h.

const unsignedIntFib fib::cUnderFunction::FUNCTION_VARIABLE = 1
static

Definition at line 83 of file cUnderFunction.h.

cFibElement* fib::cUnderFunction::pDefiningFibElement
protected

the Fib-element which defines/ uses the underfunction

Definition at line 109 of file cUnderFunction.h.

cUnderFunction* fib::cUnderFunction::pSuperiorUnderFunction
protected

the Fib-element which defines/ uses the underfunction

Definition at line 104 of file cUnderFunction.h.


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