#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.
virtual Tagcoll::InputMerger< ITEM, TAG >::~InputMerger | ( | ) | [inline, virtual] |
void Tagcoll::InputMerger< T, Tag >::consumeItem | ( | const ITEM & | item, | |
const OpSet< TAG > & | tags | |||
) | [protected, virtual] |
OpSet< Tag > Tagcoll::InputMerger< T, Tag >::getTagsOfItem | ( | const ITEM & | item | ) | const [protected, virtual] |
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'.
Implements Tagcoll::ReadonlyCollection< ITEM, 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'.
Reimplemented from Tagcoll::ReadonlyCollection< ITEM, TAG >.
bool Tagcoll::InputMerger< ITEM, TAG >::hasItem | ( | const ITEM & | item | ) | const [inline] |
void Tagcoll::InputMerger< T, Tag >::output | ( | Consumer< ITEM, TAG > & | consumer | ) | const |
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::ReadonlyCollection< ITEM, 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.
void Tagcoll::InputMerger< T, Tag >::applyChange | ( | const PatchList< ITEM, TAG > & | change | ) |
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::ReadonlyCollection< ITEM, TAG >.
OpSet< Tag > Tagcoll::InputMerger< T, Tag >::getAllTags | ( | ) | const [virtual] |
Get the set of all the tags in this collection.
Implements Tagcoll::ReadonlyCollection< ITEM, TAG >.
OpSet< Tag > Tagcoll::InputMerger< T, Tag >::getCompanionTags | ( | const OpSet< TAG > & | ts | ) | const |
OpSet< T > Tagcoll::InputMerger< T, Tag >::getRelatedItems | ( | const OpSet< TAG > & | ts, | |
int | maxdistance = 1 | |||
) | const |
unsigned int Tagcoll::InputMerger< T, Tag >::itemCount | ( | ) | const |
Count the number of items.
void Tagcoll::InputMerger< T, Tag >::clear | ( | ) |
Empty the collection.
std::map< ITEM, OpSet<TAG> > Tagcoll::InputMerger< ITEM, TAG >::coll [protected] |