xorp

IvExec Class Reference

Visitor that executes instructions. More...

#include <iv_exec.hh>

Inheritance diagram for IvExec:
NONCOPYABLE InstrVisitor

List of all members.

Classes

class  RuntimeError
 Run time errors, such as doing unsupported operations. More...

Public Types

enum  FlowAction { ACCEPT, REJ, DEFAULT }
 

A FlowAction is what has to be done with the route.

More...

Public Member Functions

void set_policies (vector< PolicyInstr * > *policies)
void set_set_manager (SetManager *sman)
FlowAction run (VarRW *varrw)
 Execute the policies.
FlowAction runPolicy (PolicyInstr &pi)
 Execute a policy.
FlowAction runTerm (TermInstr &ti)
 Execute a term.
void visit (Push &p)
void visit (PushSet &ps)
void visit (OnFalseExit &x)
void visit (Load &l)
void visit (Store &s)
void visit (Accept &a)
void visit (Reject &r)
void visit (NaryInstr &nary)
void visit (Next &next)
void visit (Subr &sub)
void set_profiler (PolicyProfiler *)
string tracelog ()
void set_subr (SUBR *subr)

Static Public Member Functions

static string fa2str (const FlowAction &fa)

Private Member Functions

void clear_trash ()
 Do garbage collection.

Private Attributes

PolicyInstr ** _policies
unsigned _policy_count
const Element ** _stack_bottom
const Element ** _stack
const Element ** _stackend
const Element ** _stackptr
SetManager_sman
VarRW_varrw
bool _finished
Dispatcher _disp
FlowAction _fa
Element ** _trash
unsigned _trashc
unsigned _trashs
ostringstream _os
PolicyProfiler_profiler
bool _do_trace
bool _did_trace
Next::Flow _ctr_flow
SUBR * _subr

Detailed Description

Visitor that executes instructions.

The execution process may be optimized by not using visitors. Having instructions implement a method that returns a flow action directly.


Member Enumeration Documentation

A FlowAction is what has to be done with the route.

DEFAULT is the default action which is normally "go to the next term", or if the last term, ACCEPT.


Member Function Documentation

string IvExec::fa2str ( const FlowAction fa) [static]
Returns:
String representation of flow action.
Parameters:
faFlow action to convert.
IvExec::FlowAction IvExec::runPolicy ( PolicyInstr pi)

Execute a policy.

Parameters:
pipolicy to execute
IvExec::FlowAction IvExec::runTerm ( TermInstr ti)

Execute a term.

Parameters:
titerm to execute.
void IvExec::visit ( Accept a) [virtual]
Parameters:
aaccept the route.

Implements InstrVisitor.

void IvExec::visit ( Store s) [virtual]
Parameters:
sStore to execute.

Implements InstrVisitor.

void IvExec::visit ( PushSet ps) [virtual]
Parameters:
pspush of a set to execute.

Implements InstrVisitor.

void IvExec::visit ( Push p) [virtual]
Parameters:
ppush to execute.

Implements InstrVisitor.

void IvExec::visit ( Load l) [virtual]
Parameters:
lLoad to execute.

Implements InstrVisitor.

void IvExec::visit ( NaryInstr nary) [virtual]
Parameters:
naryN-ary instruction to execute.

Implements InstrVisitor.

void IvExec::visit ( OnFalseExit x) [virtual]
Parameters:
xOnFalseExit to execute.

Implements InstrVisitor.

void IvExec::visit ( Reject r) [virtual]
Parameters:
rreject the route.

Implements InstrVisitor.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations