Changeset 113
- Timestamp:
- 06/22/10 10:30:33 (14 years ago)
- Location:
- XMLIO_V2/dev/dev_rv/src/XMLIO
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/XMLIO/attribut.hpp
r111 r113 37 37 public : 38 38 39 bool hasValue ; 40 Ctype value ; 39 operator Ctype() const 40 { 41 if (!hasValue) throw XMLIOUndefinedValueException("L'attribut \"" + this->getName() + "\" est invalide !"); 42 return (value) ; 43 } 41 44 42 virtual bool _hasValue() const { return hasValue; } 45 virtual bool _hasValue() const { return (hasValue); } 46 47 protected : 43 48 44 49 Attribut(void) : hasValue(false) {} ; … … 64 69 } 65 70 66 operator Ctype() const67 {68 if (!hasValue) throw XMLIOUndefinedValueException("L'attribut \"" + this->getName() + "\" est invalide !");69 return value ;70 }71 72 71 virtual void assignValue(const BaseAttribut* _ba) 73 72 { value = ((Attribut*)_ba) -> value; hasValue = true; } … … 85 84 } 86 85 86 private : 87 88 bool hasValue ; 89 Ctype value ; 90 87 91 }; // class Attribut 88 92 }; // namespace XMLIOSERVER -
XMLIO_V2/dev/dev_rv/src/XMLIO/attribut_registrar.hpp
r108 r113 10 10 class AttributRegistrar 11 11 { 12 p ublic:12 protected : 13 13 14 14 AttributRegistrar():attrList() … … 18 18 const StrHashMap<BaseAttribut>& getAttributList(void) const { return (attrList); } 19 19 size_t getNbAttributes() const {return (attrList.getSize()); } 20 bool hasAttribut(const string& _id) { return (attrList.hasMappedValue(_id)); }20 bool hasAttribut(const string& _id) const { return (attrList.hasMappedValue(_id)); } 21 21 22 22 BaseAttribut* getAttribut(const string& _id) throw (XMLIOUndefinedValueException) { return (attrList[_id]); } … … 56 56 } 57 57 58 public :59 60 58 ~AttributRegistrar(void) 61 59 {/* Ne rien faire de plus */} 62 60 63 protected : 61 private : 62 64 63 StrHashMap<BaseAttribut> attrList; 65 64 -
XMLIO_V2/dev/dev_rv/src/XMLIO/axis.hpp
r112 r113 18 18 static string GetName(void) {return ("axis"); } 19 19 20 ~CAxis(void)20 virtual ~CAxis(void) 21 21 { /* Ne rien faire de plus */ } 22 22 -
XMLIO_V2/dev/dev_rv/src/XMLIO/base_attribut.hpp
r108 r113 17 17 virtual ostream & print(ostream& o) const = 0 ; 18 18 19 friend ostream& operator <<(ostream& o,const BaseAttribut& Attr) 20 {return Attr.print(o) ; } 19 friend ostream& operator <<(ostream& o,const BaseAttribut& Attr) { return (Attr.print(o)) ; } 20 21 bool hasId(void) const { return (true); } 22 23 virtual string getId(void) const { return (getName()); } ; 21 24 22 25 virtual void assignValue(const BaseAttribut*) = 0; 23 24 virtual string getId(void) const {return getName();} ;25 bool hasId(void){return (true);}26 27 26 virtual void setFromString(const std::string str) = 0; 27 virtual bool _hasValue() const = 0; 28 28 29 29 #define SETTER_AND_GETTER(TYPE) \ … … 45 45 #undef SETTER_AND_GETTER 46 46 47 48 virtual bool _hasValue() const = 0;49 50 47 static void error_set(void) 51 48 { throw XMLIOIncompatibleTypeException("BaseAttribut::set<type> > Setting value type is incompatible with attribut type"); } -
XMLIO_V2/dev/dev_rv/src/XMLIO/container.hpp
r112 r113 33 33 } 34 34 35 bool hasMappedValue(const Key& kval) {return (find(kval) != this->end());}35 bool hasMappedValue(const Key& kval) const {return (find(kval) != this->end());} 36 36 37 37 const vector<Mapped*>& getVector(void) const { return (this->_elemList); } -
XMLIO_V2/dev/dev_rv/src/XMLIO/context.hpp
r110 r113 91 91 92 92 if (name.compare(FieldDefinition::GetDefName()) == 0) // Parsing définition des champs. 93 { fieldDef = CreateInstanceAndParse<FieldDefinition>(attributes, _node, "field_definition"); continue; }93 { fieldDef = CreateInstanceAndParse<FieldDefinition>(attributes, _node, FieldDefinition::GetDefName().c_str()); continue; } 94 94 95 95 if (name.compare(FileDefinition::GetDefName()) == 0) // Parsing définition des fichiers. 96 { fileDef = CreateInstanceAndParse<FileDefinition>(attributes, _node, "file_definition"); continue; }96 { fileDef = CreateInstanceAndParse<FileDefinition >(attributes, _node, FileDefinition ::GetDefName().c_str()); continue; } 97 97 98 98 if (name.compare(AxisDefinition::GetDefName()) == 0) // Parsing pour la définition des axes. 99 { axisDef = CreateInstanceAndParse<AxisDefinition>(attributes, _node, "axis_definition"); continue; }99 { axisDef = CreateInstanceAndParse<AxisDefinition >(attributes, _node, AxisDefinition ::GetDefName().c_str()); continue; } 100 100 101 101 if (name.compare(GridDefinition::GetDefName()) == 0) // Parsing pour la définition des grilles. 102 { gridDef = CreateInstanceAndParse<GridDefinition>(attributes, _node, "grid_definition"); continue; }102 { gridDef = CreateInstanceAndParse<GridDefinition >(attributes, _node, GridDefinition ::GetDefName().c_str()); continue; } 103 103 104 104 WARNING("La définition est invalide, seules les champs, grilles, axes et fichiers peuvent être définis !"); … … 117 117 virtual bool hasChild(void) const 118 118 { return ((fieldDef != NULL) or (fileDef != NULL) or (axisDef != NULL) or (gridDef != NULL)); } 119 119 120 virtual void printChild(ostream& out) const 120 121 { -
XMLIO_V2/dev/dev_rv/src/XMLIO/field.hpp
r112 r113 27 27 } 28 28 29 ~CField(void)29 virtual ~CField(void) 30 30 { /* Ne rien faire de plus */ } 31 31 -
XMLIO_V2/dev/dev_rv/src/XMLIO/file.hpp
r112 r113 55 55 FieldGroup* getVirtualFieldGroup(void) { return (vfieldGroup); } 56 56 57 ~CFile(void)57 virtual ~CFile(void) 58 58 { if(vfieldGroup != NULL) delete vfieldGroup; } 59 59 -
XMLIO_V2/dev/dev_rv/src/XMLIO/grid.hpp
r112 r113 16 16 {/* Ne rien faire de plus */} 17 17 18 static string GetName(void) { return ("grid"); }18 static string GetName(void) { return ("grid"); } 19 19 20 ~CGrid(void)20 virtual ~CGrid(void) 21 21 { /* Ne rien faire de plus */ } 22 22 -
XMLIO_V2/dev/dev_rv/src/XMLIO/group_template.hpp
r112 r113 65 65 bool hasGroup(const string _id) { return (groupList.hasMappedValue(_id)); } 66 66 67 const StrHashMap<GroupTemplate<T, U>* >& getGroupList(void) { return (groupList); }67 const StrHashMap<GroupTemplate<T, U>* >& getGroupList(void) const { return (groupList); } 68 68 69 69 size_t getNbGroup() const {return (groupList.getVectorSize()); } … … 88 88 bool hasChild(const string _id) { return (childList.hasMappedValue(_id)); } 89 89 90 const StrHashMap<T*>& getCurrentListChild(void) { return (childList); }91 const vector<T*>& getCurrentVectorChild(void) { return (childList.getVector()); }90 const StrHashMap<T*>& getCurrentListChild(void) const { return (childList); } 91 const vector<T*>& getCurrentVectorChild(void) const { return (childList.getVector()); } 92 92 93 93 size_t getNbChild() const {return (childList.getVectorSize()); } -
XMLIO_V2/dev/dev_rv/src/XMLIO/xml_node.hpp
r112 r113 145 145 void setCNode(Node* other) { this->cNode = other; } 146 146 147 static bool IsPtrNull(Node* ptr) { return (ptr==NULL);}147 static bool IsPtrNull(Node* ptr) { return (ptr==NULL); } 148 148 149 149 private : 150 150 151 string& _toLower(string& _str) const151 const string& _toLower(string& _str) const 152 152 { 153 153 for (unsigned int i = 0; i < _str.size(); i++)
Note: See TracChangeset
for help on using the changeset viewer.