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


Member Function Documentation

void ept::debtags::Vocabulary::parseVocBuf ( std::map< std::string, std::string > &  res,
size_t  ofs,
size_t  len 
) const [protected]

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

Get the timestamp of when the index was last updated.

bool ept::debtags::Vocabulary::hasData (  )  const [inline]

Return true if this data source has data, false if it's empty.

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

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

bool ept::debtags::Vocabulary::hasFacet ( const std::string &  name  )  const [inline]

Check if the vocabulary contains the facet `name'.

bool ept::debtags::Vocabulary::hasTag ( const std::string &  fullname  )  const [inline]

Check if the vocabulary contains the tag `fullname'.

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

Return the facet with the given name.

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

Return the tag with the given full name.

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.

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

Return the facet with the given name.

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

Return the tag with the given full name.

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

Return all the facets in the vocabulary.

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

Return all the tags in the vocabulary.

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

Return the tags in the given facet.

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.

std::string ept::debtags::Vocabulary::tagName ( int  id  )  const [inline]

Get the tag name given the tag id.

std::string ept::debtags::Vocabulary::tagShortName ( int  id  )  const

Get the tag name given the tag id.

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]

time_t ept::debtags::Vocabulary::m_timestamp [protected]

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

int ept::debtags::Vocabulary::voc_fd [protected]

size_t ept::debtags::Vocabulary::voc_size [protected]

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

FacetIndex ept::debtags::Vocabulary::findex [protected]

TagIndex ept::debtags::Vocabulary::tindex [protected]

std::vector< std::map<std::string, std::string> > ept::debtags::Vocabulary::m_facetData [mutable, protected]

std::vector< std::map<std::string, std::string> > ept::debtags::Vocabulary::m_tagData [mutable, protected]

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


The documentation for this class was generated from the following files:
Generated on Fri Sep 14 23:09:23 2007 for libept by  doxygen 1.5.3