Changeset 124 for XMLIO_V2/dev/dev_rv/src/XMLIO/field.hpp
- Timestamp:
- 10/01/10 11:32:41 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/XMLIO/field.hpp
r123 r124 8 8 { 9 9 class CGrid; // CGRID = CDOMAINE + CAXIS 10 class CFile; 10 11 11 12 class CField : public ObjectTemplate<CField>, public FieldAttribut … … 13 14 public: 14 15 15 CField(void) : ObjectTemplate<CField>(), FieldAttribut(), grid(NULL)16 CField(void) : ObjectTemplate<CField>(), FieldAttribut(), lastStored(NULL), grid(NULL), file(NULL) 16 17 {/* 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) 18 19 {/* Ne rien faire de plus */} 19 20 20 21 static string GetName(void) { return ("field"); } 21 22 22 inline void SolveGridRef(void) ;23 inline void solveGridRef(void) ; 23 24 24 25 const CGrid* getGrid(void) const { return (grid); } 25 26 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; } 27 48 28 49 virtual CField* getReference(void) const … … 36 57 37 58 virtual ~CField(void) 38 { /* Ne rien faire de plus */}59 { if(lastStored != NULL) delete lastStored; } 39 60 40 61 private : 41 62 63 Date* lastStored; 64 42 65 CGrid* grid ; 43 FieldOperation* foper; 44 Array<double, 1> data; 66 CFile* file; 67 68 Array<double, 1> data; 45 69 46 70 }; // class CField
Note: See TracChangeset
for help on using the changeset viewer.