Ignore:
Timestamp:
10/01/10 11:32:41 (14 years ago)
Author:
hozdoba
Message:

Commit pour sauvegarde - diverses corrections de bogues et améliorations du code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/dev_rv/src/XMLIO/field.hpp

    r123 r124  
    88{ 
    99   class CGrid; // CGRID = CDOMAINE + CAXIS 
     10   class CFile; 
    1011 
    1112   class CField : public ObjectTemplate<CField>, public FieldAttribut 
     
    1314      public: 
    1415 
    15          CField(void) : ObjectTemplate<CField>(), FieldAttribut(), grid(NULL) 
     16         CField(void) : ObjectTemplate<CField>(), FieldAttribut(), lastStored(NULL), grid(NULL), file(NULL) 
    1617         {/* Ne rien faire de plus */} 
    17          CField(const string& _id) : ObjectTemplate<CField>(_id), FieldAttribut(), grid(NULL), foper(NULL) 
     18         CField(const string& _id) : ObjectTemplate<CField>(_id), FieldAttribut(), lastStored(NULL), grid(NULL), file(NULL) 
    1819         {/* Ne rien faire de plus */} 
    1920 
    2021         static string GetName(void) { return ("field"); } 
    2122 
    22          inline void SolveGridRef(void) ; 
     23         inline void solveGridRef(void) ; 
    2324 
    2425         const CGrid* getGrid(void) const { return (grid); } 
    2526         const Array<double, 1>& getData(void) const { return (data); } 
    26          const FieldOperation* getFieldOperation(void) const { return (foper); } 
     27 
     28         void initLastStoredDate(const Date& _newlastStored) 
     29         { if(lastStored == NULL) lastStored = new Date(_newlastStored); }; 
     30 
     31         bool isStorable(const Date& currDate) 
     32         { 
     33            if (lastStored == NULL) return (false); 
     34            if (freq_op.hasValue()) 
     35               return (currDate >= (*lastStored + (Duration)freq_op)); 
     36            return (true); 
     37         } 
     38 
     39         void storeData(const Array<double, 1> & arr, const Date& currDate) 
     40         { 
     41            *lastStored = currDate; 
     42            data.resize(shape(arr.size())) ; 
     43            data = arr; 
     44         } 
     45 
     46         const CFile* getRelFile(void) const { return (file); } 
     47         void setRelFile(CFile* _file) { file = _file; } 
    2748 
    2849         virtual CField* getReference(void) const 
     
    3657 
    3758         virtual ~CField(void) 
    38          { /* Ne rien faire de plus */ } 
     59         { if(lastStored !=  NULL) delete lastStored; } 
    3960 
    4061      private : 
    4162 
     63         Date* lastStored; 
     64 
    4265         CGrid* grid ; 
    43          FieldOperation* foper; 
    44          Array<double, 1> data; 
     66         CFile* file; 
     67 
     68         Array<double, 1>  data; 
    4569 
    4670   }; // class CField 
Note: See TracChangeset for help on using the changeset viewer.