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

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

#include <TDBIndexer.h>

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

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

List of all members.


Detailed Description

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

In-memory collection whose representation is organised similarly to the on-disk representation used by TDBDiskIndex.

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.

Definition at line 45 of file TDBIndexer.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 hasItem (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
void writeIndex (Converter< ITEM, std::string > &itemconv, Converter< TAG, std::string > &tagconv, const std::string &pkgidx, const std::string &tagidx) const

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

std::map< ITEM, OpSet< TAG > > items
std::map< TAG, OpSet< ITEM > > tags

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

Generated by  Doxygen 1.6.0   Back to index