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 682 by tim, Tue Aug 12 17:51:33 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 +
13   using namespace std;
14  
15   class GenericData
# Line 24 | Line 30 | class IndexData : public GenericData
30   /** Something we can improve it here is to use template
31   **
32   */
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
33   class DoubleData : public GenericData{
34  
35    public:
# Line 56 | Line 49 | class StringData : public GenericData{
49    protected:
50      string data;
51   };
52 +
53 + struct ZConsParaItem
54 + {
55 +  int zconsIndex;
56 +  bool havingZPos;
57 +  double zPos;
58 +  double kRatio;
59 + };
60 +
61 + class ZConsParaData : public GenericData{
62 +        
63 +  public:      
64 +    ZConsParaData();
65 +    void addItem(ZConsParaItem& item) {data.push_back(item);}
66 +    vector<ZConsParaItem>* getData() {return &data;}
67 +    void setData(vector<ZConsParaItem>& theData) {data = theData;}
68 +    void sortByIndex();
69 +        
70 +  private:      
71 +    vector<ZConsParaItem> data;
72 +  };
73 +
74 + class ZConsParaSortCriterion{
75 +  public:
76 +    bool operator ()(const ZConsParaItem& item1, const ZConsParaItem& item2){
77 +      return item1.zconsIndex < item2.zconsIndex;
78 +    }
79 +
80 + };
81 +
82   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines