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

Simple Collection. More...

#include <InputMerger.h>

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

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~InputMerger ()
bool hasItem (const ITEM &item) const
void output (Consumer< ITEM, TAG > &consumer) const
void outputHavingTags (const OpSet< TAG > &ts, Consumer< ITEM, TAG > &consumer) const
 Send to a consumer all the items which are tagged with at least the given tags.
void outputReversed (Consumer< TAG, ITEM > &consumer) const
 Send the merged data to a consumer, but reversed: the tag become items, and they are tagged with the items that had them.
void applyChange (const PatchList< ITEM, TAG > &change)
virtual OpSet< ITEM > getTaggedItems () const
 Get the set of all the items that have tags according to this collection.
OpSet< TAG > getAllTags () const
 Get the set of all the tags in this collection.
OpSet< TAG > getCompanionTags (const OpSet< TAG > &ts) const
OpSet< ITEM > getRelatedItems (const OpSet< TAG > &ts, int maxdistance=1) const
unsigned int itemCount () const
 Count the number of items.
void clear ()
 Empty the collection.

Protected Member Functions

virtual void consumeItem (const ITEM &item, const OpSet< TAG > &tags)
virtual OpSet< TAG > getTagsOfItem (const ITEM &item) const
virtual OpSet< ITEM > getItemsHavingTag (const TAG &tag) const
 Get the items which are tagged with at least the tag `tag'.
virtual OpSet< ITEM > getItemsHavingTags (const OpSet< TAG > &tags) const
 Get the items which are tagged with at least the tags `tags'.

Protected Attributes

std::map< ITEM, OpSet< TAG > > coll

Detailed Description

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

Simple Collection.

It can be used to merge input values: if an item is added multiple times, its various tagsets are merged in a single one.

It is also a full-featured collection, although not very optimized.


Constructor & Destructor Documentation

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


Member Function Documentation

template<class T, class Tag>
void Tagcoll::InputMerger< T, Tag >::applyChange const PatchList< ITEM, TAG > &  change  ) 
 

template<class T, class Tag>
void Tagcoll::InputMerger< T, Tag >::clear  ) 
 

Empty the collection.

template<class T, class Tag>
void Tagcoll::InputMerger< T, Tag >::consumeItem const ITEM &  item,
const OpSet< TAG > &  tags
[protected, virtual]
 

template<class T, class Tag>
OpSet< Tag > Tagcoll::InputMerger< T, Tag >::getAllTags  )  const [virtual]
 

Get the set of all the tags in this collection.

Implements Tagcoll::Collection< ITEM, TAG >.

template<class T, class Tag>
OpSet< Tag > Tagcoll::InputMerger< T, Tag >::getCompanionTags const OpSet< TAG > &  ts  )  const
 

template<class ITEM, class TAG>
OpSet< ITEM > Tagcoll::InputMerger< ITEM, TAG >::getItemsHavingTag const TAG &  tag  )  const [protected, virtual]
 

Get the items which are tagged with at least the tag `tag'.

Returns:
The items found, or an empty set if no items have that tag

Implements Tagcoll::Collection< ITEM, TAG >.

template<class ITEM, class TAG>
OpSet< ITEM > Tagcoll::InputMerger< ITEM, TAG >::getItemsHavingTags const OpSet< TAG > &  tags  )  const [protected, virtual]
 

Get the items which are tagged with at least the tags `tags'.

Returns:
The items found, or an empty set if no items have that tag

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

template<class T, class Tag>
OpSet< T > Tagcoll::InputMerger< T, Tag >::getRelatedItems const OpSet< TAG > &  ts,
int  maxdistance = 1
const
 

template<class ITEM, class TAG>
virtual OpSet<ITEM> Tagcoll::InputMerger< ITEM, TAG >::getTaggedItems  )  const [inline, virtual]
 

Get the set of all the items that have tags according to this collection.

Implements Tagcoll::Collection< ITEM, TAG >.

template<class T, class Tag>
OpSet< Tag > Tagcoll::InputMerger< T, Tag >::getTagsOfItem const ITEM &  item  )  const [protected, virtual]
 

template<class ITEM, class TAG>
bool Tagcoll::InputMerger< ITEM, TAG >::hasItem const ITEM &  item  )  const [inline]
 

template<class T, class Tag>
unsigned int Tagcoll::InputMerger< T, Tag >::itemCount  )  const
 

Count the number of items.

template<class T, class Tag>
void Tagcoll::InputMerger< T, Tag >::output Consumer< ITEM, TAG > &  consumer  )  const
 

template<class ITEM, class TAG>
void Tagcoll::InputMerger< ITEM, TAG >::outputHavingTags const OpSet< TAG > &  ts,
Consumer< ITEM, TAG > &  consumer
const [virtual]
 

Send to a consumer all the items which are tagged with at least the given tags.

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

template<class T, class Tag>
void Tagcoll::InputMerger< T, Tag >::outputReversed Consumer< TAG, ITEM > &  consumer  )  const
 

Send the merged data to a consumer, but reversed: the tag become items, and they are tagged with the items that had them.


Member Data Documentation

template<class ITEM, class TAG>
std::map< ITEM, OpSet<TAG> > Tagcoll::InputMerger< ITEM, TAG >::coll [protected]
 


The documentation for this class was generated from the following files:
Generated on Fri Mar 24 22:42:26 2006 for libtagcoll by  doxygen 1.4.6