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

#include <cFunctionIf.h>

Inheritance diagram for fib::cFunctionIf:
Collaboration diagram for fib::cFunctionIf:

List of all members.

Public Member Functions

 cFunctionIf (const cCondition &condition, const cUnderFunction &firstUnderfunction, const cUnderFunction &secondUnderfunction, cUnderFunction *pInSuperiorFunction=NULL, cFibElement *pInDefiningFibElement=NULL)
 cFunctionIf (cCondition *pInCondition, cUnderFunction *pInFirstUnderfunction, cUnderFunction *pInSecondUnderfunction, cUnderFunction *pInSuperiorFunction=NULL, cFibElement *pInDefiningFibElement=NULL)
 cFunctionIf (const cFunctionIf &underfunction, cUnderFunction *pInSuperiorFunction=NULL, cFibElement *pInDefiningFibElement=NULL)
 cFunctionIf (const TiXmlElement *pXmlElement, intFib &outStatus, list< cFibVariable * > &liDefinedVariables, cUnderFunction *pInSuperiorFunction=NULL, cFibElement *pInDefiningFibElement=NULL)
 cFunctionIf (cReadBits &iBitStream, intFib &outStatus, list< cFibVariable * > &liDefinedVariables, const cDomainSingle *pInDomainValue, const cDomainSingle *pInDomainVariable, cUnderFunction *pInSuperiorFunction=NULL, cFibElement *pInDefiningFibElement=NULL)
virtual ~cFunctionIf ()
virtual bool isValid () const
virtual bool isUsedVariable (const cFibVariable *pVariable) const
virtual set< cFibVariable * > getUsedVariables ()
virtual bool replaceVariable (cFibVariable *pVariableOld, cFibVariable *pVariableNew)
virtual void setDefiningFibElement (cFibElement *fibElement=NULL, bool bCheckDomains=true)
virtual unsignedLongFib getTimeNeed (unsignedLongFib lMaxTime=0) const
virtual unsignedLongFib getCompressedSize () const
virtual doubleFib getValue () const
virtual bool store (ostream &stream, char &cRestBits, unsigned char &uiRestBitPosition) const
virtual unsignedIntFib getType () const
virtual string getUnderFunctionName () const
virtual cFunctionIfclone (cUnderFunction *pInSuperiorUnderFunction=NULL, cFibElement *pInDefiningFibElement=NULL) const
virtual bool storeXml (ostream &stream) const
virtual bool equal (const cUnderFunction &underfunction) const
cConditiongetCondition ()
const cConditiongetCondition () const
bool setCondition (const cCondition &inCondition, bool bDeleteOld=true)
bool setCondition (cCondition *pInCondition, bool bDeleteOld=true)
- Public Member Functions inherited from fib::cFunctionTwoValue
 cFunctionTwoValue (const cUnderFunction &firstUnderfunction, const cUnderFunction &secondUnderfunction, cUnderFunction *pInSuperiorFunction=NULL, cFibElement *pInDefiningFibElement=NULL)
 cFunctionTwoValue (cUnderFunction *pInFirstUnderfunction, cUnderFunction *pInSecondUnderfunction, cUnderFunction *pInSuperiorFunction=NULL, cFibElement *pInDefiningFibElement=NULL)
 cFunctionTwoValue (const cFunctionTwoValue &underfunction, cUnderFunction *pInSuperiorFunction=NULL, cFibElement *pInDefiningFibElement=NULL)
 cFunctionTwoValue (const TiXmlElement *pXmlElement, intFib &outStatus, list< cFibVariable * > &liDefinedVariables, cUnderFunction *pInSuperiorFunction=NULL, cFibElement *pInDefiningFibElement=NULL)
 cFunctionTwoValue (cReadBits &iBitStream, intFib &outStatus, list< cFibVariable * > &liDefinedVariables, const cDomainSingle *pInDomainValue, const cDomainSingle *pInDomainVariable, cUnderFunction *pInSuperiorFunction=NULL, cFibElement *pInDefiningFibElement=NULL)
virtual ~cFunctionTwoValue ()
cUnderFunctiongetFirstUnderFunction ()
const cUnderFunctiongetFirstUnderFunction () const
void setFirstUnderFunction (const cUnderFunction &underFunction, bool bDeleteOld=true)
cUnderFunctiongetSecondUnderFunction ()
const cUnderFunctiongetSecondUnderFunction () const
void setSecondUnderFunction (const cUnderFunction &underFunction, bool bDeleteOld=true)
virtual unsignedIntFib getNumberOfUnderFunctions () const
- Public Member Functions inherited from fib::cUnderFunction
virtual ~cUnderFunction ()
virtual cTypeElementgetElementType () const
virtual cDomainSinglegetDomain () const
virtual cDomainSinglegetValueDomain () const
virtual cDomainSinglegetStandardDomain () const
virtual cDomainSinglegetVariableDomain () const
cFibElementgetDefiningFibElement () const
cUnderFunctiongetSuperiorUnderFunction () const
virtual bool operator== (const cUnderFunction &underfunction) const
bool operator!= (const cUnderFunction &underfunction) const

Private Attributes

cConditionpCondition

Additional Inherited Members

- Protected Attributes inherited from fib::cFunctionTwoValue
cUnderFunctionpFirstUnderfunction
cUnderFunctionpSecondUnderfunction
- Protected Attributes inherited from fib::cUnderFunction
cUnderFunctionpSuperiorUnderFunction
cFibElementpDefiningFibElement

Detailed Description

Definition at line 52 of file cFunctionIf.h.


Constructor & Destructor Documentation

fib::cFunctionIf::cFunctionIf ( const cCondition condition,
const cUnderFunction firstUnderfunction,
const cUnderFunction secondUnderfunction,
cUnderFunction pInSuperiorFunction = NULL,
cFibElement pInDefiningFibElement = NULL 
)

The constructor of the underfunction.

Parameters:
conditionthe condition for the function
See also:
pCondition
Parameters:
firstUnderfunctionthe first underfunction for the function
See also:
pFirstUnderfunction
Parameters:
secondUnderfunctionthe second underfunction for the function
See also:
pSecondUnderfunction
Parameters:
pInSuperiorFunctionthe underfunction which contains the new underfunction
pInDefiningFibElementthe fib -element which defines/ uses the new underfunction
fib::cFunctionIf::cFunctionIf ( cCondition pInCondition,
cUnderFunction pInFirstUnderfunction,
cUnderFunction pInSecondUnderfunction,
cUnderFunction pInSuperiorFunction = NULL,
cFibElement pInDefiningFibElement = NULL 
)

The constructor of the underfunction.

Parameters:
pInConditiona pointer to the condition for the function Beware: It (pInCondition) won't be copied.
See also:
pCondition
Parameters:
pInFirstUnderfunctiona pointer to the first underfunction for the function Beware: It (pInFirstUnderfunction) won't be copied.
See also:
pFirstUnderfunction
Parameters:
pInSecondUnderfunctiona pointer to the second underfunction for the function Beware: It (pInSecondUnderfunction) won't be copied.
See also:
pSecondUnderfunction
Parameters:
pInSuperiorFunctionthe underfunction which contains the new underfunction
pInDefiningFibElementthe fib -element which defines/ uses the new underfunction
fib::cFunctionIf::cFunctionIf ( const cFunctionIf underfunction,
cUnderFunction pInSuperiorFunction = NULL,
cFibElement pInDefiningFibElement = NULL 
)

The copy constructor of the underfunction. This constructor will also copy the underfunctions of the given function.

Parameters:
underfunctionthe underfunction which to copy
pInSuperiorFunctionthe underfunction which contains the new underfunction
pInDefiningFibElementthe fib -element which defines/ uses the new underfunction
fib::cFunctionIf::cFunctionIf ( const TiXmlElement *  pXmlElement,
intFib outStatus,
list< cFibVariable * > &  liDefinedVariables,
cUnderFunction pInSuperiorFunction = NULL,
cFibElement pInDefiningFibElement = NULL 
)

The constructor for restoring a value underfunction from an TinyXml element.

Parameters:
pXmlNodea pointer to the TinyXml node the underfunction is stored in
outStatusAn reference to an integervalue where the errorvalue can be stored to. 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 new underfunction
pInDefiningFibElementthe fib -element which defines/ uses the new underfunction
fib::cFunctionIf::cFunctionIf ( cReadBits iBitStream,
intFib outStatus,
list< cFibVariable * > &  liDefinedVariables,
const cDomainSingle pInDomainValue,
const cDomainSingle pInDomainVariable,
cUnderFunction pInSuperiorFunction = NULL,
cFibElement pInDefiningFibElement = NULL 
)

This constructor restores a value underfunction from the stream where it is stored in the compressed fib -format. Beware: The bits for the functiontype should be allready readed, this constructor reads yust the two underfunctions.

Parameters:
iBitStreamthe stream where this underfunction 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
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
pInDomainValuethe domain for value underfunction
pInDomainVariablethe domain for variables
pInSuperiorFunctionthe underfunction which contains the new underfunction
pInDefiningFibElementthe fib -element which defines/ uses the new underfunction
virtual fib::cFunctionIf::~cFunctionIf ( )
virtual

The destructor of the underfunction.


Member Function Documentation

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

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

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

Implements fib::cUnderFunction.

virtual bool fib::cFunctionIf::equal ( 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

Reimplemented from fib::cFunctionTwoValue.

virtual unsignedLongFib fib::cFunctionIf::getCompressedSize ( ) const
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

Reimplemented from fib::cFunctionTwoValue.

cCondition* fib::cFunctionIf::getCondition ( )
Returns:
This method returns a pointer to the condition of this function.
See also:
pCondition
const cCondition* fib::cFunctionIf::getCondition ( ) const
Returns:
This method returns a pointer to the condition of this function.
See also:
pCondition
virtual unsignedLongFib fib::cFunctionIf::getTimeNeed ( unsignedLongFib  lMaxTime = 0) const
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

Reimplemented from fib::cFunctionTwoValue.

virtual unsignedIntFib fib::cFunctionIf::getType ( ) const
virtual
Returns:
the type for the underfunction

Implements fib::cUnderFunction.

virtual string fib::cFunctionIf::getUnderFunctionName ( ) const
virtual
Returns:
the name for the underfunction

Implements fib::cUnderFunction.

virtual set<cFibVariable*> fib::cFunctionIf::getUsedVariables ( )
virtual

This method returns all variables used in this underfunction.

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

Reimplemented from fib::cFunctionTwoValue.

virtual doubleFib fib::cFunctionIf::getValue ( ) const
virtual

Returns the value of the underfunction or 0 if non such exists.

Returns:
the value of the underfunction or 0 if non such exists

Implements fib::cUnderFunction.

virtual bool fib::cFunctionIf::isUsedVariable ( const cFibVariable pVariable) const
virtual

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

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

Reimplemented from fib::cFunctionTwoValue.

virtual bool fib::cFunctionIf::isValid ( ) const
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 itselfor should be contained in one of its underfunctions (no cycles allowed).

Returns:
true if this underfunction is valid, else false

Reimplemented from fib::cFunctionTwoValue.

virtual bool fib::cFunctionIf::replaceVariable ( cFibVariable pVariableOld,
cFibVariable pVariableNew 
)
virtual

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

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

Reimplemented from fib::cFunctionTwoValue.

bool fib::cFunctionIf::setCondition ( const cCondition inCondition,
bool  bDeleteOld = true 
)

This methods sets the condition of this function.

See also:
pCondition
Parameters:
inConditionthe condition, which should be set as the condition of this function; the condition will be copied and the copy will be inserted
bDeleteOldif true the old condition will be deleted from memory, else the old condition should be deleted elsewhere
Returns:
true if inCondition condition was set, else false
bool fib::cFunctionIf::setCondition ( cCondition pInCondition,
bool  bDeleteOld = true 
)

This methods sets the condition of this function.

See also:
pCondition
Parameters:
pInConditiona pointer to the condition, which should be set as the condition of this function; the condition will be copied and the copy will be inserted Beware: It (pInCondition) won't be copied.
bDeleteOldif true the old condition will be deleted from memory, else the old condition should be deleted elsewhere
Returns:
true if pInSubCondition condition was set, else false
virtual void fib::cFunctionIf::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
bCheckDomainsgetthe domains of the defining element and check the underfunctionelements with it

Reimplemented from fib::cFunctionTwoValue.

virtual bool fib::cFunctionIf::store ( ostream &  stream,
char &  cRestBits,
unsigned char &  uiRestBitPosition 
) const
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

Implements fib::cUnderFunction.

virtual bool fib::cFunctionIf::storeXml ( ostream &  stream) const
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

Reimplemented from fib::cFunctionTwoValue.


Member Data Documentation

cCondition* fib::cFunctionIf::pCondition
private

A pointer to the condition of the if-function.

Definition at line 57 of file cFunctionIf.h.


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