Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

util::ariel::VariableManager Class Reference

#include <Expression.h>

Inheritance diagram for util::ariel::VariableManager:

util::Object util::ariel::VariableManager::Simple List of all members.

Detailed Description

VariableManager is used in getting and setting the value of non-constant expressions.

For example, in the expression y = 1.0 + x + abs(-2) the terms '1.0' and '-2' are constants. The terms 'x' and 'abs' are variables whose value must be fetched from an external source. The value of a variable can be any computable type, including a function. In the previous example, 'x' could be a numerical value, and 'abs' must be a function. The term 'y' is also a variable, whose value is changed by the assignment.


Public Methods

virtual SmartPtr< ComputablegetValue (std::string name)=0 throw (ComputationException&)
 Fetch the current value of a variable.

virtual SmartPtr< ComputablesetValue (std::string name, const Computable &value)=0 throw (ComputationException&)
 Set the value of a variable.


Member Function Documentation

virtual SmartPtr<Computable> util::ariel::VariableManager::getValue std::string    name throw (ComputationException&) [pure virtual]
 

Fetch the current value of a variable.

Parameters:
name  the name of the variable, i.e. 'x' or 'abs'.
Returns:
the value of a variable
Exceptions:
ComputationException  & if the value is not set

Implemented in util::ariel::VariableManager::Simple.

virtual SmartPtr<Computable> util::ariel::VariableManager::setValue std::string    name,
const Computable   value
throw (ComputationException&) [pure virtual]
 

Set the value of a variable.

Parameters:
name  the name of the variable, i.e. 'x' or 'y'.
value  new value for the variable
Returns:
the new value
Exceptions:
ComputationException  & if an error occurs

Implemented in util::ariel::VariableManager::Simple.


The documentation for this class was generated from the following file:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.