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

#include <cFunctionVariable.h>

Inheritance diagram for fib::cFunctionVariable:
Collaboration diagram for fib::cFunctionVariable:

List of all members.

Public Member Functions

 cFunctionVariable (cFibVariable *pInVariable, cUnderFunction *pInSuperiorFunction=NULL, cFibElement *pInDefiningFibElement=NULL)
 cFunctionVariable (const cFunctionVariable &underfunction, cUnderFunction *pInSuperiorFunction=NULL, cFibElement *pInDefiningFibElement=NULL)
 cFunctionVariable (const TiXmlElement *pXmlElement, intFib &outStatus, list< cFibVariable * > &liDefinedVariables, cUnderFunction *pInSuperiorFunction=NULL, cFibElement *pInDefiningFibElement=NULL)
 cFunctionVariable (cReadBits &iBitStream, intFib &outStatus, list< cFibVariable * > &liDefinedVariables, const cDomainSingle *pInVariableDomain, cUnderFunction *pInSuperiorFunction=NULL, cFibElement *pInDefiningFibElement=NULL)
virtual ~cFunctionVariable ()
virtual bool isValid () const
virtual bool isUsedVariable (const cFibVariable *variable) const
virtual set< cFibVariable * > getUsedVariables ()
virtual bool replaceVariable (cFibVariable *variableOld, cFibVariable *variableNew)
virtual cFibVariablegetVariable ()
virtual bool setVariable (cFibVariable *pInVariable)
virtual doubleFib getValue () const
virtual unsignedIntFib getNumberOfUnderFunctions () const
virtual unsignedLongFib getTimeNeed (unsignedLongFib lMaxTime=0) const
virtual unsignedLongFib getCompressedSize () const
virtual bool store (ostream &stream, char &cRestBits, unsigned char &uiRestBitPosition) const
virtual bool storeXml (ostream &stream) const
virtual unsignedIntFib getType () const
virtual string getUnderFunctionName () const
virtual bool equal (const cUnderFunction &underfunction) const
virtual cUnderFunctionclone (cUnderFunction *pInSuperiorUnderFunction=NULL, cFibElement *pInDefiningFibElement=NULL) 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 void setDefiningFibElement (cFibElement *fibElement=NULL, bool bCheckDomains=true)
virtual bool operator== (const cUnderFunction &underfunction) const
bool operator!= (const cUnderFunction &underfunction) const

Protected Member Functions

virtual cFibElementgetVariableUsingFibElement () const
virtual bool deleteVariable (cFibVariable *pInVariable)
- Protected Member Functions inherited from fib::cUnderFunction
 cUnderFunction (cUnderFunction *pInSuperiorUnderFunction=NULL, cFibElement *pInDefiningFibElement=NULL)
 cUnderFunction (const cUnderFunction &underfunction, cUnderFunction *pInSuperiorUnderFunction=NULL, cFibElement *pInDefiningFibElement=NULL)

Protected Attributes

cFibVariablepVariable
- Protected Attributes inherited from fib::cUnderFunction
cUnderFunctionpSuperiorUnderFunction
cFibElementpDefiningFibElement

Additional Inherited Members

- Static Public Member Functions inherited from fib::cUnderFunction
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 inherited from fib::cUnderFunction
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

Detailed Description

Definition at line 54 of file cFunctionVariable.h.


Constructor & Destructor Documentation

fib::cFunctionVariable::cFunctionVariable ( cFibVariable pInVariable,
cUnderFunction pInSuperiorFunction = NULL,
cFibElement pInDefiningFibElement = NULL 
)

The constructor of the underfunction.

Parameters:
pInVariablea pointer to the variable of this underfunction
pInSuperiorFunctionthe underfunction which contains the new underfunction
pInDefiningFibElementthe fib -element which defines/ uses the new underfunction
fib::cFunctionVariable::cFunctionVariable ( const cFunctionVariable underfunction,
cUnderFunction pInSuperiorFunction = NULL,
cFibElement pInDefiningFibElement = NULL 
)

The copy constructor of the underfunction.

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

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

Parameters:
pXmlNodea pointer to the TinyXml node the underfunction is stored in
outStatusAn reference to an integervariable where the errorvariable can be stored to. possible errorvariables 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::cFunctionVariable::cFunctionVariable ( cReadBits iBitStream,
intFib outStatus,
list< cFibVariable * > &  liDefinedVariables,
const cDomainSingle pInVariableDomain,
cUnderFunction pInSuperiorFunction = NULL,
cFibElement pInDefiningFibElement = NULL 
)

This constructor restores a variable 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 integervariable where the errorvariable can be stored to. If the pointer is NULL no errorvariable will be given back. possible errorvariables 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
pInVariableDomainthe domain for variable underfunctions
pInSuperiorFunctionthe underfunction which contains the new underfunction
pInDefiningFibElementthe fib -element which defines/ uses the new underfunction
virtual fib::cFunctionVariable::~cFunctionVariable ( )
virtual

The destructor of the underfunction.


Member Function Documentation

virtual cUnderFunction* fib::cFunctionVariable::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::cFunctionVariable::deleteVariable ( cFibVariable pInVariable)
protectedvirtual

This method deletes all occurenc of the given variable from this element. So the variable is not used anymore of this element. Beware: This element has to be unregisterd (call unregisterUsingElement() ) at the pVariable seperatly. Do this directly befor or after calling this method.

Parameters:
pInVariablethe variable which is to delete from this element
Returns:
true if the variable dosn't occure anymore in this element, else false

Implements fib::iVariableUser.

virtual bool fib::cFunctionVariable::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

Implements fib::cUnderFunction.

virtual unsignedLongFib fib::cFunctionVariable::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

Implements fib::cUnderFunction.

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

Implements fib::cUnderFunction.

virtual unsignedLongFib fib::cFunctionVariable::getTimeNeed ( unsignedLongFib  lMaxTime = 0) const
virtual

This method evaluades a variable for the time needed to evariable the underfunction. This variable should not exceed lMaxTime, if the variable 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::evariableObject()
Parameters:
lMaxTimethe maximum time for the evaluation, the returned exceed this variable; the variable 0 stands for infinity, so the evaluation won't be stoped
Returns:
a variable for the time needed to evariable this underfunction

Implements fib::cUnderFunction.

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

Implements fib::cUnderFunction.

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

Implements fib::cUnderFunction.

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

This method returns all variables used in this underfunction.

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

Implements fib::cUnderFunction.

virtual doubleFib fib::cFunctionVariable::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 cFibVariable* fib::cFunctionVariable::getVariable ( )
virtual

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

Returns:
a pointer to the variable of the underfunction or NULL, if non such exists
virtual cFibElement* fib::cFunctionVariable::getVariableUsingFibElement ( ) const
protectedvirtual
Returns:
the fib -element which uses the variables of this element

Implements fib::iVariableUser.

virtual bool fib::cFunctionVariable::isUsedVariable ( const cFibVariable variable) const
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

Implements fib::cUnderFunction.

virtual bool fib::cFunctionVariable::isValid ( ) const
virtual

This method returns if this underfunction is valid, else false. All variables 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

Implements fib::cUnderFunction.

virtual bool fib::cFunctionVariable::replaceVariable ( cFibVariable variableOld,
cFibVariable variableNew 
)
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

Implements fib::cUnderFunction.

virtual bool fib::cFunctionVariable::setVariable ( cFibVariable pInVariable)
virtual

This method Sets the variable of the underfunction.

Parameters:
pInVariablea pointer to the variable for the underfunction
Returns:
true if the variable was set to pInVariable else false
virtual bool fib::cFunctionVariable::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::cFunctionVariable::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 variable.

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

Implements fib::cUnderFunction.


Member Data Documentation

cFibVariable* fib::cFunctionVariable::pVariable
protected

The variable of this underfunction.

Definition at line 61 of file cFunctionVariable.h.


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