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 1093 by tim, Wed Mar 17 14:22:59 2004 UTC vs.
Revision 1234 by tim, Fri Jun 4 03:15:31 2004 UTC

# Line 19 | Line 19 | using namespace std;
19   #define ETAVALUE_ID "ETAVALUE"
20  
21   using namespace std;
22 <
22 > ////////////////////////////////////////////////////////////////////////////////
23 > //Declaration of GenericData
24 > ////////////////////////////////////////////////////////////////////////////////
25   class GenericData
26   {
27    public:
# Line 29 | Line 31 | class GenericData
31      virtual ~GenericData() {}
32  
33      const string& getID() const {  return id; }
34 <    void setID(string rhs)     {  id = rhs;  }
34 >    void setID(const string& rhs)     {  id = rhs;  }
35  
36    protected:
37      string id;
38   };
39  
40 < /** Something we can improve it here is to use template
41 < **
40 > /**
41 > * Something we can improve it here is to use template
42   */
43 <
43 > ////////////////////////////////////////////////////////////////////////////////
44 > //Declaration of IntData
45 > ////////////////////////////////////////////////////////////////////////////////
46   class IntData : public GenericData{
47  
48    public:
# Line 50 | Line 54 | class IntData : public GenericData{
54      int data;
55   };
56  
57 + ////////////////////////////////////////////////////////////////////////////////
58 + //Declaration of DoubleData
59 + ////////////////////////////////////////////////////////////////////////////////
60   class DoubleData : public GenericData{
61  
62    public:
# Line 61 | Line 68 | class DoubleData : public GenericData{
68      double data;
69   };
70  
71 + ////////////////////////////////////////////////////////////////////////////////
72 + //Declaration of StringData
73 + ////////////////////////////////////////////////////////////////////////////////
74   class StringData : public GenericData{
75  
76    public:
# Line 70 | Line 80 | class StringData : public GenericData{
80      string data;
81   };
82  
83 + ////////////////////////////////////////////////////////////////////////////////
84 + //Declaration of BoolData
85 + ////////////////////////////////////////////////////////////////////////////////
86 + class BoolData : public GenericData{
87 +  public:
88 +    bool getData() const  {  return data; }
89 +    void setData(const bool rhs) {  data = rhs;  }
90 +  protected:
91 +    bool data;
92 +
93 + };
94 +
95 + ////////////////////////////////////////////////////////////////////////////////
96 + //Declaration of ZConsParaData
97 + ////////////////////////////////////////////////////////////////////////////////
98   struct ZConsParaItem {
99    int zconsIndex;
100    bool havingZPos;
# Line 101 | Line 126 | class ZConsParaSortCriterion{
126  
127   };
128  
129 + ////////////////////////////////////////////////////////////////////////////////
130 + //Declaration of IntData
131 + ////////////////////////////////////////////////////////////////////////////////
132   class DoubleArrayData : public GenericData{
133  
134   public:
# Line 113 | Line 141 | class DoubleArrayData : public GenericData{
141   protected:
142     vector<double> data;
143   };
144 +
145 + ////////////////////////////////////////////////////////////////////////////////
146 + //Declaration of AtomData
147 + ////////////////////////////////////////////////////////////////////////////////
148 + struct AtomInfo : public GenericData{
149 +  public:
150 +    string AtomType;
151 +    double pos[3];
152 +    double dipole[3];  
153 + };
154 +
155 + class AtomData : public GenericData{
156 +  public:
157 +    ~AtomData();
158 +    void addAtomInfo(AtomInfo* info) {data.push_back(info);}
159 +    void clearAllAtomInfo();
160 +    AtomInfo* beginAtomInfo(vector<AtomInfo*>::iterator& i){
161 +      i = data.begin();
162 +      return i != data.end()? *i : NULL;
163 +    }
164 +    AtomInfo* nextAtomInfo(vector<AtomInfo*>::iterator& i){
165 +      ++i;
166 +      return i != data.end()? *i: NULL;
167 +    }
168 +    vector<AtomInfo*> getData() {return data;}
169 +    int getSize() {return data.size();}
170 +  protected:
171 +    vector<AtomInfo*> data;
172 + };
173 +
174   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines