#include <tag.h>
ept::debtags::Facet represents a Facet with all its informations. It is guaranteed to have fast value-copy semantics, so it can be passed around freely and efficiently without worrying about memory management issues.
The class is normally instantiated using a Vocabulary:
Facet facet = vocabulary.faceByName("made-of");
Facets can contain an "invalid" value, in which case using any of their methods will likely produce segfault. The "invalid" facets are useful as "none" return values:
Facet facet = vocabulary.facetByName("made-of"); if (!facet) throw SomeException("facet \"made-of\" has not been defined");
Public Member Functions | |
Facet () | |
~Facet () | |
bool | operator== (const Facet &f) const |
bool | operator!= (const Facet &f) const |
bool | operator< (const Facet &f) const |
operator bool () const | |
Return true if the facet is valid. | |
bool | valid () const |
std::string | name () const |
Return the name of the facet. | |
std::string | name (const std::string &d) const |
std::string | shortDescription () const |
Return the short description of the facet. | |
std::string | shortDescription (const std::string &d) const |
std::string | longDescription () const |
Return the long description of the facet. | |
std::string | longDescription (const std::string &d) const |
bool | hasTag (const std::string &name) const |
Return true if the facet has a tag with the given name (name, not fullname). | |
std::set< Tag > | tags () const |
Return the list of tags in this facet. | |
int | id () const |
Return the ID of this facet. | |
Protected Member Functions | |
Facet (const Vocabulary *tags, int id) | |
Protected Attributes | |
const Vocabulary * | m_tags |
int | m_id |
Friends | |
class | Vocabulary |
ept::debtags::Facet::Facet | ( | const Vocabulary * | tags, | |
int | id | |||
) | [inline, protected] |
ept::debtags::Facet::Facet | ( | ) | [inline] |
ept::debtags::Facet::~Facet | ( | ) | [inline] |
bool ept::debtags::Facet::operator== | ( | const Facet & | f | ) | const [inline] |
bool ept::debtags::Facet::operator!= | ( | const Facet & | f | ) | const [inline] |
bool ept::debtags::Facet::operator< | ( | const Facet & | f | ) | const [inline] |
ept::debtags::Facet::operator bool | ( | ) | const [inline] |
Return true if the facet is valid.
bool ept::debtags::Facet::valid | ( | ) | const [inline] |
std::string ept::debtags::Facet::name | ( | ) | const |
Return the name of the facet.
std::string ept::debtags::Facet::name | ( | const std::string & | d | ) | const |
std::string ept::debtags::Facet::shortDescription | ( | ) | const |
Return the short description of the facet.
std::string ept::debtags::Facet::shortDescription | ( | const std::string & | d | ) | const |
std::string ept::debtags::Facet::longDescription | ( | ) | const |
Return the long description of the facet.
std::string ept::debtags::Facet::longDescription | ( | const std::string & | d | ) | const |
bool ept::debtags::Facet::hasTag | ( | const std::string & | name | ) | const |
Return true if the facet has a tag with the given name (name, not fullname).
std::set< Tag > ept::debtags::Facet::tags | ( | ) | const |
Return the list of tags in this facet.
int ept::debtags::Facet::id | ( | ) | const [inline] |
Return the ID of this facet.
friend class Vocabulary [friend] |
const Vocabulary* ept::debtags::Facet::m_tags [protected] |
int ept::debtags::Facet::m_id [protected] |