tagcoll::TagexprContext Class Reference

Context for evaluating expressions of derived tags. More...

#include <expression.h>

List of all members.

Public Member Functions

 TagexprContext (const std::set< std::string > &tags, const std::map< std::string, Expression > &derivedTags)
 Create a context for recursive tagset evaluation.
bool eval (const std::string &tag) const
 Evaluates the input tags on the contents to see if they contain the given tag, or if they match its associated tag expression if tag is a derived tag.

Protected Attributes

const std::set< std::string > & tags
const std::map< std::string,
Expression > & 
derivedTags
std::set< std::string > seen


Detailed Description

Context for evaluating expressions of derived tags.

A derived tag is a tag which is automatically inferred when a tag expression is matched on a tagset.

TagexprContext allows the inference engine to distinguish between a normal tag or a derived tag.

This class is mainly used to support DerivedTags and has probably little applications elsewhere.


Constructor & Destructor Documentation

tagcoll::TagexprContext::TagexprContext ( const std::set< std::string > &  tags,
const std::map< std::string, Expression > &  derivedTags 
) [inline]

Create a context for recursive tagset evaluation.

Evaluation happens using a derivation table, which can list a tag as an alias for another tag expression. Whenever a tag is matched for equality with a derived tag, the match is performed with the derived tag expression instead.

Parameters:
tags The tags to evaluate
derivedTags The table of derived tags to use in the evaluation


Member Function Documentation

bool tagcoll::TagexprContext::eval ( const std::string &  tag  )  const

Evaluates the input tags on the contents to see if they contain the given tag, or if they match its associated tag expression if tag is a derived tag.


Member Data Documentation

const std::set<std::string>& tagcoll::TagexprContext::tags [protected]

const std::map<std::string, Expression>& tagcoll::TagexprContext::derivedTags [protected]

std::set<std::string> tagcoll::TagexprContext::seen [mutable, protected]


The documentation for this class was generated from the following files:
Generated on Fri Feb 8 10:50:44 2008 for libtagcoll by  doxygen 1.5.4