|
|
It deals with reading and writing field/variables/attributes of a route [such as nexthop, metric and so on].
A routing protocol must implement this interface in order to support policy filtering.
~VarRW ()
| ~VarRW |
[virtual]
const Element& read (const string& id)
| read |
[pure 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.
Parameters:
id | The variable that is being requested [such as metric]. |
Returns: Element requested, or ElemNull of element is not available.
void write (const string& id, const Element& e)
| write |
[pure virtual]
Write a variable to a route.
VarRW does not own Element, so it must not delete it.
Parameters:
id | Identifier of variable that must be written to. |
e | Value that must be written to the variable. |
void sync ()
| sync |
[pure 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.