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

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

#include <CardinalityStore.h>

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

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

List of all members.


Detailed Description

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

In-memory collection keeping a fast-access track of tag cardinalities.

This in-memory collection has different computational-complexity behaviour from InputMerger, TDBIndexer or TDBDiskIndex, and can be more or less suited to be used as a collection than the other alternatives, depending on the computational needs of the caller.

Definition at line 52 of file CardinalityStore.h.

typedef tagsets_t::const_iterator const_iterator
typedef tagsets_t::iterator iterator
const_iterator begin () const
iterator begin ()
const_iterator end () const
iterator end ()

Public Types

typedef std::map< OpSet< TAG >
, OpSet< ITEM > > 
tagsets_t

Public Member Functions

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.
TAG findTagWithMaxCardinalityNotIn (const OpSet< TAG > &tags, int *card=0) const
OpSet< TAG > getAllTags () const
int getCardinality (const TAG &tag) const
CardinalityStore< ITEM, TAG > getChildCollection (const TAG &tag) const
CardinalityStore< ITEM, TAG > getCollectionWithoutTags (const OpSet< TAG > &tag) const
CardinalityStore< ITEM, TAG > getCollectionWithoutTagsetsHaving (const TAG &tag) const
CardinalityStore< ITEM, TAG > getCollectionWithoutTagsetsHavingAnyOf (const OpSet< TAG > &tag) const
OpSet< ITEM > getCompanionItems (const OpSet< TAG > &ts) const
 Get the set of all items in this collection whose tagsets contain `ts'.
std::map< ITEM, OpSet< TAG > > getCompanionItemsAndTagsets (const OpSet< TAG > &ts) const
 Get the set of all items in this collection whose tagsets contain `ts'.
OpSet< TAG > getCompanionTags (const OpSet< TAG > &ts) const
OpSet< TAG > getImpliedBy (const TAG &tag) const
 Return the list of tags that the given tag implies.
OpSet< ITEM > getItems (const OpSet< TAG > &tags) const
OpSet< ITEM > getItems (const TAG &tag) const
OpSet< ITEM > getItemsExactMatch (const OpSet< TAG > &ts) const
 Get the set of items with exactly the given tagset.
OpSet< ITEM > getRelatedItems (const OpSet< TAG > &ts, int maxdistance=1) const
std::list< OpSet< TAG > > getRelatedTagsets (const OpSet< TAG > &ts, int maxdistance=1) const
 Get the list of tagsets related to the given one, with distance > 0 and <= maxdistance.
OpSet< ITEM > getTaggedItems () const
OpSet< TAG > getTags (const OpSet< ITEM > &items) const
OpSet< TAG > getTags (const ITEM &item) const
bool hasItem (const ITEM &item) const
bool hasTag (const TAG &tag) const
int itemCount () const
 Get the total number of items in this collection.
void mergeEquivalentTags ()
void output (Consumer< ITEM, TAG > &cons) const
void outputHavingTags (const OpSet< TAG > &ts, Consumer< ITEM, TAG > &consumer) const
void removeTagsWithCardinalityLessThan (int card)
int tagCount () const
 Get the number of different tags in this collection.
int tagsetCount () const
 Get the number of different tag sets in this collection.

Protected Member Functions

void consumeItem (const ITEM &item, const OpSet< TAG > &tagset)
 Process a tagged item, with its tags.
void consumeItems (const OpSet< ITEM > &items, const OpSet< TAG > &tagset)
 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.
OpSet< TAG > getImplyingOneOf (const OpSet< TAG > &tags) const
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

TagContainer tags
tagsets_t tagsets

Classes

class  TagContainer

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

Generated by  Doxygen 1.6.0   Back to index