xorp

SetMap Class Reference

Container of all sets. More...

#include <set_map.hh>

List of all members.

Classes

class  SetMapError
 Exception thrown on error, such as deleting a set in use. More...

Public Member Functions

const ElementgetSet (const string &name) const
 Throws exception if set is not found.
void create (const string &name)
 Create a new set.
void update_set (const string &type, const string &name, const string &elements, set< string > &modified)
 Replace the elements of a set.
void delete_set (const string &name)
 Attempts to delete a set.
void add_to_set (const string &type, const string &name, const string &element, set< string > &modified)
 Add an element to a set.
void delete_from_set (const string &type, const string &name, const string &element, set< string > &modified)
 Delete an element from a set.
void add_dependency (const string &setname, const string &policyname)
 Add a dependency of a policy using a set.
void del_dependency (const string &setname, const string &policyname)
 Delete a dependency of a policy using a set.
string str () const
void sets_by_type (SETS &s, const string &type) const

Private Types

typedef Dependency< ElementDep

Private Attributes

Dep _deps
ElementFactory _ef

Detailed Description

Container of all sets.

The SetMap owns all sets in the policy configuration. It also tracks dependencies between sets and policies.


Member Function Documentation

void SetMap::add_dependency ( const string &  setname,
const string &  policyname 
)

Add a dependency of a policy using a set.

Throws an exception if set is not found.

Parameters:
setnamename of set in which dependency should be added.
policynamename of policy which uses the set.
void SetMap::add_to_set ( const string &  type,
const string &  name,
const string &  element,
set< string > &  modified 
)

Add an element to a set.

Throws an expcetion if set does not exist.

Parameters:
typetype of the set.
namename of the set.
elementthe element to add.
modifiedset filled with policies which are now modified.
void SetMap::create ( const string &  name)

Create a new set.

Throws exception if set exists.

Parameters:
namename of the set.
void SetMap::del_dependency ( const string &  setname,
const string &  policyname 
)

Delete a dependency of a policy using a set.

Throws an exception if set or policy is not found.

Parameters:
setnamename of set in which dependency should be removed.
policynamename of policy which no longer uses the set.
void SetMap::delete_from_set ( const string &  type,
const string &  name,
const string &  element,
set< string > &  modified 
)

Delete an element from a set.

Throws an expcetion if set does not exist.

Parameters:
typetype of the set.
namename of the set.
elementthe element to delete.
modifiedset filled with policies which are now modified.
void SetMap::delete_set ( const string &  name)

Attempts to delete a set.

Throws an exception if set is in use.

Parameters:
namename of the set.
const Element & SetMap::getSet ( const string &  name) const

Throws exception if set is not found.

Returns:
set requested.
Parameters:
nameset name requested.
string SetMap::str ( ) const
Returns:
string representation of all sets.
void SetMap::update_set ( const string &  type,
const string &  name,
const string &  elements,
set< string > &  modified 
)

Replace the elements of a set.

Throws an expcetion if set does not exist.

Parameters:
typetype of the set.
namename of the set.
elementsthe new elements comma separated.
modifiedset filled with policies which are now modified.

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