ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new-templateless/OOPSE/libmdtools/GenericData.hpp
(Generate patch)

Comparing:
trunk/OOPSE/libmdtools/GenericData.hpp (file contents), Revision 658 by tim, Thu Jul 31 15:35:07 2003 UTC vs.
branches/new-templateless/OOPSE/libmdtools/GenericData.hpp (file contents), Revision 851 by mmeineke, Wed Nov 5 19:18:17 2003 UTC

# Line 1 | Line 1
1   #ifndef __GENERICDATA_H__
2   #define __GENERICDATA_H__
3  
4 < #include <string>
5 < #include <vector>
4 > #define ZCONSTIME_ID            "ZCONSTIME"
5 > #define ZCONSPARADATA_ID    "ZCONSPARA"
6 > #define ZCONSFILENAME_ID     "ZCONSFILENAME"
7 > #define ZCONSTOL_ID              "ZCONSTOL"
8 > #define ZCONSFORCEPOLICY_ID "ZCONSFORCEPOLICY"
9  
10 < using namespace std;
10 > #define CHIVALUE_ID "CHIVALUE"
11 > #define INTEGRALOFCHIDT_ID "INTEGRALOFCHIDT"
12 > #define ETAVALUE_ID "ETAVALUE"
13  
14 + #define GD_STRING_LENGTH 500
15 +
16   class GenericData
17   {
18 <  public:
19 <    GenericData();
20 <    GenericData(const GenericData& rhs)  {  id = rhs.getID(); }
21 <    GenericData& operator =(const GenericData& rhs);
22 <    virtual ~GenericData() {}
23 <    
24 <    const string& getID() const {  return id; }
25 <    void setID(string rhs)     {  id = rhs;  }
26 <    
27 <  protected:
28 <    string id;
22 < };
18 > public:
19 >  GenericData();
20 >  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  
30 < /** Something we can improve it here is to use template
31 < **
32 < */
33 < class IndexData : public GenericData
34 < {
35 <  public:
36 <    IndexData();
37 <    IndexData(const IndexData& rhs);
38 <    IndexData& operator = (const IndexData& rhs);
30 >  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 >
35 >  GenericData* getNext( void ) { return next; }
36 >  void setNext( GenericData* theNext ) { next = theNext; }
37 >
38 >  GenericData* getSameNext( void ) { return sameNext; }
39 >  void setSameNext( GenericData* theNext ) { sameNext = theNext; }
40 >
41 >  GenericData* find( char* theID );
42 >  
43 >  void setValue(double theDval);
44 >  void setValue(char* theCval);
45 >  void setValue(double* theDarray, int theArrayLength);
46 >
47 >  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 <    const vector<int>& getIndexData() const   {  return indexData; }
55 <    void setIndexData(const vector<int>& rhs) {  indexData = rhs;  }
56 <  protected:
57 <    vector<int> indexData;  
54 > protected:
55 >
56 >  char id[GD_STRING_LENGTH];
57 >  GenericData* next;
58 >  GenericData* sameNext;
59 >
60 >  double dVal;
61 >  double *dArray;
62 >  int arrayLength;
63 >  char cVal[GD_STRING_LENGTH];
64   };
65  
66 < class DoubleData : public GenericData{
66 > // struct ZConsParaItem {
67 > //   int zconsIndex;
68 > //   bool havingZPos;
69 > //   double zPos;
70 > //   double kRatio;
71 > // };
72  
73 <  public:
73 > // class ZConsParaData : public GenericData{
74  
75 <    double getData()         { return data; }
76 <    void setData(double rhs) { data = rhs;  }
77 <            
78 <  protected:
79 <    double data;
80 < };
75 > //   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  
83 < class StringData : public GenericData{
84 <
85 <  public:  
86 <    const string& getData() const  {  return data; }
87 <    void setData(const string& rhs) {  data = rhs;  }
88 <  protected:
89 <    string data;
90 < };
83 > //   private:
84 > //     vector<ZConsParaItem> data;
85 > //   };
86 >
87 > // class ZConsParaSortCriterion{
88 > //   public:
89 > //     bool operator ()(const ZConsParaItem& item1, const ZConsParaItem& item2){
90 > //       return item1.zconsIndex < item2.zconsIndex;
91 > //     }
92 >
93 > // };
94 >
95 >
96   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines