#include <cConditionComparison.h>
List of all members.
Public Member Functions |
| cConditionComparison (cUnderFunction *pInFirstSubFunction, cUnderFunction *pInSecondSubFunction, cCondition *pInSuperiorCondition=NULL, cFibElement *pInDefiningFibElement=NULL) |
| cConditionComparison (const cUnderFunction &inFirstSubFunction, const cUnderFunction &inSecondSubFunction, cCondition *pInSuperiorCondition=NULL, cFibElement *pInDefiningFibElement=NULL) |
| cConditionComparison (const cConditionComparison &condition, cCondition *pInSuperiorCondition=NULL, cFibElement *pInDefiningFibElement=NULL) |
virtual | ~cConditionComparison () |
virtual bool | isValid () const |
virtual bool | isUsedVariable (const cFibVariable *variable) const |
virtual set< cFibVariable * > | getUsedVariables () |
virtual bool | replaceVariable (cFibVariable *variableOld, cFibVariable *variableNew) |
virtual unsignedIntFib | getNumberOfConditions () const |
virtual unsignedIntFib | getNumberOfUnderFunctions () const |
virtual void | setDefiningFibElement (cFibElement *pDefiningFibElement=NULL, bool bCheckDomains=true) |
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 bool | equal (const cCondition &condition) const |
cUnderFunction * | getFirstSubFunction () |
const cUnderFunction * | getFirstSubFunction () const |
bool | setFirstSubFunction (cUnderFunction *pInSubFunction, bool bDeleteOld=true) |
bool | setFirstSubFunction (const cUnderFunction &pInSubFunction, bool bDeleteOld=true) |
cUnderFunction * | getSecondSubFunction () |
const cUnderFunction * | getSecondSubFunction () const |
bool | setSecondSubFunction (cUnderFunction *pInSubFunction, bool bDeleteOld=true) |
bool | setSecondSubFunction (const cUnderFunction &pInSubFunction, bool bDeleteOld=true) |
virtual | ~cCondition () |
virtual bool | getValue () const =0 |
cFibElement * | getDefiningFibElement () const |
cCondition * | getSuperiorCondition () const |
virtual unsignedIntFib | getType () const =0 |
virtual string | getConditionName () const =0 |
virtual bool | operator== (const cCondition &condition) const |
bool | operator!= (const cCondition &condition) const |
virtual cCondition * | clone (cCondition *pInSuperiorCondition=NULL, cFibElement *pInDefiningFibElement=NULL) const =0 |
Additional Inherited Members |
static cCondition * | restoreXml (const TiXmlElement *pXmlElement, intFib &outStatus, list< cFibVariable * > &liDefinedVariables, cCondition *pInSuperiorCondition=NULL, cFibElement *pInDefiningFibElement=NULL) |
static cCondition * | restore (cReadBits &iBitStream, intFib &outStatus, list< cFibVariable * > &liDefinedVariables, const cDomainSingle *pInValueDomain, const cDomainSingle *pInDomainVariable, cCondition *pInSuperiorCondition=NULL, cFibElement *pInDefiningFibElement=NULL) |
static const unsignedIntFib | CONDITION_FALSE = 0 |
static const unsignedIntFib | CONDITION_TRUE = 1 |
static const unsignedIntFib | CONDITION_NOT = 10 |
static const unsignedIntFib | CONDITION_OR = 20 |
static const unsignedIntFib | CONDITION_AND = 21 |
static const unsignedIntFib | CONDITION_XOR = 23 |
static const unsignedIntFib | CONDITION_EQUAL_INTEGER = 25 |
static const unsignedIntFib | CONDITION_LOWER = 26 |
static const unsignedIntFib | CONDITION_GREATER = 27 |
Detailed Description
Definition at line 55 of file cConditionComparison.h.
Constructor & Destructor Documentation
The constructor of the two value condition.
- Parameters:
-
pInFirstSubFunction | a pointer to the first function, this condition contains; Beware: It (pSubFunction) won't be copied. |
- See also:
- pFirstSubFunction
- Parameters:
-
pInSecondSubFunction | a pointer to the second function, this condition contains; Beware: It (pSubFunction) won't be copied. |
- See also:
- pSecondSubFunction
- Parameters:
-
pInSuperiorCondition | the condition which contains the new condition |
pInDefiningFibElement | the Fib-element which defines/ uses the new condition |
The constructor of the two value condition.
- Parameters:
-
inFirstSubFunction | the first function, this condition contains |
- See also:
- pFirstSubFunction
- Parameters:
-
inSecondSubFunction | the second function, this condition contains |
- See also:
- pSecondSubFunction
- Parameters:
-
pInSuperiorCondition | the condition which contains the new condition |
pInDefiningFibElement | the Fib-element which defines/ uses the new condition |
The copy constructor of the condition. This constructor will also copy the subconditions of the given condition.
- Parameters:
-
condition | the condition which to copy |
pInSuperiorCondition | the condition which contains the new condition |
pInDefiningFibElement | the Fib-element which defines/ uses the new condition |
virtual fib::cConditionComparison::~cConditionComparison |
( |
| ) |
|
|
virtual |
The destructor of the condition.
Member Function Documentation
virtual bool fib::cConditionComparison::equal |
( |
const cCondition & |
condition | ) |
const |
|
virtual |
This Method checks if the given condition is equal to this condition.
- Parameters:
-
condition | the condition to compare with this condition |
- Returns:
- true if the given condition is equal to this condition, else false
Implements fib::cCondition.
virtual unsignedLongFib fib::cConditionComparison::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::cCondition.
const cUnderFunction* fib::cConditionComparison::getFirstSubFunction |
( |
| ) |
const |
virtual unsignedIntFib fib::cConditionComparison::getNumberOfConditions |
( |
| ) |
const |
|
virtual |
- Returns:
- the number of conditions, a condition of this type has
Implements fib::cCondition.
virtual unsignedIntFib fib::cConditionComparison::getNumberOfUnderFunctions |
( |
| ) |
const |
|
virtual |
- Returns:
- the number of underfunctions, a condition of this type has
Implements fib::cCondition.
const cUnderFunction* fib::cConditionComparison::getSecondSubFunction |
( |
| ) |
const |
This method evaluades a value for the time needed to evalue the condition. 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:
-
lMaxTime | the 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 condition
Implements fib::cCondition.
virtual char fib::cConditionComparison::getTypeBit |
( |
| ) |
const |
|
protectedpure virtual |
virtual set<cFibVariable*> fib::cConditionComparison::getUsedVariables |
( |
| ) |
|
|
virtual |
This method returns all variables used in this condition.
- See also:
- cFibVariable
- Returns:
- all variables used in this condition
Implements fib::cCondition.
virtual bool fib::cConditionComparison::isUsedVariable |
( |
const cFibVariable * |
variable | ) |
const |
|
virtual |
This method checks if the given variable is used in this condition.
- See also:
- cFibVariable
- Parameters:
-
variable | the variable to check if it is used |
- Returns:
- true if the variable is used, else false
Implements fib::cCondition.
virtual bool fib::cConditionComparison::isValid |
( |
| ) |
const |
|
virtual |
This method returns if this condition is valid, else false. All subcondition and underfunctions must be valid. No condition should contain itself or should be contained in one of its condition (no cycles allowed).
- Returns:
- true if this condition is valid, else false
Implements fib::cCondition.
This method replace the variable variableOld with the variable variableNew in the condition.
- See also:
- cFibVariable
-
isVariable()
-
isUsedVariable()
- Parameters:
-
variableOld | the variable to replace |
variableNew | the variable with which the variable variableOld is to replace |
- Returns:
- true if the variable variableOld is replaced with variableNew, else false
Implements fib::cCondition.
virtual void fib::cConditionComparison::setDefiningFibElement |
( |
cFibElement * |
pDefiningFibElement = NULL , |
|
|
bool |
bCheckDomains = true |
|
) |
| |
|
virtual |
Sets the Fib-element which defines/ uses this condition. If the given pointer is the nullpointer (standardvalue), no Fib-element defines this condition.
- Parameters:
-
pDefiningFibElement | a pointer to the Fib-element which defines/ uses this condition |
bCheckDomains | get the domains of the defining element and check the underfunctionelements with it |
Reimplemented from fib::cCondition.
bool fib::cConditionComparison::setFirstSubFunction |
( |
cUnderFunction * |
pInSubFunction, |
|
|
bool |
bDeleteOld = true |
|
) |
| |
This method sets the contained first function (
- See also:
- pSubFunction) to the given condition pInSubFunction. Beware: It (pInSubFunction) won't be copied.
-
pFirstSubFunction
-
getFirstSubFunction()
- Parameters:
-
pInSubFunction | a pointer to the subcondition to set |
bDeleteOld | if true, delete the old subcondition from the memory |
- Returns:
- true if pInSubFunction condition was set, else false
bool fib::cConditionComparison::setFirstSubFunction |
( |
const cUnderFunction & |
pInSubFunction, |
|
|
bool |
bDeleteOld = true |
|
) |
| |
This method sets the contained first function (
- See also:
- pSubFunction) to the given condition pInSubFunction.
-
pFirstSubFunction
-
getFirstSubFunction()
- Parameters:
-
pInSubFunction | the subcondition to set |
bDeleteOld | if true, delete the old subcondition from the memory |
- Returns:
- true if pInSubFunction condition was set, else false
bool fib::cConditionComparison::setSecondSubFunction |
( |
cUnderFunction * |
pInSubFunction, |
|
|
bool |
bDeleteOld = true |
|
) |
| |
This method sets the contained second function (
- See also:
- pSubFunction) to the given condition pInSubFunction. Beware: It (pInSubFunction) won't be copied.
-
pSecondSubFunction
-
getSecondSubFunction()
- Parameters:
-
pInSubFunction | a pointer to the subcondition to set |
bDeleteOld | if true, delete the old subcondition from the memory |
- Returns:
- true if pInSubFunction condition was set, else false
bool fib::cConditionComparison::setSecondSubFunction |
( |
const cUnderFunction & |
pInSubFunction, |
|
|
bool |
bDeleteOld = true |
|
) |
| |
This method sets the contained second function (
- See also:
- pSubFunction) to the given condition pInSubFunction.
-
pSecondSubFunction
-
getSecondSubFunction()
- Parameters:
-
pInSubFunction | the subcondition to set |
bDeleteOld | if true, delete the old subcondition from the memory |
- Returns:
- true if pInSubFunction condition was set, else false
virtual bool fib::cConditionComparison::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:
-
stream | the stream where this Fib-object should be stored to |
cRestBits | the not yet writen bits which should be stored |
uiRestBitPosition | the 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::cCondition.
virtual bool fib::cConditionComparison::storeXml |
( |
ostream & |
stream | ) |
const |
|
virtual |
This method stores this condition in the XML-format into the given stream. Variables should have ther number as ther value.
- Parameters:
-
stream | the stream where this conditionshould be stored to |
- Returns:
- true if this condition is stored, else false
Implements fib::cCondition.
Member Data Documentation
The documentation for this class was generated from the following file: