Changeset 113


Ignore:
Timestamp:
06/22/10 10:30:33 (14 years ago)
Author:
hozdoba
Message:

Quelques changements de portée essentiellement. Modificiations mineures.

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  
    3737      public : 
    3838 
    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         } 
    4144 
    42          virtual bool _hasValue() const { return hasValue; } 
     45         virtual bool _hasValue() const { return (hasValue); } 
     46 
     47      protected : 
    4348 
    4449         Attribut(void) : hasValue(false) {} ; 
     
    6469         } 
    6570 
    66          operator Ctype() const 
    67          { 
    68             if (!hasValue) throw XMLIOUndefinedValueException("L'attribut \"" + this->getName() + "\" est invalide !"); 
    69             return value ; 
    70          } 
    71  
    7271         virtual void assignValue(const BaseAttribut* _ba) 
    7372         { value = ((Attribut*)_ba) -> value; hasValue = true; } 
     
    8584         } 
    8685 
     86      private : 
     87 
     88         bool hasValue ; 
     89         Ctype value ; 
     90 
    8791   }; // class Attribut 
    8892}; // namespace XMLIOSERVER 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/attribut_registrar.hpp

    r108 r113  
    1010   class AttributRegistrar 
    1111   { 
    12       public : 
     12      protected : 
    1313 
    1414         AttributRegistrar():attrList() 
     
    1818         const StrHashMap<BaseAttribut>& getAttributList(void) const { return (attrList); } 
    1919         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)); } 
    2121 
    2222         BaseAttribut* getAttribut(const string& _id) throw (XMLIOUndefinedValueException) { return (attrList[_id]); } 
     
    5656         } 
    5757 
    58       public : 
    59  
    6058        ~AttributRegistrar(void) 
    6159        {/* Ne rien faire de plus */} 
    6260 
    63       protected : 
     61      private : 
     62 
    6463         StrHashMap<BaseAttribut> attrList; 
    6564 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/axis.hpp

    r112 r113  
    1818         static string GetName(void) {return ("axis"); } 
    1919 
    20          ~CAxis(void) 
     20         virtual ~CAxis(void) 
    2121         { /* Ne rien faire de plus */ } 
    2222 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/base_attribut.hpp

    r108 r113  
    1717         virtual ostream & print(ostream& o) const = 0  ; 
    1818 
    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()); } ; 
    2124 
    2225         virtual void assignValue(const BaseAttribut*) = 0; 
    23  
    24          virtual string getId(void) const {return getName();} ; 
    25          bool hasId(void){return (true);} 
    26  
    2726         virtual void setFromString(const std::string str) = 0; 
     27         virtual bool _hasValue() const = 0; 
    2828 
    2929#define  SETTER_AND_GETTER(TYPE) \ 
     
    4545#undef SETTER_AND_GETTER 
    4646 
    47  
    48          virtual bool _hasValue() const = 0; 
    49  
    5047         static void error_set(void) 
    5148         { throw XMLIOIncompatibleTypeException("BaseAttribut::set<type> > Setting value type is incompatible with attribut type"); } 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/container.hpp

    r112 r113  
    3333         } 
    3434 
    35          bool hasMappedValue(const Key& kval) {return (find(kval) != this->end());} 
     35         bool hasMappedValue(const Key& kval) const {return (find(kval) != this->end());} 
    3636 
    3737         const vector<Mapped*>& getVector(void) const { return (this->_elemList); } 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/context.hpp

    r110 r113  
    9191 
    9292                  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; } 
    9494 
    9595                  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; } 
    9797 
    9898                  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; } 
    100100 
    101101                  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; } 
    103103 
    104104                  WARNING("La définition est invalide, seules les champs, grilles, axes et fichiers peuvent être définis !"); 
     
    117117         virtual bool hasChild(void) const 
    118118         { return ((fieldDef != NULL) or (fileDef != NULL)  or (axisDef != NULL) or (gridDef != NULL)); } 
     119 
    119120         virtual void printChild(ostream& out) const 
    120121         { 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/field.hpp

    r112 r113  
    2727         } 
    2828 
    29          ~CField(void) 
     29         virtual ~CField(void) 
    3030         { /* Ne rien faire de plus */ } 
    3131 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/file.hpp

    r112 r113  
    5555         FieldGroup* getVirtualFieldGroup(void) { return (vfieldGroup); } 
    5656 
    57          ~CFile(void) 
     57         virtual  ~CFile(void) 
    5858         { if(vfieldGroup != NULL) delete vfieldGroup; } 
    5959 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/grid.hpp

    r112 r113  
    1616         {/* Ne rien faire de plus */} 
    1717 
    18          static string GetName(void) {return ("grid"); } 
     18         static string GetName(void) { return ("grid"); } 
    1919 
    20          ~CGrid(void) 
     20         virtual ~CGrid(void) 
    2121         { /* Ne rien faire de plus */ } 
    2222 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/group_template.hpp

    r112 r113  
    6565         bool hasGroup(const string _id) { return (groupList.hasMappedValue(_id)); } 
    6666 
    67          const StrHashMap<GroupTemplate<T, U>* >& getGroupList(void) { return (groupList); } 
     67         const StrHashMap<GroupTemplate<T, U>* >& getGroupList(void) const { return (groupList); } 
    6868 
    6969         size_t getNbGroup() const {return (groupList.getVectorSize()); } 
     
    8888         bool hasChild(const string _id) { return (childList.hasMappedValue(_id)); } 
    8989 
    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()); } 
    9292 
    9393         size_t getNbChild() const {return (childList.getVectorSize()); } 
  • XMLIO_V2/dev/dev_rv/src/XMLIO/xml_node.hpp

    r112 r113  
    145145            void setCNode(Node* other) { this->cNode = other; } 
    146146 
    147             static bool IsPtrNull(Node* ptr) {return (ptr==NULL);} 
     147            static bool IsPtrNull(Node* ptr) { return (ptr==NULL); } 
    148148 
    149149         private : 
    150150 
    151             string& _toLower(string& _str) const 
     151            const string& _toLower(string& _str) const 
    152152            { 
    153153               for (unsigned int i = 0; i < _str.size(); i++) 
Note: See TracChangeset for help on using the changeset viewer.