xorp

Term Class Reference

A term is an atomic policy unit. More...

#include <term.hh>

Inheritance diagram for Term:
NONCOPYABLE

List of all members.

Classes

class  term_syntax_error
 Exception thrown on a syntax error while parsing configuration. More...

Public Types

enum  BLOCKS { SOURCE = 0, DEST, ACTION, LAST_BLOCK }
typedef ConfigNodeIdMap< Node * > Nodes

Public Member Functions

 Term (const string &name)
const string & name () const
void set_term_end ()
 Perform operations at the end of the term.
void set_block (const uint32_t &block, const ConfigNodeId &order, const string &statement)
 Updates the source/dest/action block of a term.
void del_block (const uint32_t &block, const ConfigNodeId &order)
 Deletes statements in the location specified by order and block.
void set_block_end (uint32_t block)
 Perform operations at the end of the block.
const Elementaccept (Visitor &v)
 Visitor implementation.
Nodessource_nodes ()
Nodesdest_nodes ()
Nodesaction_nodes ()
const string & from_protocol () const
 Get the protocol name (in the "from" block).
void set_from_protocol (const string &v)
 Set the protocol name (in the "from" block).

Static Public Member Functions

static string block2str (uint32_t num)
 Convert block number to human readable form.

Private Member Functions

list< pair< ConfigNodeId, Node * >
>::iterator 
find_out_of_order_node (const uint32_t &block, const ConfigNodeId &order)

Private Attributes

string _name
Nodes_block_nodes [3]
list< pair< ConfigNodeId, Node * > > _out_of_order_nodes [3]
Nodes *& _source_nodes
Nodes *& _dest_nodes
Nodes *& _action_nodes
string _from_protocol

Detailed Description

A term is an atomic policy unit.

It is a complete specification of how a route needs to be matched, and what actions must be taken.


Constructor & Destructor Documentation

Term::Term ( const string &  name)
Parameters:
nameterm name.

Member Function Documentation

const Element* Term::accept ( Visitor v) [inline]

Visitor implementation.

Parameters:
vvisitor used to visit this term.
Nodes& Term::action_nodes ( ) [inline]
Returns:
parse tree of action block.
string Term::block2str ( uint32_t  num) [static]

Convert block number to human readable form.

Parameters:
numthe block number.
Returns:
human readable representation of block name.
void Term::del_block ( const uint32_t &  block,
const ConfigNodeId order 
)

Deletes statements in the location specified by order and block.

Parameters:
blockthe block to update (0:source, 1:dest, 2:action).
ordernode ID with position of term.
Nodes& Term::dest_nodes ( ) [inline]
Returns:
parse tree of dest block.
const string& Term::from_protocol ( ) const [inline]

Get the protocol name (in the "from" block).

Returns:
the protocol name (in the "from" block) if set, otherwise an empty string.
const string& Term::name ( ) const [inline]
Returns:
name of the term.
void Term::set_block ( const uint32_t &  block,
const ConfigNodeId order,
const string &  statement 
)

Updates the source/dest/action block of a term.

Parameters:
blockthe block to update (0:source, 1:dest, 2:action).
ordernode ID with position of term.
statementthe statement to insert.
void Term::set_block_end ( uint32_t  block)

Perform operations at the end of the block.

Parameters:
blockthe block to perform operations on (0:source, 1:dest, 2:action).
void Term::set_from_protocol ( const string &  v) [inline]

Set the protocol name (in the "from" block).

Parameters:
vthe protocol name (in the "from" block).
Nodes& Term::source_nodes ( ) [inline]
Returns:
parse tree of source block.

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