00001 #ifndef _LINGUISTICDEFINITION_LINGFEATURESSET_H_ 00002 #define _LINGUISTICDEFINITION_LINGFEATURESSET_H_ 00003 00004 #include "LingDef.h" 00005 #include "LingFeatures.h" 00006 00007 #include <string> 00008 #include <set> 00009 00010 namespace LinguisticDefinition { 00011 00076 class LingFeaturesSet { 00077 public: 00078 00082 LingFeaturesSet(); 00083 00087 ~LingFeaturesSet(); 00088 00092 void add(const LingFeatures &); 00093 00097 void remove(const LingFeatures *); 00098 00102 bool isEmpty() const; 00103 00107 void set(const std::string &feature); 00108 00112 void set(const LingDef::Feature &); 00113 00117 bool has(const std::string &feature) const; 00118 00122 bool has(const LingDef::Feature &) const; 00123 00127 void setEnum(const std::string &enumFeature, 00128 const std::string &valueFeature); 00129 00133 void setEnum(const LingDef::Feature &enumFeature, 00134 const LingDef::Feature &valueFeature); 00135 00139 void getEnumValues(const std::string &enumFeature, 00140 std::set<const LingDef::Feature *> &) const; 00141 00145 void getEnumValues(const LingDef::Feature &enumFeature, 00146 std::set<const LingDef::Feature *> &) const; 00147 00151 typedef std::set<LingFeatures *> ElementSet; 00152 00156 typedef ElementSet::const_iterator ElementIterator; 00157 00161 ElementIterator elementsBegin() const; 00162 00166 ElementIterator elementsEnd() const; 00167 00168 private: 00169 const LingDef *d_lingDef; 00170 const LingDef::Pos *d_posDef; 00171 bool d_sharedPosDef; 00172 00173 ElementSet d_elements; 00174 ElementSet d_removedElements; 00175 }; 00176 00177 } 00178 00179 #endif //_LINGUISTICDEFINITION_LINGFEATURESSET_H_