|
xorp
|
Classes | |
| class | Error |
Public Member Functions | |
| const Element & | read (const Id &) |
| Read a variable from a route [such as nexthop]. | |
| void | write (const Id &, const Element &) |
| Write a variable to a route. | |
| void | sync () |
| VarRW must perform all pending writes to the route now. | |
| void | printVars () |
| void | load (const string &fname) |
| void | set_verbose (bool) |
Private Member Functions | |
| bool | doLine (const string &line) |
| void | clear_trash () |
Private Attributes | |
| const Element * | _map [VAR_MAX] |
| ElementFactory | _ef |
| Element * | _trash [MAX_TRASH] |
| int | _trashc |
| bool | _verbose |
Static Private Attributes | |
| static const int | MAX_TRASH = 666 |
| const Element & FileVarRW::read | ( | const Id & | id | ) | [virtual] |
Read a variable from a route [such as nexthop].
If the protocol doesn't support the requested variable, and exception should be thrown.
If the variable is not present in the current route, then an ElemNull should be returned [for example if ipv6 is requested on a v4 route].
VarRW is responsible for deleting the object read [it owns it]. However care must be taken not to delete objects that were obtained by write() even though we pass them to read() later.
| id | The variable that is being requested [such as metric]. |
Implements VarRW.
| void FileVarRW::sync | ( | ) | [virtual] |
VarRW must perform all pending writes to the route now.
This is usefull in scenarios where VarRW decides to cache read and writes and perform the actual writes at the end [i.e. it stores pointers to elements].
All pointers to elements [by write] may become invalid after a sync.
Reimplemented from VarRW.
| void FileVarRW::write | ( | const Id & | id, |
| const Element & | e | ||
| ) | [virtual] |