#include <TDBIndexer.h>
Inheritance diagram for Tagcoll::TDBIndexer< ITEM, TAG >:
Public Member Functions | |
virtual | ~TDBIndexer () |
virtual bool | hasItem (const ITEM &item) const |
virtual bool | hasTag (const TAG &tag) const |
Check if the collection contains a tag. | |
virtual OpSet< ITEM > | getTaggedItems () const |
Get the set of all the items that have tags according to this collection. | |
virtual OpSet< TAG > | getAllTags () const |
Get the set of all the tags in this collection. | |
virtual void | output (Consumer< ITEM, TAG > &consumer) const |
Output all the contents of the collection to a Consumer. | |
virtual void | applyChange (const PatchList< ITEM, TAG > &change) |
Apply a patch to the collection. | |
void | writeIndex (Converter< ITEM, std::string > &itemconv, Converter< TAG, std::string > &tagconv, const std::string &pkgidx, const std::string &tagidx) const |
Write all collected informations to a disk index. | |
Protected Member Functions | |
virtual void | consumeItem (const ITEM &item, const OpSet< TAG > &tags) |
Process a tagged item, with its tags. | |
virtual void | consumeItems (const OpSet< ITEM > &items, const OpSet< TAG > &tags) |
Process a set of items identically tagged, with their tags. | |
virtual OpSet< ITEM > | getItemsHavingTag (const TAG &tag) const |
Get the items which are tagged with at least the tag `tag'. | |
virtual OpSet< TAG > | getTagsOfItem (const ITEM &item) const |
Get the tags attached to an item. | |
Protected Attributes | |
std::map< ITEM, OpSet< TAG > > | items |
std::map< TAG, OpSet< ITEM > > | tags |
It can be used as a working collection, and it can also write its contents into an on-disk index that can later be used by TDBDiskIndex.
On-disk indexes produced by TDBIndexer are written in a single, optimised run and tend to be more compact than the ones created by TDBDiskIndex.
|
|
|
Apply a patch to the collection. Example: void perform(const PatchList<ITEM, TAG>& change) { collection.applyChange(change); undo.push_back(change.getReverse()); } Implements Tagcoll::Collection< ITEM, TAG >. |
|
Process a tagged item, with its tags.
Implements Tagcoll::Consumer< ITEM, TAG >. |
|
Process a set of items identically tagged, with their tags.
Reimplemented from Tagcoll::Consumer< ITEM, TAG >. |
|
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 set of all the items that have tags according to this collection.
Implements Tagcoll::ReadonlyCollection< ITEM, TAG >. |
|
Get the tags attached to an item.
Implements Tagcoll::ReadonlyCollection< ITEM, TAG >. |
|
|
|
Check if the collection contains a tag.
Reimplemented from Tagcoll::ReadonlyCollection< ITEM, TAG >. |
|
Output all the contents of the collection to a Consumer.
Implements Tagcoll::ReadonlyCollection< ITEM, TAG >. |
|
Write all collected informations to a disk index.
|
|
|
|
|