Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

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

Interface for injecting or removing packages from a stream of tagged items. More...

#include <Filter.h>

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

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Filter ()
 Build an incomplete filter.
 Filter (Consumer< ITEM, TAG > &consumer)
 Build a filter passing the filtered stream to the given consumer.
virtual ~Filter ()
bool isComplete ()
 Return true if the filter is not incomplete.
virtual Consumer< ITEM, TAG > & getConsumer () const
 Access the filter's consumer.
virtual void setConsumer (Consumer< ITEM, TAG > &consumer)
 Set or change the filter's consumer.

Protected Member Functions

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

Consumer< ITEM, TAG > * consumer

Detailed Description

template<typename ITEM, typename TAG>
class Tagcoll::Filter< ITEM, TAG >

Interface for injecting or removing packages from a stream of tagged items.

The filter will not perform any memory management on its consumer: the caller must make sure that the lifetime of the Consumer is longer than the one of the Filter.


Constructor & Destructor Documentation

template<typename ITEM, typename TAG>
Tagcoll::Filter< ITEM, TAG >::Filter  )  [inline]
 

Build an incomplete filter.

This is useful as an intermediate step when constructing filters, but an incomplete filter should never be used: it will not even throw an expection: it will segfault.

In doubt, use the other version of the constructor.

template<typename ITEM, typename TAG>
Tagcoll::Filter< ITEM, TAG >::Filter Consumer< ITEM, TAG > &  consumer  )  [inline]
 

Build a filter passing the filtered stream to the given consumer.

template<typename ITEM, typename TAG>
virtual Tagcoll::Filter< ITEM, TAG >::~Filter  )  [inline, virtual]
 


Member Function Documentation

template<typename ITEM, typename TAG>
virtual void Tagcoll::Filter< ITEM, TAG >::consumeItem const ITEM &  item,
const OpSet< TAG > &  tags
[inline, protected, virtual]
 

Process a tagged item, with its tags.

Implements Tagcoll::Consumer< ITEM, TAG >.

Reimplemented in Tagcoll::AddDerived< ITEM >, Tagcoll::RemoveDerived< ITEM >, Tagcoll::FilterItemsByExpression< ITEM, TAG >, Tagcoll::FilterTagsByExpression< ITEM, TAG >, Tagcoll::Substitute< ITEM, TAG >, Tagcoll::UntaggedRemover< ITEM, TAG >, Tagcoll::UnfacetedRemover< ITEM >, Tagcoll::AddImplied< ITEM, TAG >, Tagcoll::RemoveImplied< ITEM, TAG >, and Tagcoll::PatchList< ITEM, TAG >.

template<typename ITEM, typename TAG>
virtual void Tagcoll::Filter< 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 >.

Reimplemented in Tagcoll::AddDerived< ITEM >, Tagcoll::RemoveDerived< ITEM >, Tagcoll::FilterItemsByExpression< ITEM, TAG >, Tagcoll::FilterTagsByExpression< ITEM, TAG >, Tagcoll::UnfacetedRemover< ITEM >, Tagcoll::AddImplied< ITEM, TAG >, and Tagcoll::RemoveImplied< ITEM, TAG >.

template<typename ITEM, typename TAG>
virtual void Tagcoll::Filter< 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 >.

Reimplemented in Tagcoll::AddDerived< ITEM >, Tagcoll::RemoveDerived< ITEM >, Tagcoll::FilterItemsByExpression< ITEM, TAG >, Tagcoll::FilterTagsByExpression< ITEM, TAG >, Tagcoll::Substitute< ITEM, TAG >, Tagcoll::UntaggedRemover< ITEM, TAG >, Tagcoll::UnfacetedRemover< ITEM >, Tagcoll::AddImplied< ITEM, TAG >, and Tagcoll::RemoveImplied< ITEM, TAG >.

template<typename ITEM, typename TAG>
virtual void Tagcoll::Filter< ITEM, TAG >::consumeItemUntagged const ITEM &  item  )  [inline, protected, virtual]
 

Process an untagged item.

Implements Tagcoll::Consumer< ITEM, TAG >.

Reimplemented in Tagcoll::AddDerived< ITEM >, Tagcoll::RemoveDerived< ITEM >, Tagcoll::FilterItemsByExpression< ITEM, TAG >, Tagcoll::FilterTagsByExpression< ITEM, TAG >, Tagcoll::Substitute< ITEM, TAG >, Tagcoll::UntaggedRemover< ITEM, TAG >, Tagcoll::UnfacetedRemover< ITEM >, Tagcoll::AddImplied< ITEM, TAG >, Tagcoll::RemoveImplied< ITEM, TAG >, and Tagcoll::PatchList< ITEM, TAG >.

template<typename ITEM, typename TAG>
virtual Consumer<ITEM, TAG>& Tagcoll::Filter< ITEM, TAG >::getConsumer  )  const [inline, virtual]
 

Access the filter's consumer.

template<typename ITEM, typename TAG>
bool Tagcoll::Filter< ITEM, TAG >::isComplete  )  [inline]
 

Return true if the filter is not incomplete.

template<typename ITEM, typename TAG>
virtual void Tagcoll::Filter< ITEM, TAG >::setConsumer Consumer< ITEM, TAG > &  consumer  )  [inline, virtual]
 

Set or change the filter's consumer.

Reimplemented in Tagcoll::FilterChain< ITEM, TAG >.


Member Data Documentation

template<typename ITEM, typename TAG>
Consumer<ITEM, TAG>* Tagcoll::Filter< ITEM, TAG >::consumer [protected]
 


The documentation for this class was generated from the following file:
Generated on Fri Sep 9 22:15:34 2005 for libtagcoll by  doxygen 1.4.4