#include <InputMerger.h>
Inheritance diagram for Tagcoll::InputMerger< ITEM, TAG >:
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 |
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.
|
|
|
|
|
Empty the collection.
|
|
|
|
Get the set of all the tags in this collection.
Implements Tagcoll::ReadonlyCollection< ITEM, TAG >. |
|
|
|
Get the items which are tagged with at least the tag `tag'.
Implements Tagcoll::ReadonlyCollection< ITEM, TAG >. |
|
Get the items which are tagged with at least the tags `tags'.
Reimplemented from Tagcoll::ReadonlyCollection< ITEM, TAG >. |
|
|
|
Get the set of all the items that have tags according to this collection.
Implements Tagcoll::ReadonlyCollection< ITEM, TAG >. |
|
|
|
|
|
Count the number of items.
|
|
|
|
Send to a consumer all the items which are tagged with at least the given tags.
Reimplemented from Tagcoll::ReadonlyCollection< ITEM, TAG >. |
|
Send the merged data to a consumer, but reversed: the tag become items, and they are tagged with the items that had them.
|
|
|