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’.
 
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.
 
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]

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

References items.

◆ begin() [2/2]

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

References items.

◆ clear()

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

References items, and tags.

◆ empty()

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

References items.

◆ end() [1/2]

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

References items.

◆ end() [2/2]

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

References items.

◆ findTagWithMaxCardinality()

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

References res, and tags.

◆ getAllTags()

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

References res, and tags.

◆ getAllTagsAsVector()

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

References res, and tags.

◆ 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 items, res, and tags.

◆ getItemsExactMatch()

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

References getItemsHavingTags(), items, res, and tags.

◆ getItemsHavingTag()

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

References tags.

Referenced by getItemsHavingTags(), and getTagsImplying().

◆ 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 getItemsHavingTag(), res, and tags.

Referenced by getItemsExactMatch().

◆ getTaggedItems()

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

References items, and res.

◆ getTagsImplying()

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

◆ getTagsOfItem()

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

References items.

◆ hasItem()

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

References items.

◆ hasTag()

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

References tags.

◆ insert() [1/3]

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

References insert(), items, and tags.

◆ insert() [2/3]

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

References items, and tags.

◆ insert() [3/3]

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

References items, and tags.

Referenced by insert(), and ept::debtags::coll::textformat::parse().

◆ itemCount()

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

References items.

◆ removeTag()

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

References items, and tags.

Referenced by removeTagsWithCardinalityLessThan().

◆ removeTagsWithCardinalityLessThan()

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

References removeTag(), and tags.

◆ tagBegin() [1/2]

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

References tags.

◆ tagBegin() [2/2]

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

References tags.

◆ tagCount()

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

References tags.

◆ tagEnd() [1/2]

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

References tags.

◆ tagEnd() [2/2]

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

References tags.

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: