#ifndef __ATTRIBUT_REGISTRAR__ #define __ATTRIBUT_REGISTRAR__ #include "attribut.hpp" namespace XMLIOSERVER { class AttributRegistrar { public : AttributRegistrar():attrList() {/* Ne rien faire de plus */} void RegisterAttribut(BaseAttribut* attribut){ attrList.addPtrObject(attribut); } StrHashMap& getAttributList(void) { return (attrList); } size_t getNbAttributes() const {return (attrList.getSize()); } bool hasAttribut(const string _id) { return (attrList.hasMappedValue(_id)); } BaseAttribut* getAttribut(const string _id) throw (XMLIOUndefinedValueException) { return (attrList[_id]); } void setSAttribut(const string& att_name, const std::string& value) { //std::cout << "Attribut :" << att_name<< ", " << value<< std::endl; if (hasAttribut(att_name)) { getAttribut(att_name)->setFromString(value) ; } else { ostringstream oss; oss << "CAttributRegistrar::setAttribut, could not find <<"<> attribut in registred list" <<">>"; throw XMLIOUndefinedValueException(oss.str()); } } ostream & PrintAttribut(ostream& o) {o << "A réimplémenter"; return o ;} ~AttributRegistrar(void) {/* Ne rien faire de plus */} private : StrHashMap attrList; }; // class AttributRegistrar }; // namespace XMLIOSERVER #endif //__ATTRIBUT_REGISTRAR__