libept
Public Types | Public Member Functions | Protected Attributes | List of all members
ept::debtags::coll::Fast Class Reference

In-memory collection with both item->tags and tag->items mappings. More...

#include <fast.h>

Inheritance diagram for ept::debtags::coll::Fast:
ept::debtags::Debtags

Public Types

typedef std::map< std::string, std::set< std::string > >::const_iterator const_iterator
 
typedef std::map< std::string, std::set< std::string > >::iterator iterator
 
typedef std::map< std::string, std::set< std::string > >::value_type value_type
 
typedef std::map< std::string, std::set< std::string > >::const_iterator const_tag_iterator
 
typedef std::map< std::string, std::set< std::string > >::iterator tag_iterator
 

Public Member Functions

const_iterator begin () const
 
const_iterator end () const
 
iterator begin ()
 
iterator end ()
 
const_tag_iterator tagBegin () const
 
const_tag_iterator tagEnd () const
 
tag_iterator tagBegin ()
 
tag_iterator tagEnd ()
 
void insert (const std::string &item, const std::set< std::string > &tags)
 
void insert (const std::set< std::string > &items, const std::string &tag)
 
void insert (const std::set< std::string > &items, const std::set< std::string > &tags)
 
void clear ()
 
std::set< std::string > getTagsOfItem (const std::string &item) const
 
std::set< std::string > getItemsHavingTag (const std::string &tag) const
 
std::set< std::string > getItemsHavingTags (const std::set< std::string > &tags) const
 Get the items which are tagged with at least the tags `tags'. More...
 
bool empty () const
 
bool hasItem (const std::string &item) const
 
bool hasTag (const std::string &tag) const
 
std::set< std::string > getTaggedItems () const
 
std::set< std::string > getAllTags () const
 
std::vector< std::string > getAllTagsAsVector () const
 
unsigned int itemCount () const
 
unsigned int tagCount () const
 
std::set< std::string > getTagsImplying (const std::string &tag) const
 
std::set< std::string > getItemsExactMatch (const std::set< std::string > &tags) const
 
std::string findTagWithMaxCardinality (size_t &card) const
 
Fast getChildCollection (const std::string &tag) const
 Return the collection with only those items that have this tag, but with the given tag removed. More...
 
void removeTag (const std::string &tag)
 
void removeTagsWithCardinalityLessThan (size_t card)
 

Protected Attributes

std::map< std::string, std::set< std::string > > items
 
std::map< std::string, std::set< std::string > > tags
 

Detailed Description

In-memory collection with both item->tags and tag->items mappings.

Member Typedef Documentation

◆ const_iterator

typedef std::map<std::string, std::set<std::string> >::const_iterator ept::debtags::coll::Fast::const_iterator

◆ const_tag_iterator

typedef std::map<std::string, std::set<std::string> >::const_iterator ept::debtags::coll::Fast::const_tag_iterator

◆ iterator

typedef std::map<std::string, std::set<std::string> >::iterator ept::debtags::coll::Fast::iterator

◆ tag_iterator

typedef std::map<std::string, std::set<std::string> >::iterator ept::debtags::coll::Fast::tag_iterator

◆ value_type

typedef std::map<std::string, std::set<std::string> >::value_type ept::debtags::coll::Fast::value_type

Member Function Documentation

◆ begin() [1/2]

const_iterator ept::debtags::coll::Fast::begin ( ) const
inline

◆ begin() [2/2]

iterator ept::debtags::coll::Fast::begin ( )
inline

◆ clear()

void ept::debtags::coll::Fast::clear ( )
inline

◆ empty()

bool ept::debtags::coll::Fast::empty ( ) const
inline

◆ end() [1/2]

const_iterator ept::debtags::coll::Fast::end ( ) const
inline

◆ end() [2/2]

iterator ept::debtags::coll::Fast::end ( )
inline

◆ findTagWithMaxCardinality()

std::string ept::debtags::coll::Fast::findTagWithMaxCardinality ( size_t &  card) const

References res.

Referenced by tagCount().

◆ getAllTags()

std::set< std::string > ept::debtags::coll::Fast::getAllTags ( ) const

References res.

Referenced by hasTag().

◆ getAllTagsAsVector()

std::vector< std::string > ept::debtags::coll::Fast::getAllTagsAsVector ( ) const

References res.

Referenced by hasTag().

◆ getChildCollection()

Fast ept::debtags::coll::Fast::getChildCollection ( const std::string &  tag) const

Return the collection with only those items that have this tag, but with the given tag removed.

References insert(), removeTag(), and res.

Referenced by tagCount().

◆ getItemsExactMatch()

std::set< std::string > ept::debtags::coll::Fast::getItemsExactMatch ( const std::set< std::string > &  tags) const

References res.

Referenced by tagCount().

◆ getItemsHavingTag()

std::set< std::string > ept::debtags::coll::Fast::getItemsHavingTag ( const std::string &  tag) const

Referenced by clear().

◆ getItemsHavingTags()

std::set< std::string > ept::debtags::coll::Fast::getItemsHavingTags ( const std::set< std::string > &  tags) const

Get the items which are tagged with at least the tags `tags'.

Returns
The items found, or an empty set if no items have that tag

References res.

Referenced by clear().

◆ getTaggedItems()

std::set< std::string > ept::debtags::coll::Fast::getTaggedItems ( ) const

References res.

Referenced by hasTag().

◆ getTagsImplying()

std::set< std::string > ept::debtags::coll::Fast::getTagsImplying ( const std::string &  tag) const

References res, and ept::debtags::coll::utils::set_contains().

Referenced by tagCount().

◆ getTagsOfItem()

std::set< std::string > ept::debtags::coll::Fast::getTagsOfItem ( const std::string &  item) const

Referenced by clear().

◆ hasItem()

bool ept::debtags::coll::Fast::hasItem ( const std::string &  item) const
inline

◆ hasTag()

bool ept::debtags::coll::Fast::hasTag ( const std::string &  tag) const
inline

◆ insert() [1/3]

void ept::debtags::coll::Fast::insert ( const std::string &  item,
const std::set< std::string > &  tags 
)

◆ insert() [2/3]

void ept::debtags::coll::Fast::insert ( const std::set< std::string > &  items,
const std::string &  tag 
)

◆ insert() [3/3]

void ept::debtags::coll::Fast::insert ( const std::set< std::string > &  items,
const std::set< std::string > &  tags 
)

◆ itemCount()

unsigned int ept::debtags::coll::Fast::itemCount ( ) const
inline

◆ removeTag()

void ept::debtags::coll::Fast::removeTag ( const std::string &  tag)

Referenced by getChildCollection(), and tagCount().

◆ removeTagsWithCardinalityLessThan()

void ept::debtags::coll::Fast::removeTagsWithCardinalityLessThan ( size_t  card)

Referenced by tagCount().

◆ tagBegin() [1/2]

const_tag_iterator ept::debtags::coll::Fast::tagBegin ( ) const
inline

◆ tagBegin() [2/2]

tag_iterator ept::debtags::coll::Fast::tagBegin ( )
inline

◆ tagCount()

unsigned int ept::debtags::coll::Fast::tagCount ( ) const
inline

◆ tagEnd() [1/2]

const_tag_iterator ept::debtags::coll::Fast::tagEnd ( ) const
inline

◆ tagEnd() [2/2]

tag_iterator ept::debtags::coll::Fast::tagEnd ( )
inline

References insert().

Member Data Documentation

◆ items

std::map<std::string, std::set<std::string> > ept::debtags::coll::Fast::items
protected

◆ tags

std::map<std::string, std::set<std::string> > ept::debtags::coll::Fast::tags
protected

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