xorp

Code Class Reference

This class represents the intermediate language code. More...

#include <code.hh>

List of all members.

Classes

class  Target
 A target represents where the code should be placed. More...

Public Types

typedef set< TargetTargetSet
typedef set< uint32_t > TagSet

Public Member Functions

const Code::Targettarget () const
 Get the target.
void set_target (const Code::Target target)
 Set the target.
void set_target_protocol (const string &protocol)
 Set the target protocol.
void set_target_filter (const filter::Filter &filter)
 Set the target filter type.
const string & code () const
 Get the actual code.
void set_code (const string &code)
 Set the actual code.
void add_code (const string &code)
 Add to the actual code.
const set< string > referenced_set_names () const
 Get the names of the sets referenced by this code.
void set_referenced_set_names (const set< string > &set_names)
 Set the names of the sets referenced by this code.
void add_referenced_set_name (const string &set_name)
 Add the name of a set referenced by this code.
void clear_referenced_set_names ()
 Remove the names of all sets referenced by this code.
const set< string > & source_protocols () const
void add_source_protocol (const string &protocol)
 Add a source protocol.
const Code::TagSet & all_tags () const
 Get the set with all tags.
const Code::TagSet & redist_tags () const
 Get the set with the tags used for route redistribution to other protocols.
void add_tag (uint32_t tag, bool is_redist_tag)
 Add a tag.
void add_subr (const string &policy, const string &code)
const SUBR & subr () const
string str ()
Codeoperator+= (const Code &rhs)
 Appends code to current code.

Private Attributes

Target _target
string _code
set< string > _referenced_set_names
set< string > _source_protocols
TagSet _all_tags
TagSet _redist_tags
SUBR _subr

Detailed Description

This class represents the intermediate language code.

It contains the actual code for the policy, its target, and names of the sets referenced. It also contains the policytags referenced.


Member Function Documentation

void Code::add_code ( const string &  code) [inline]

Add to the actual code.

Parameters:
codethe code to add.
void Code::add_referenced_set_name ( const string &  set_name) [inline]

Add the name of a set referenced by this code.

Parameters:
set_namethe name of the set referenced by this code.
void Code::add_source_protocol ( const string &  protocol) [inline]

Add a source protocol.

Parameters:
protocolthe protocol to add.
void Code::add_tag ( uint32_t  tag,
bool  is_redist_tag 
) [inline]

Add a tag.

Parameters:
tagthe tag to add.
is_redist_tagif true, the tag is used for route redistribution to other protocols.
const Code::TagSet& Code::all_tags ( ) const [inline]

Get the set with all tags.

Returns:
a reference to the set with all tags.
const string& Code::code ( ) const [inline]

Get the actual code.

Returns:
a reference to the actual code.
Code & Code::operator+= ( const Code rhs)

Appends code to current code.

It enables for chunks of code to be linked.

Returns:
reference to the updated code.
Parameters:
rhscode to link.
const Code::TagSet& Code::redist_tags ( ) const [inline]

Get the set with the tags used for route redistribution to other protocols.

Returns:
a reference to the set with tags used for route redistribution.
const set<string> Code::referenced_set_names ( ) const [inline]

Get the names of the sets referenced by this code.

Returns:
a reference to the names of the sets referenced by this code.
void Code::set_code ( const string &  code) [inline]

Set the actual code.

Parameters:
codethe actual code.
void Code::set_referenced_set_names ( const set< string > &  set_names) [inline]

Set the names of the sets referenced by this code.

Parameters:
set_namesthe names of the sets referenced by this code.
void Code::set_target ( const Code::Target  target) [inline]

Set the target.

Parameters:
targetthe target.
void Code::set_target_filter ( const filter::Filter &  filter)

Set the target filter type.

Parameters:
filterthe target filter type.
void Code::set_target_protocol ( const string &  protocol)

Set the target protocol.

Parameters:
protocolthe target protocol name.
string Code::str ( )
Returns:
string representation of code.
const Code::Target& Code::target ( ) const [inline]

Get the target.

Returns:
a reference to the target.

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