VersionFilter Class Reference

Policy filters which support versioning [i.e. More...

#include <version_filter.hh>

Inheritance diagram for VersionFilter:

List of all members.

Public Member Functions

 VersionFilter (const VarRW::Id &fname)
void configure (const string &str)
 Configure the filter.
void reset ()
 Reset the filter.
bool acceptRoute (VarRW &varrw)
 See if a route is accepted by the filter.

Private Attributes

RefPf _filter
VarRW::Id _fname

Detailed Description

Policy filters which support versioning [i.e.

keep old version].

The idea is to create a new policy filter on each configuration. Whenever a route is being processed, you read which filter to run. If this filter is 0, [null pointer] then give it the last configuration. Else just run whatever filter is returned.

Filters should be referenced counted by routes. When reference count reaches 0, it should be deleted.

Why not keep filters internally here and read a filter id from route? Well because we cannot assume when to increment and decrement the reference count. Say it's a normal route lookup and we do the filtering, and it results to "accepted". It doesn't imply we need to +1 the reference count.

Constructor & Destructor Documentation

VersionFilter::VersionFilter ( const VarRW::Id &  fname)
fnamethe variable to read/write in order to access filter.

Member Function Documentation

bool VersionFilter::acceptRoute ( VarRW varrw) [virtual]

See if a route is accepted by the filter.

The route may be modified by the filter [through VarRW].

true if the route is accepted, false otherwise.
varrwthe VarRW associated with the route being filtered.

Implements FilterBase.

void VersionFilter::configure ( const string &  str) [virtual]

Configure the filter.

strfilter configuration.

Implements FilterBase.

void VersionFilter::reset ( ) [virtual]

Reset the filter.

Filter becomes a NO-operation -- default action should be returned everytime an acceptRoute is called.

Implements FilterBase.

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