libept
0.5.25
|
#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. More... | |
bool | hasData () const |
Return true if this data source has data, false if it's empty. More... | |
const FacetIndex & | facetIndex () const |
const TagIndex & | tagIndex () const |
bool | hasFacet (const std::string &name) const |
Check if the vocabulary contains the facet `name'. More... | |
bool | hasTag (const std::string &fullname) const |
Check if the vocabulary contains the tag `fullname'. More... | |
Facet | facetByID (int id) const |
Return the facet with the given name. More... | |
Tag | tagByID (int id) const |
Return the tag with the given full name. More... | |
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. More... | |
Facet | facetByName (const std::string &name) const |
Return the facet with the given name. More... | |
Tag | tagByName (const std::string &fullname) const |
Return the tag with the given full name. More... | |
std::set< Facet > | facets () const |
Return all the facets in the vocabulary. More... | |
std::set< Tag > | tags () const |
Return all the tags in the vocabulary. More... | |
std::set< Tag > | tags (int facet) const |
Return the tags in the given facet. More... | |
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. More... | |
std::string | tagName (int id) const |
Get the tag name given the tag id. More... | |
std::string | tagShortName (int id) const |
Get the tag name given the tag id. More... | |
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 |
ept::debtags::Vocabulary::Vocabulary | ( | ) |
Facet ept::debtags::Vocabulary::facetByID | ( | int | id | ) | const |
Return the facet with the given name.
Referenced by facetByName(), facetByTag(), and facets().
|
inline |
Return the facet with the given name.
References facetByID(), findex, and ept::debtags::Vocabulary::FacetIndex::id().
|
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 |
|
inline |
References findex.
|
inline |
Get the facet name given the facet id.
References findex, and ept::debtags::Vocabulary::FacetIndex::name().
Referenced by ept::debtags::Facet::name().
|
inline |
Return all the facets in the vocabulary.
References facetByID(), findex, and ept::debtags::Vocabulary::FacetIndex::size().
Referenced by TestVocabulary::_21().
|
inline |
Return true if this data source has data, false if it's empty.
References m_timestamp.
Referenced by TestVocabulary::_21().
|
inline |
Check if the vocabulary contains the facet `name'.
References findex, and ept::debtags::Vocabulary::FacetIndex::id().
|
inline |
Check if the vocabulary contains the tag `fullname'.
References ept::debtags::Vocabulary::TagIndex::id(), and tindex.
Referenced by ept::debtags::Facet::hasTag().
|
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().
|
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 |
|
inline |
Get the tag name given the tag id.
References ept::debtags::Vocabulary::TagIndex::name(), and tindex.
Referenced by ept::debtags::Tag::fullname().
|
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().
|
inline |
Return the tags in the given facet.
References findex, ept::debtags::Vocabulary::FacetIndex::firsttag(), ept::debtags::Vocabulary::FacetIndex::lasttag(), and tagByID().
|
inline |
References findex, ept::debtags::Vocabulary::FacetIndex::id(), and tags().
References ept::debtags::Facet::id(), and tags().
|
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().
|
inline |
Get the timestamp of when the index was last updated.
References m_timestamp.
|
protected |
Referenced by facetData(), and tagData().
|
protected |
Referenced by facetByName(), facetData(), facetIndex(), facetName(), facets(), hasFacet(), tags(), and Vocabulary().
|
mutableprotected |
Referenced by facetData().
|
mutableprotected |
Referenced by tagData().
|
protected |
Referenced by hasData(), timestamp(), and Vocabulary().
|
protected |
Referenced by Vocabulary().
|
protected |
Referenced by facetByTag(), hasTag(), tagByName(), tagData(), tagIndex(), tagName(), tags(), tagShortName(), and Vocabulary().
|
protected |
Referenced by parseVocBuf(), Vocabulary(), and ~Vocabulary().
|
protected |
Referenced by Vocabulary(), and ~Vocabulary().
|
protected |
Referenced by parseVocBuf(), and Vocabulary().
|
protected |
Referenced by Vocabulary(), and ~Vocabulary().