|
|
It contains all the possible protocols. All the possible variables those protocols support and whether the variables are read-only or read-write.
This is crutial for semantic checking.
VarMapErr (class) | VarMapErr |
enum Access { READ, READ_WRITE } | Access |
A variable may be READ [readonly] or READ_WRITE [read/write].
Variable (struct) | Variable |
A variable has Access control, it has a name, and a type.
typedef map<string,Variable*> VariableMap | VariableMap |
typedef map<string,VariableMap*> ProtoMap | ProtoMap |
const Variable& variable (const string& protocol,
const string& varname)
| variable |
[const]
Return Variable information for a variable of a specific protocol.
Throws an exception if no information is found.
Caller must not delete the map.
Parameters:
protocol | protocol of variable interested in. |
varname | name of variable interested in. |
Returns: access and type information for the requested variable.
VarMap (ProcessWatchBase& pw)
| VarMap |
As the VarMap learns about new protocols, it will register interest with the process watcher for that protocol to monitor the status of the protocol process.
Parameters:
pw | processWatch to use. |
~VarMap ()
| ~VarMap |
bool protocol_known (const string& protocol)
| protocol_known |
Parameters:
protocol | protocol caller wish to knows existance of. |
Returns: True if the protocol is known to the VarMap, false otherwise.
void add_variable (VariableMap& vm, const string& varname,
const string& type, Access acc)
| add_variable |
Add a variable to a specific protocol.
Parameters:
vm | VariableMap where variable should be added. |
varname | name of the variable. |
type | the type [id] of the variable/element. |
acc | the access of the variable. |
void add_protocol_variable (const string& protocol, const string& varname,
const string& type, Access acc)
| add_protocol_variable |
Add a variable to a protocol.
Parameters:
protocol | protocol for which variable should be added. |
varname | name of variable. |
type | type [id] of the variable. |
acc | access [r/rw] of the variable. |
void configure (const string& conf)
| configure |
Configure the VarMap from an unparsed configuration.
Parameters:
conf | un-parsed configuration file of the VarMap. |