xorp

PolicyMap Class Reference

Container of all policies. More...

#include <policy_map.hh>

List of all members.

Classes

class  PolicyMapError
 Exception thrown on errors such as when a policy is not found. More...

Public Types

typedef Dependency
< PolicyStatement >::KEYS 
KEYS

Public Member Functions

PolicyStatementfind (const string &name) const
 Find a policy.
bool exists (const string &name)
 Checks if a policy exists.
void create (const string &name, SetMap &smap)
 Attempts to create a policy and update depndencies.
void delete_policy (const string &name)
 Attempts to delete a policy.
void add_dependency (const string &policyname, const string &protocol)
 Indicates the use of a policy by a protocol.
void del_dependency (const string &policyname, const string &protocol)
 Remove the use of a policy by a protocol.
string str ()
 Dumps all policies in human readable format.
void clear ()
void policy_deps (const string &policy, DEPS &deps)
void policies (KEYS &out)

Private Types

typedef Dependency
< PolicyStatement
Dep

Private Attributes

Dep _deps

Detailed Description

Container of all policies.

It relates policy names with actual policies and deals with dependencies.


Member Function Documentation

void PolicyMap::add_dependency ( const string &  policyname,
const string &  protocol 
)

Indicates the use of a policy by a protocol.

Parameters:
policynamepolicy name.
protocolname of protocol which uses policy.
void PolicyMap::create ( const string &  name,
SetMap smap 
)

Attempts to create a policy and update depndencies.

Throws an exception on error.

Parameters:
namename of policy.
smapSetMap used for updating dependencies.
void PolicyMap::del_dependency ( const string &  policyname,
const string &  protocol 
)

Remove the use of a policy by a protocol.

Parameters:
policynamepolicy name.
protocolname of protocol which no longer uses policy.
void PolicyMap::delete_policy ( const string &  name)

Attempts to delete a policy.

Throws an exception on error.

Parameters:
namepolicy name.
bool PolicyMap::exists ( const string &  name)

Checks if a policy exists.

Returns:
true if policy exists.
Parameters:
namename of policy.
PolicyStatement & PolicyMap::find ( const string &  name) const

Find a policy.

Throws an exception if not found.

Returns:
policy requested.
Parameters:
namename of policy wanted.
string PolicyMap::str ( )

Dumps all policies in human readable format.

Returns:
string representation of all policies.

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