ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/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.
Revision 736 by tim, Thu Aug 28 21:09:47 2003 UTC

# Line 1 | Line 1
1   #ifndef __GENERICDATA_H__
2   #define __GENERICDATA_H__
3  
4 + #include <algorithm>
5   #include <string>
6   #include <vector>
7  
8 + #define ZCONSTIME_ID            "ZCONSTIME"
9 + #define ZCONSPARADATA_ID    "ZCONSPARA"
10 + #define ZCONSFILENAME_ID     "ZCONSFILENAME"
11 + #define ZCONSTOL_ID              "ZCONSTOL"
12 + #define ZCONSFORCEPOLICY_ID "ZCONSFORCEPOLICY"
13 +
14   using namespace std;
15  
16   class GenericData
# Line 24 | Line 31 | class IndexData : public GenericData
31   /** Something we can improve it here is to use template
32   **
33   */
27 class IndexData : public GenericData
28 {
29  public:
30    IndexData();
31    IndexData(const IndexData& rhs);
32    IndexData& operator = (const IndexData& rhs);
33    
34    const vector<int>& getIndexData() const   {  return indexData; }
35    void setIndexData(const vector<int>& rhs) {  indexData = rhs;  }
36  protected:
37    vector<int> indexData;  
38 };
39
34   class DoubleData : public GenericData{
35  
36    public:
# Line 56 | Line 50 | class StringData : public GenericData{
50    protected:
51      string data;
52   };
53 +
54 + struct ZConsParaItem
55 + {
56 +  int zconsIndex;
57 +  bool havingZPos;
58 +  double zPos;
59 +  double kRatio;
60 + };
61 +
62 + class ZConsParaData : public GenericData{
63 +        
64 +  public:      
65 +    ZConsParaData();
66 +    void addItem(ZConsParaItem& item) {data.push_back(item);}
67 +    vector<ZConsParaItem>* getData() {return &data;}
68 +    void setData(vector<ZConsParaItem>& theData) {data = theData;}
69 +    void sortByIndex();
70 +    bool isIndexUnique();
71 +        
72 +  private:      
73 +    vector<ZConsParaItem> data;
74 +  };
75 +
76 + class ZConsParaSortCriterion{
77 +  public:
78 +    bool operator ()(const ZConsParaItem& item1, const ZConsParaItem& item2){
79 +      return item1.zconsIndex < item2.zconsIndex;
80 +    }
81 +
82 + };
83 +
84   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines