|
|
This VarRW checks if elements may be read/written to and does typechecking according to the VarMap.
The user may set which protocols should be "simulated" by the VarRW.
The SemanticVarRW will create dummy elements which are initialized to a default value. This may not be optimal for semantic checking.
var_error (class) | var_error |
SemanticVarRW (VarMap& vars)
| SemanticVarRW |
Parameters:
vars | the VarMap to use. |
~SemanticVarRW ()
| ~SemanticVarRW |
const Element& read (const Id& id)
| read |
VarRW read interface.
Checks if a variable may be read.
Throws exception on error.
Parameters:
id | name of variable. |
Returns: dummy element initialized to a default value.
Reimplemented from VarRW.
void write (const Id& id, const Element& elem)
| write |
VarRW write interface.
Checks if a variable may be written to, and if the type is correct.
Throws exception on error.
Parameters:
id | name of variable. |
elem | value of variable. |
Reimplemented from VarRW.
void sync ()
| sync |
VarRW sync interface.
Does garbage collection.
Reimplemented from VarRW.
void set_protocol (const string& proto)
| set_protocol |
Change the protocol being simulated.
Parameters:
proto | protocol to simulate. |