ept::debtags::Vocabulary Class Reference

#include <vocabulary.h>

Collaboration diagram for ept::debtags::Vocabulary:

Collaboration graph
[legend]

List of all members.

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 FacetIndexfacetIndex () const
const TagIndextagIndex () 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< TagtagsByID (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< Facetfacets () const
 Return all the facets in the vocabulary.
std::set< Tagtags () const
 Return all the tags in the vocabulary.
std::set< Tagtags (int facet) const
 Return the tags in the given facet.
std::set< Tagtags (const std::string &facetName) const
std::set< Tagtags (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

Classes

class  FacetIndex
class  TagIndex


Constructor & Destructor Documentation

ept::debtags::Vocabulary::Vocabulary (  ) 

ept::debtags::Vocabulary::~Vocabulary (  ) 

References voc_buf, voc_fd, and voc_size.


Member Function Documentation

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().

time_t ept::debtags::Vocabulary::timestamp (  )  const [inline]

Get the timestamp of when the index was last updated.

References m_timestamp.

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().

const FacetIndex& ept::debtags::Vocabulary::facetIndex (  )  const [inline]

References findex.

const TagIndex& ept::debtags::Vocabulary::tagIndex (  )  const [inline]

References tindex.

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 TestVocabulary::_18(), and ept::debtags::Facet::hasTag().

Facet ept::debtags::Vocabulary::facetByID ( int  id  )  const

Return the facet with the given name.

Referenced by TestVocabulary::_14(), facetByName(), facetByTag(), and facets().

Tag ept::debtags::Vocabulary::tagByID ( int  id  )  const

template<typename IDS>
std::set<Tag> ept::debtags::Vocabulary::tagsByID ( const IDS &  ids  )  const [inline]

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().

Facet ept::debtags::Vocabulary::facetByName ( const std::string &  name  )  const [inline]

Tag ept::debtags::Vocabulary::tagByName ( const std::string &  fullname  )  const [inline]

std::set< Facet > ept::debtags::Vocabulary::facets (  )  const [inline]

std::set< Tag > ept::debtags::Vocabulary::tags (  )  const [inline]

std::set< Tag > ept::debtags::Vocabulary::tags ( int  facet  )  const [inline]

std::set< Tag > ept::debtags::Vocabulary::tags ( const std::string &  facetName  )  const [inline]

std::set< Tag > ept::debtags::Vocabulary::tags ( const Facet facet  )  const [inline]

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::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::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().

const std::map< std::string, std::string > & ept::debtags::Vocabulary::facetData ( int  id  )  const

const std::map< std::string, std::string > & ept::debtags::Vocabulary::tagData ( int  id  )  const


Member Data Documentation

tagcoll::diskindex::MasterMMap ept::debtags::Vocabulary::mastermmap [protected]

Referenced by Vocabulary().

Referenced by hasData(), timestamp(), and Vocabulary().

std::string ept::debtags::Vocabulary::voc_fname [protected]

Referenced by parseVocBuf(), and Vocabulary().

Referenced by Vocabulary(), and ~Vocabulary().

Referenced by Vocabulary(), and ~Vocabulary().

const char* ept::debtags::Vocabulary::voc_buf [protected]

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().

std::map<std::string, std::string> ept::debtags::Vocabulary::emptyData [protected]

Referenced by facetData(), and tagData().


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

Generated on Sun Jul 27 05:54:46 2008 for libept by  doxygen 1.5.6