| 1 |
tim |
658 |
#ifndef __GENERICDATA_H__ |
| 2 |
|
|
#define __GENERICDATA_H__ |
| 3 |
|
|
|
| 4 |
tim |
682 |
#define ZCONSTIME_ID "ZCONSTIME" |
| 5 |
|
|
#define ZCONSPARADATA_ID "ZCONSPARA" |
| 6 |
|
|
#define ZCONSFILENAME_ID "ZCONSFILENAME" |
| 7 |
|
|
#define ZCONSTOL_ID "ZCONSTOL" |
| 8 |
tim |
699 |
#define ZCONSFORCEPOLICY_ID "ZCONSFORCEPOLICY" |
| 9 |
tim |
682 |
|
| 10 |
tim |
837 |
#define CHIVALUE_ID "CHIVALUE" |
| 11 |
|
|
#define INTEGRALOFCHIDT_ID "INTEGRALOFCHIDT" |
| 12 |
|
|
#define ETAVALUE_ID "ETAVALUE" |
| 13 |
|
|
|
| 14 |
mmeineke |
850 |
#define GD_STRING_LENGTH 500 |
| 15 |
tim |
658 |
|
| 16 |
|
|
class GenericData |
| 17 |
|
|
{ |
| 18 |
mmeineke |
850 |
public: |
| 19 |
mmeineke |
851 |
GenericData(); |
| 20 |
mmeineke |
850 |
GenericData(char* theID); |
| 21 |
|
|
GenericData(char* theID, double theDval); |
| 22 |
|
|
GenericData(char* theID, char* theCval); |
| 23 |
|
|
GenericData(char* theID, double* theDarray, int theArrayLength); |
| 24 |
|
|
virtual ~GenericData() { |
| 25 |
|
|
if( next !=NULL ) delete next; |
| 26 |
|
|
if( sameNext !=NULL ) delete sameNext; |
| 27 |
|
|
if( dArray !=NULL ) delete dArray; |
| 28 |
|
|
} |
| 29 |
tim |
837 |
|
| 30 |
mmeineke |
850 |
GenericData* add(char* theID); |
| 31 |
|
|
GenericData* add(char* theID, double theDval); |
| 32 |
|
|
GenericData* add(char* theID, char* theCval); |
| 33 |
|
|
GenericData* add(char* theID, double* theDarray, int theArrayLength); |
| 34 |
tim |
837 |
|
| 35 |
mmeineke |
850 |
GenericData* getNext( void ) { return next; } |
| 36 |
|
|
void setNext( GenericData* theNext ) { next = theNext; } |
| 37 |
tim |
658 |
|
| 38 |
mmeineke |
850 |
GenericData* getSameNext( void ) { return sameNext; } |
| 39 |
|
|
void setSameNext( GenericData* theNext ) { sameNext = theNext; } |
| 40 |
tim |
658 |
|
| 41 |
mmeineke |
850 |
GenericData* find( char* theID ); |
| 42 |
|
|
|
| 43 |
|
|
void setValue(double theDval); |
| 44 |
|
|
void setValue(char* theCval); |
| 45 |
|
|
void setValue(double* theDarray, int theArrayLength); |
| 46 |
tim |
658 |
|
| 47 |
mmeineke |
850 |
char* getID() { return id; } |
| 48 |
|
|
void setID(char* theID); |
| 49 |
|
|
|
| 50 |
|
|
double getDval( void ) {return dVal;} |
| 51 |
|
|
char* getCval( void ) { return cVal; } |
| 52 |
|
|
int getDarray( double* &outArray ); |
| 53 |
|
|
|
| 54 |
|
|
protected: |
| 55 |
tim |
837 |
|
| 56 |
mmeineke |
850 |
char id[GD_STRING_LENGTH]; |
| 57 |
|
|
GenericData* next; |
| 58 |
|
|
GenericData* sameNext; |
| 59 |
tim |
658 |
|
| 60 |
mmeineke |
850 |
double dVal; |
| 61 |
|
|
double *dArray; |
| 62 |
mmeineke |
851 |
int arrayLength; |
| 63 |
mmeineke |
850 |
char cVal[GD_STRING_LENGTH]; |
| 64 |
tim |
658 |
}; |
| 65 |
tim |
682 |
|
| 66 |
mmeineke |
850 |
// struct ZConsParaItem { |
| 67 |
|
|
// int zconsIndex; |
| 68 |
|
|
// bool havingZPos; |
| 69 |
|
|
// double zPos; |
| 70 |
|
|
// double kRatio; |
| 71 |
|
|
// }; |
| 72 |
tim |
682 |
|
| 73 |
mmeineke |
850 |
// class ZConsParaData : public GenericData{ |
| 74 |
tim |
837 |
|
| 75 |
mmeineke |
850 |
// public: |
| 76 |
|
|
// ZConsParaData(); |
| 77 |
|
|
// void addItem(ZConsParaItem& item) {data.push_back(item);} |
| 78 |
|
|
// vector<ZConsParaItem>* getData() {return &data;} |
| 79 |
|
|
// void setData(vector<ZConsParaItem>& theData) {data = theData;} |
| 80 |
|
|
// void sortByIndex(); |
| 81 |
|
|
// bool isIndexUnique(); |
| 82 |
tim |
837 |
|
| 83 |
mmeineke |
850 |
// private: |
| 84 |
|
|
// vector<ZConsParaItem> data; |
| 85 |
|
|
// }; |
| 86 |
tim |
682 |
|
| 87 |
mmeineke |
850 |
// class ZConsParaSortCriterion{ |
| 88 |
|
|
// public: |
| 89 |
|
|
// bool operator ()(const ZConsParaItem& item1, const ZConsParaItem& item2){ |
| 90 |
|
|
// return item1.zconsIndex < item2.zconsIndex; |
| 91 |
|
|
// } |
| 92 |
tim |
682 |
|
| 93 |
mmeineke |
850 |
// }; |
| 94 |
tim |
682 |
|
| 95 |
tim |
837 |
|
| 96 |
tim |
658 |
#endif |