class SingleVarRW

An interface to VarRW which deals with memory management. More...

 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Types

Public Methods


Detailed Description

Read and writes are cached, so they are done only once on the route, not matter how many time the filter requests or writes the variable.

Because of this caching, the SingleVarRW is usuable only once. After it has done its work once, it has to be re-created.

SingleVarRWErr (class)

SingleVarRWErr

 SingleVarRW ()

SingleVarRW

 ~SingleVarRW ()

~SingleVarRW

[virtual]

const Element&  read (const Id& id)

read

Implementation of VarRW read.

Parameters:

ididentifier of variable to be read.

Returns: variable requested.

Reimplemented from VarRW.

void  write (const Id& id, const Element& e)

write

Implementation of VarRW write.

Parameters:

ididentifier of variable to be written to.
evalue of variable to be written to.

Reimplemented from VarRW.

void  sync ()

sync

Implementation of VarRW sync.

Writes are performed now, as cached Element* pointers may become invalid afterwards.a

trash is also emptied upon completion.

Reimplemented from VarRW.

void  initialize (const Id& id, Element* e)

initialize

Register a variable for read access with SingleVarRW. SingleVarRW owns the element, so derived classes do not need to worry about deleting objects.

All supported variables must be registered, even the ones not present in the current route. For example v6 nexthops must be set to ElemNull on v4 routes. [assuming the protocol itself supports v6].

Parameters:

ididentifier of variable that may be read.
evalue of variable.
void  start_read ()

start_read

[virtual]

If any reads are performed, this is a marker which informs the derived class that reads will now start.

void  start_write ()

start_write

[virtual]

If any writes were performed, this is a marker which informs the derived class that writes will start.

void  single_write (const Id& id, const Element& e)

single_write

[pure virtual]

Write of a variable. The write MUST be performed now, as the element pointer may become invalid after this call. Also, a single write will be called for each modified element.

Parameters:

ididentifier of variable to be written to.
evalue of variable.
Element*  single_read (const Id& id)

single_read

[pure virtual]

Read of a variable. The VarRW needs to read a particular element. This may return NULL indicating ElemNull---i.e. variable not present in THIS route.

Parameters:

idthe id of the variable.

Returns: variable requested.

void  end_write ()

end_write

[virtual]

Marks the end of writes in case there were any modified fields.


Generated by: pavlin on possum.icir.org on Wed Aug 2 15:36:29 2006, using kdoc $.