|
xorp
|
A VarMap contains all information for legal protocol variables. More...
#include <var_map.hh>
Classes | |
| struct | Variable |
| A variable has Access control, it has a name, and a type. More... | |
| class | VarMapErr |
| Exception thrown on VarMap errors such as on unknown variables. More... | |
Public Types | |
| enum | Access { READ, READ_WRITE, WRITE } |
A variable may be READ [readonly] or READ_WRITE [read/write]. | |
|
typedef map< VarRW::Id, Variable * > | VariableMap |
|
typedef map< string, VariableMap * > | ProtoMap |
Public Member Functions | |
| const Variable & | variable (const string &protocol, const VarRW::Id &varname) const |
| Return Variable information for a variable of a specific protocol. | |
| VarRW::Id | var2id (const string &protocol, const string &varname) const |
| VarMap (ProcessWatchBase &pw) | |
| 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. | |
| bool | protocol_known (const string &protocol) |
| void | add_protocol_variable (const string &protocol, Variable *var) |
| Add a variable to a protocol. | |
| string | str () |
| String representation of varmap. | |
Private Types | |
| typedef VariableMap | MetaVarContainer |
Private Member Functions | |
| void | add_metavariable (Variable *var) |
| Use this if you want a variable to be present for all protocols. | |
| void | add_variable (VariableMap &vm, Variable *var) |
| Add a variable to a specific protocol. | |
| const VariableMap & | variablemap (const string &protocol) const |
| A VariableMap relates a variable name to its Variable information [access and type]. | |
Private Attributes | |
| ProtoMap | _protocols |
| ProcessWatchBase & | _process_watch |
| MetaVarContainer | _metavars |
A VarMap contains all information for legal protocol variables.
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.
| VarMap::VarMap | ( | ProcessWatchBase & | pw | ) |
| void VarMap::add_metavariable | ( | Variable * | var | ) | [private] |
Use this if you want a variable to be present for all protocols.
| var | the variable to add. Watch out for clashes and don't delete. |
| void VarMap::add_protocol_variable | ( | const string & | protocol, |
| Variable * | var | ||
| ) |
Add a variable to a protocol.
| protocol | protocol for which variable should be added. |
| var | the variable to add. Do not delete. |
| void VarMap::add_variable | ( | VariableMap & | vm, |
| Variable * | var | ||
| ) | [private] |
Add a variable to a specific protocol.
| vm | VariableMap where variable should be added. |
| var | the variable to add. Do not delete. |
| bool VarMap::protocol_known | ( | const string & | protocol | ) |
| string VarMap::str | ( | ) |
String representation of varmap.
Use only for debugging.
| const VarMap::Variable & VarMap::variable | ( | const string & | protocol, |
| const VarRW::Id & | varname | ||
| ) | 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.
| protocol | protocol of variable interested in. |
| varname | name of variable interested in. |
| const VarMap::VariableMap & VarMap::variablemap | ( | const string & | protocol | ) | const [private] |
A VariableMap relates a variable name to its Variable information [access and type].
Throws an exception if no map is found.
| protocol | protocol name for which variable map is requested. |