IDE: started conditional evaluation

git-svn-id: trunk@17866 -
This commit is contained in:
mattias 2008-12-19 11:37:16 +00:00
parent 3817032fa7
commit 20fee49b9d

View File

@ -135,6 +135,9 @@ type
FChangeStamp: integer; FChangeStamp: integer;
FEvaluator: TExpressionEvaluator; FEvaluator: TExpressionEvaluator;
FRoot: TCompOptCondNode; FRoot: TCompOptCondNode;
FEvaluatorStamp: integer;
FValuesValid: boolean;
FValues: array[TCOCValueType] of string;
function GetValues(const ValueType: TCOCValueType): string; function GetValues(const ValueType: TCOCValueType): string;
procedure SetEvaluator(const AValue: TExpressionEvaluator); procedure SetEvaluator(const AValue: TExpressionEvaluator);
public public
@ -312,7 +315,13 @@ end;
function TCompOptConditionals.GetValues(const ValueType: TCOCValueType): string; function TCompOptConditionals.GetValues(const ValueType: TCOCValueType): string;
begin begin
if (not FValuesValid)
or (FEvaluator.ChangeStamp<>FEvaluatorStamp) then begin
// ToDo
FValuesValid:=true;
FEvaluatorStamp:=FEvaluator.ChangeStamp;
end;
Result:=FValues[ValueType];
end; end;
procedure TCompOptConditionals.SetEvaluator(const AValue: TExpressionEvaluator procedure TCompOptConditionals.SetEvaluator(const AValue: TExpressionEvaluator
@ -320,6 +329,7 @@ procedure TCompOptConditionals.SetEvaluator(const AValue: TExpressionEvaluator
begin begin
if FEvaluator=AValue then exit; if FEvaluator=AValue then exit;
FEvaluator:=AValue; FEvaluator:=AValue;
FValuesValid:=false;
end; end;
constructor TCompOptConditionals.Create; constructor TCompOptConditionals.Create;