Tagcoll::FilterTagsByExpression< ITEM, TAG > Class Template Reference

Remove the tags that do not singularly match a tag expression. More...

#include <Expression.h>

Inheritance diagram for Tagcoll::FilterTagsByExpression< ITEM, TAG >:

Inheritance graph
[legend]
Collaboration diagram for Tagcoll::FilterTagsByExpression< ITEM, TAG >:

Collaboration graph
[legend]
List of all members.

Public Types

enum  MatchType { PLAIN, INVERTED }

Public Member Functions

 FilterTagsByExpression (const Expression &expression)
 FilterTagsByExpression (const std::string &expression)
 FilterTagsByExpression (Consumer< ITEM, TAG > &cons, const Expression &expression)
 FilterTagsByExpression (Consumer< ITEM, TAG > &cons, const std::string &expression)
virtual ~FilterTagsByExpression ()
void setExpression (const Expression &expression)
 Set the expression to use for this filter.
void setExpression (const std::string &expression)
 Set the expression to use for this filter.
void setMatchType (MatchType type)
 Set the type of match.
int countMatched () const
 Return the number of tags that matched the expression.

Protected Member Functions

bool match (const TAG &tag) const
virtual void consumeItemUntagged (const ITEM &item)
 Process an untagged item.
virtual void consumeItem (const ITEM &item, const OpSet< TAG > &tags)
 Process a tagged item, with its tags.
virtual void consumeItemsUntagged (const OpSet< ITEM > &items)
 Process a set of items, all with no tags.
virtual void consumeItems (const OpSet< ITEM > &items, const OpSet< TAG > &tags)
 Process a set of items identically tagged, with their tags.

Protected Attributes

Expression expr
MatchType matchType
int matched

Detailed Description

template<class ITEM, class TAG>
class Tagcoll::FilterTagsByExpression< ITEM, TAG >

Remove the tags that do not singularly match a tag expression.

This is a slight abuse of tag expressions, but it can prove useful to remove tags matching, for example, "special::not-yet-tagged*" or "!(use::gaming || game::*)".


Member Enumeration Documentation

template<class ITEM, class TAG>
enum Tagcoll::FilterTagsByExpression::MatchType

Enumerator:
PLAIN 
INVERTED 


Constructor & Destructor Documentation

template<class ITEM, class TAG>
Tagcoll::FilterTagsByExpression< ITEM, TAG >::FilterTagsByExpression ( const Expression expression  )  [inline]

template<class ITEM, class TAG>
Tagcoll::FilterTagsByExpression< ITEM, TAG >::FilterTagsByExpression ( const std::string &  expression  )  [inline]

template<class ITEM, class TAG>
Tagcoll::FilterTagsByExpression< ITEM, TAG >::FilterTagsByExpression ( Consumer< ITEM, TAG > &  cons,
const Expression expression 
) [inline]

template<class ITEM, class TAG>
Tagcoll::FilterTagsByExpression< ITEM, TAG >::FilterTagsByExpression ( Consumer< ITEM, TAG > &  cons,
const std::string &  expression 
) [inline]

template<class ITEM, class TAG>
virtual Tagcoll::FilterTagsByExpression< ITEM, TAG >::~FilterTagsByExpression (  )  [inline, virtual]


Member Function Documentation

template<class ITEM, class TAG>
bool Tagcoll::FilterTagsByExpression< ITEM, TAG >::match ( const TAG &  tag  )  const [inline, protected]

template<class ITEM, class TAG>
virtual void Tagcoll::FilterTagsByExpression< ITEM, TAG >::consumeItemUntagged ( const ITEM &  item  )  [inline, protected, virtual]

Process an untagged item.

Reimplemented from Tagcoll::Filter< ITEM, TAG >.

template<class ITEM, class TAG>
virtual void Tagcoll::FilterTagsByExpression< ITEM, TAG >::consumeItem ( const ITEM &  item,
const OpSet< TAG > &  tags 
) [inline, protected, virtual]

Process a tagged item, with its tags.

Reimplemented from Tagcoll::Filter< ITEM, TAG >.

template<class ITEM, class TAG>
virtual void Tagcoll::FilterTagsByExpression< ITEM, TAG >::consumeItemsUntagged ( const OpSet< ITEM > &  items  )  [inline, protected, virtual]

Process a set of items, all with no tags.

Reimplemented from Tagcoll::Consumer< ITEM, TAG >.

template<class ITEM, class TAG>
virtual void Tagcoll::FilterTagsByExpression< ITEM, TAG >::consumeItems ( const OpSet< ITEM > &  items,
const OpSet< TAG > &  tags 
) [inline, protected, virtual]

Process a set of items identically tagged, with their tags.

Reimplemented from Tagcoll::Consumer< ITEM, TAG >.

template<class ITEM, class TAG>
void Tagcoll::FilterTagsByExpression< ITEM, TAG >::setExpression ( const Expression expression  )  [inline]

Set the expression to use for this filter.

Parameters:
expression The expression to use for matching

template<class ITEM, class TAG>
void Tagcoll::FilterTagsByExpression< ITEM, TAG >::setExpression ( const std::string &  expression  )  [inline]

Set the expression to use for this filter.

Parameters:
expression The expression to use for matching

template<class ITEM, class TAG>
void Tagcoll::FilterTagsByExpression< ITEM, TAG >::setMatchType ( MatchType  type  )  [inline]

Set the type of match.

Parameters:
type PLAIN: only keep the tags that match the expression INVERTED: only keep the tags that do not match the expression

template<class ITEM, class TAG>
int Tagcoll::FilterTagsByExpression< ITEM, TAG >::countMatched (  )  const [inline]

Return the number of tags that matched the expression.

It returns the number oftags that did not match if INVERTED match is used.

Returns:
The match count


Member Data Documentation

template<class ITEM, class TAG>
Expression Tagcoll::FilterTagsByExpression< ITEM, TAG >::expr [protected]

template<class ITEM, class TAG>
MatchType Tagcoll::FilterTagsByExpression< ITEM, TAG >::matchType [protected]

template<class ITEM, class TAG>
int Tagcoll::FilterTagsByExpression< ITEM, TAG >::matched [protected]


The documentation for this class was generated from the following file:
Generated on Sat Jan 17 03:29:57 2009 for libtagcoll by  doxygen 1.5.1