libept
|
#include <vocabulary.h>
Classes | |
class | FacetIndex |
class | TagIndex |
Public Member Functions | |
Vocabulary () | |
~Vocabulary () | |
time_t | timestamp () const |
Get the timestamp of when the index was last updated. | |
bool | hasData () const |
Return true if this data source has data, false if it's empty. | |
const FacetIndex & | facetIndex () const |
const TagIndex & | tagIndex () const |
bool | hasFacet (const std::string &name) const |
Check if the vocabulary contains the facet `name'. | |
bool | hasTag (const std::string &fullname) const |
Check if the vocabulary contains the tag `fullname'. | |
Facet | facetByID (int id) const |
Return the facet with the given name. | |
Tag | tagByID (int id) const |
Return the tag with the given full name. | |
template<typename IDS > | |
std::set< Tag > | tagsByID (const IDS &ids) const |
Facet | facetByTag (int id) const |
Return the facet for the tag with the given ID. | |
Facet | facetByName (const std::string &name) const |
Return the facet with the given name. | |
Tag | tagByName (const std::string &fullname) const |
Return the tag with the given full name. | |
std::set< Facet > | facets () const |
Return all the facets in the vocabulary. | |
std::set< Tag > | tags () const |
Return all the tags in the vocabulary. | |
std::set< Tag > | tags (int facet) const |
Return the tags in the given facet. | |
std::set< Tag > | tags (const std::string &facetName) const |
std::set< Tag > | tags (const Facet &facet) const |
std::string | facetName (int id) const |
Get the facet name given the facet id. | |
std::string | tagName (int id) const |
Get the tag name given the tag id. | |
std::string | tagShortName (int id) const |
Get the tag name given the tag id. | |
const std::map< std::string, std::string > & | facetData (int id) const |
const std::map< std::string, std::string > & | tagData (int id) const |
Protected Member Functions | |
void | parseVocBuf (std::map< std::string, std::string > &res, size_t ofs, size_t len) const |
Protected Attributes | |
tagcoll::diskindex::MasterMMap | mastermmap |
time_t | m_timestamp |
std::string | voc_fname |
int | voc_fd |
size_t | voc_size |
const char * | voc_buf |
FacetIndex | findex |
TagIndex | tindex |
std::vector< std::map < std::string, std::string > > | m_facetData |
std::vector< std::map < std::string, std::string > > | m_tagData |
std::map< std::string, std::string > | emptyData |
References findex, m_timestamp, mastermmap, ept::debtags::VocabularyIndexer::obtainWorkingVocabulary(), timestamp(), tindex, voc_buf, voc_fd, voc_fname, and voc_size.
Facet ept::debtags::Vocabulary::facetByID | ( | int | id | ) | const |
Return the facet with the given name.
Referenced by facetByName(), facetByTag(), and facets().
Facet ept::debtags::Vocabulary::facetByName | ( | const std::string & | name | ) | const [inline] |
Return the facet with the given name.
References facetByID(), findex, and ept::debtags::Vocabulary::FacetIndex::id().
Facet ept::debtags::Vocabulary::facetByTag | ( | int | id | ) | const [inline] |
Return the facet for the tag with the given ID.
References ept::debtags::Vocabulary::TagIndex::facet(), facetByID(), and tindex.
Referenced by ept::debtags::Tag::facet().
const std::map< std::string, std::string > & ept::debtags::Vocabulary::facetData | ( | int | id | ) | const |
const FacetIndex& ept::debtags::Vocabulary::facetIndex | ( | ) | const [inline] |
References findex.
std::string ept::debtags::Vocabulary::facetName | ( | int | id | ) | const [inline] |
Get the facet name given the facet id.
References findex, and ept::debtags::Vocabulary::FacetIndex::name().
Referenced by ept::debtags::Facet::name().
std::set< Facet > ept::debtags::Vocabulary::facets | ( | ) | const [inline] |
Return all the facets in the vocabulary.
References facetByID(), findex, and ept::debtags::Vocabulary::FacetIndex::size().
Referenced by TestVocabulary::_21().
bool ept::debtags::Vocabulary::hasData | ( | ) | const [inline] |
Return true if this data source has data, false if it's empty.
References m_timestamp.
Referenced by TestVocabulary::_21().
bool ept::debtags::Vocabulary::hasFacet | ( | const std::string & | name | ) | const [inline] |
Check if the vocabulary contains the facet `name'.
References findex, and ept::debtags::Vocabulary::FacetIndex::id().
bool ept::debtags::Vocabulary::hasTag | ( | const std::string & | fullname | ) | const [inline] |
Check if the vocabulary contains the tag `fullname'.
References ept::debtags::Vocabulary::TagIndex::id(), and tindex.
Referenced by ept::debtags::Facet::hasTag().
void ept::debtags::Vocabulary::parseVocBuf | ( | std::map< std::string, std::string > & | res, |
size_t | ofs, | ||
size_t | len | ||
) | const [protected] |
References voc_buf, and voc_fname.
Referenced by facetData(), and tagData().
Tag ept::debtags::Vocabulary::tagByID | ( | int | id | ) | const |
Return the tag with the given full name.
Referenced by ept::debtags::IntToPkg< OUT >::operator=(), ept::debtags::PatchIntToString< OUT >::operator=(), tagByName(), tags(), and tagsByID().
Tag ept::debtags::Vocabulary::tagByName | ( | const std::string & | fullname | ) | const [inline] |
Return the tag with the given full name.
References ept::debtags::Vocabulary::TagIndex::id(), tagByID(), and tindex.
Referenced by TestVocabulary::_13(), ept::debtags::StringToInt< OUT >::operator=(), ept::debtags::StringToPkg< OUT >::operator=(), and ept::debtags::PatchStringToInt< OUT >::operator=().
const std::map< std::string, std::string > & ept::debtags::Vocabulary::tagData | ( | int | id | ) | const |
const TagIndex& ept::debtags::Vocabulary::tagIndex | ( | ) | const [inline] |
References tindex.
std::string ept::debtags::Vocabulary::tagName | ( | int | id | ) | const [inline] |
Get the tag name given the tag id.
References ept::debtags::Vocabulary::TagIndex::name(), and tindex.
Referenced by ept::debtags::Tag::fullname().
std::set< Tag > ept::debtags::Vocabulary::tags | ( | ) | const [inline] |
Return all the tags in the vocabulary.
References ept::debtags::Vocabulary::TagIndex::size(), tagByID(), and tindex.
Referenced by TestVocabulary::_21(), ept::debtags::Facet::tags(), and tags().
std::set< Tag > ept::debtags::Vocabulary::tags | ( | int | facet | ) | const [inline] |
Return the tags in the given facet.
References findex, ept::debtags::Vocabulary::FacetIndex::firsttag(), ept::debtags::Vocabulary::FacetIndex::lasttag(), and tagByID().
std::set< Tag > ept::debtags::Vocabulary::tags | ( | const std::string & | facetName | ) | const [inline] |
References findex, ept::debtags::Vocabulary::FacetIndex::id(), and tags().
std::set< Tag > ept::debtags::Vocabulary::tags | ( | const Facet & | facet | ) | const [inline] |
References ept::debtags::Facet::id(), and tags().
std::set<Tag> ept::debtags::Vocabulary::tagsByID | ( | const IDS & | ids | ) | const [inline] |
std::string ept::debtags::Vocabulary::tagShortName | ( | int | id | ) | const |
Get the tag name given the tag id.
References ept::debtags::Vocabulary::TagIndex::name(), and tindex.
Referenced by ept::debtags::Tag::name().
time_t ept::debtags::Vocabulary::timestamp | ( | ) | const [inline] |
Get the timestamp of when the index was last updated.
References m_timestamp.
Referenced by Vocabulary().
std::map<std::string, std::string> ept::debtags::Vocabulary::emptyData [protected] |
Referenced by facetData(), and tagData().
FacetIndex ept::debtags::Vocabulary::findex [protected] |
Referenced by facetByName(), facetData(), facetIndex(), facetName(), facets(), hasFacet(), tags(), and Vocabulary().
std::vector< std::map<std::string, std::string> > ept::debtags::Vocabulary::m_facetData [mutable, protected] |
Referenced by facetData().
std::vector< std::map<std::string, std::string> > ept::debtags::Vocabulary::m_tagData [mutable, protected] |
Referenced by tagData().
time_t ept::debtags::Vocabulary::m_timestamp [protected] |
Referenced by hasData(), timestamp(), and Vocabulary().
tagcoll::diskindex::MasterMMap ept::debtags::Vocabulary::mastermmap [protected] |
Referenced by Vocabulary().
TagIndex ept::debtags::Vocabulary::tindex [protected] |
Referenced by facetByTag(), hasTag(), tagByName(), tagData(), tagIndex(), tagName(), tags(), tagShortName(), and Vocabulary().
const char* ept::debtags::Vocabulary::voc_buf [protected] |
Referenced by parseVocBuf(), Vocabulary(), and ~Vocabulary().
int ept::debtags::Vocabulary::voc_fd [protected] |
Referenced by Vocabulary(), and ~Vocabulary().
std::string ept::debtags::Vocabulary::voc_fname [protected] |
Referenced by parseVocBuf(), and Vocabulary().
size_t ept::debtags::Vocabulary::voc_size [protected] |
Referenced by Vocabulary(), and ~Vocabulary().