#include <IntDiskIndex.h>
Inheritance diagram for Tagcoll::IntDiskIndex< ITEM, TAG >:
Public Member Functions | |
IntDiskIndex () | |
Create a new IntDiskIndex. | |
IntDiskIndex (const MasterMMapIndex &master, int pkgindex, int tagindex, const Converter< ITEM, int > *fromitem, const Converter< TAG, int > *fromtag, const Converter< int, ITEM > *toitem, const Converter< int, TAG > *totag) | |
virtual | ~IntDiskIndex () |
void | init (const MasterMMapIndex &master, int pkgindex, int tagindex, const Converter< ITEM, int > *fromitem, const Converter< TAG, int > *fromtag, const Converter< int, ITEM > *toitem, const Converter< int, TAG > *totag) |
void | init (const MasterMMapIndex &master, int pkgindex, int tagindex) |
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 int | getCardinality (const TAG &tag) const |
Get the cardinality of tag `tag' (that is, the number of items who have it). | |
virtual OpSet< TAG > | getCompanionTags (const OpSet< TAG > &tags) const |
Get the set of all tags in this collection that appear in tagsets containing `tags'. | |
virtual void | output (Consumer< ITEM, TAG > &consumer) const |
Output all the contents of the collection to a Consumer. | |
Protected Member Functions | |
int | fromitem (const ITEM &tag) const |
int | fromtag (const TAG &tag) const |
ITEM | toitem (const int &tag) const |
TAG | totag (const int &tag) 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'. | |
virtual OpSet< TAG > | getTagsOfItem (const ITEM &item) const |
Get the tags attached to an item. | |
virtual OpSet< TAG > | getTagsOfItems (const OpSet< ITEM > &items) const |
Get all the tags attached to the items in a set. | |
Protected Attributes | |
IntIndex | pkgidx |
IntIndex | tagidx |
const Converter< ITEM, int > * | m_fromitem |
const Converter< TAG, int > * | m_fromtag |
const Converter< int, ITEM > * | m_toitem |
const Converter< int, TAG > * | m_totag |
It allows to efficiently query a collection without having to store it all into memory.
If used for heavy modifications, the performance is slower compared to other in-memory collections. If database writes are mainly used for populating the index, then TDBIndexer should be used to create the index and TDBDiskIndex to access it afterwards.
|
Create a new IntDiskIndex.
|
|
|
|
|
|
|
|
|
|
Get the set of all the tags in this collection.
Implements Tagcoll::ReadonlyCollection< ITEM, TAG >. |
|
Get the cardinality of tag `tag' (that is, the number of items who have it).
Reimplemented from Tagcoll::ReadonlyCollection< ITEM, TAG >. |
|
Get the set of all tags in this collection that appear in tagsets containing `tags'. Example: void refineSelection(const OpSet<Tag>& selection) { OpSet<Tag> extraTags = collection.getCompanionTags(selection); tagMenu.setAvailableOptions(extraTags); } Reimplemented from 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 >. |
|
Get the tags attached to an item.
Implements Tagcoll::ReadonlyCollection< ITEM, TAG >. |
|
Get all the tags attached to the items in a set.
Reimplemented from 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 >. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|