Logo Search packages:      
Sourcecode: tagcoll version File versions  Download package

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

#include <TDBDiskIndex.h>

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

Tagcoll::Collection< ITEM, TAG > Tagcoll::Consumer< ITEM, TAG >

List of all members.


Detailed Description

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

Full TaggedCollection implementation on top of a persistent on-disk TDB database.

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.

Definition at line 50 of file TDBDiskIndex.h.


Public Member Functions

virtual void applyChange (const PatchList< ITEM, TAG > &change)
void consume (const OpSet< ITEM > &items, const OpSet< TAG > &tags)
 Process a set of items identically tagged, with their tags.
void consume (const OpSet< ITEM > &items)
 Process a set of items, all with no tags.
void consume (const ITEM &item, const OpSet< TAG > &tags)
 Process a tagged item, with its tags.
void consume (const ITEM &item)
 Process an untagged item.
virtual OpSet< TAG > getAllTags () const
virtual int getCardinality (const TAG &tag) const
virtual OpSet< TAG > getCompanionTags (const OpSet< TAG > &tags) const
OpSet< ITEM > getItems (const OpSet< TAG > &tags) const
OpSet< ITEM > getItems (const TAG &tag) const
virtual OpSet< ITEM > getRelatedItems (const OpSet< TAG > &tags, int maxdistance=1) const
virtual OpSet< ITEM > getTaggedItems () const
OpSet< TAG > getTags (const OpSet< ITEM > &items) const
OpSet< TAG > getTags (const ITEM &item) const
virtual bool hasTag (const TAG &tag) const
virtual void output (Consumer< ITEM, TAG > &consumer) const
virtual void outputHavingTags (const OpSet< TAG > &tags, Consumer< ITEM, TAG > &consumer) const
 TDBDiskIndex (const std::string &pkgidx, const std::string &tagidx, Converter< ITEM, std::string > &fromitem, Converter< TAG, std::string > &fromtag, Converter< std::string, ITEM > &toitem, Converter< std::string, TAG > &totag, bool write=true)

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.
void consumeItemsUntagged (const OpSet< ITEM > &)
 Process a set of items, all with no tags.
void consumeItemUntagged (const ITEM &)
 Process an untagged item.
virtual OpSet< ITEM > getItemsHavingTag (const TAG &tag) const
virtual OpSet< ITEM > getItemsHavingTags (const OpSet< TAG > &tags) const
virtual OpSet< TAG > getTagsOfItem (const ITEM &item) const
virtual OpSet< TAG > getTagsOfItems (const OpSet< ITEM > &items) const

Protected Attributes

Converter< ITEM, std::string > & fromitem
Converter< TAG, std::string > & fromtag
TDBFile pkgdb
TDBFile tagdb
Converter< std::string, ITEM > & toitem
Converter< std::string, TAG > & totag

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index