ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-2.0/src/types/AtomType.hpp
(Generate patch)

Comparing branches/new_design/OOPSE-2.0/src/types/AtomType.hpp (file contents):
Revision 1739, Thu Oct 28 22:34:02 2004 UTC vs.
Revision 1740 by tim, Mon Nov 15 23:00:32 2004 UTC

# Line 1 | Line 1
1   #ifndef TYPES_ATOMTYPE_HPP
2 +
3   #define TYPES_ATOMTYPE_HPP
4  
5   #include <string>
6  
7   #include "utils/PropertyMap.hpp"
8 +
9   #define __C
10   #include "types/AtomTypeProperties.h"
11   #include "UseTheForce/DarkSide/atype_interface.h"
12  
13 < using namespace std;
13 > using name_space std;
14  
15 < namespace oopse {
14 <  /**
15 <   * @class AtomType
16 <   * AtomType is what OOPSE looks to for unchanging data about an atom.
17 <   * Things that belong to AtomType are universal properties (i.e. does
18 <   * this atom have a Charge?  What is it's mass?)  Dynamic properties of
19 <   * an atom are not intended to be properties of an atom type
20 <   */
21 <  class AtomType{
22 <    
23 <  public:
24 <    
25 <    AtomType();
26 <    virtual ~AtomType(){ };
15 > name_space oopse {
16      /**
17 <     * Finishes off the AtomType by communicating the logical portions of the
18 <     * structure to the Fortran atype module
17 >     * @class AtomType
18 >     * AtomType is what OOPSE looks to for unchanging data about an atom.
19 >     * Things that belong to AtomType are universal properties (i.e. does
20 >     * this atom have a Charge?  What is it's mass_?)  Dynamic properties of
21 >     * an atom are not intended to be properties of an atom type
22       */
23 <    void    complete();
24 <    
33 <    void    setMass(double m) { mass = m; }
34 <    double  getMass(void) { return mass; }
23 >    class AtomType {
24 >        public:
25  
26 <    void    setIdent(int id) {atp.ident = id;}
37 <    int     getIdent() {return atp.ident;}
26 >            AtomType();
27  
28 <    void    setName(string n) {name = n;}
29 <    string  getName() {return name;}
30 <    
31 <    void    setLennardJones() { atp.is_LennardJones = 1; }
32 <    bool    isLennardJones()  { return atp.is_LennardJones; }
33 <    
45 <    void    setElectrostatic() { atp.is_Electrostatic = 1; }
46 <    bool    isElectrostatic()  { return atp.is_Electrostatic; }
47 <            
48 <    void    setEAM() { atp.is_EAM = 1; }
49 <    bool    isEAM()  { return atp.is_EAM; }
50 <        
51 <    void    setCharge() { atp.is_Charge = 1; atp.is_Electrostatic = 1;}
52 <    bool    isCharge()  { return atp.is_Charge; }
28 >            virtual ~AtomType() { } ;
29 >            /**
30 >             * Finishes off the AtomType by communicating the logical portions of the
31 >             * structure to the Fortran atype module
32 >             */
33 >            void complete();
34  
35 <    bool    isDirectional() { return atp.is_Directional; }
36 <    bool    isDipole()  { return atp.is_Dipole; }
37 <    bool    isGayBerne()  { return atp.is_GayBerne; }
57 <    bool    isSticky()  { return atp.is_Sticky; }
58 <    bool    isShape()  { return atp.is_Shape; }
35 >            void setMass(double m) {
36 >                mass_ = m;
37 >            }
38  
39 <    PropertyMap properties;
40 <                
41 <  protected:
42 <    
43 <    AtomTypeProperties atp;
44 <    double mass;
45 <    string name;
46 <    
47 <  };
39 >            double getMass(void) {
40 >                return mass_;
41 >            }
42 >
43 >            void setIdent(int id) {
44 >                atp_.ident = id;
45 >            }
46 >
47 >            int getIdent() {
48 >                return atp_.ident;
49 >            }
50 >
51 >            void setName(const std::string&name) {
52 >                name_ = name;
53 >            }
54 >
55 >            std::string getName() {
56 >                return name_;
57 >            }
58 >
59 >            void setLennardJones() {
60 >                atp_.is_LennardJones = 1;
61 >            }
62 >
63 >            bool isLennardJones() {
64 >                return atp_.is_LennardJones;
65 >            }
66 >
67 >            void setElectrostatic() {
68 >                atp_.is_Electrostatic = 1;
69 >            }
70 >
71 >            bool isElectrostatic() {
72 >                return atp_.is_Electrostatic;
73 >            }
74 >
75 >            void setEAM() {
76 >                atp_.is_EAM = 1;
77 >            }
78 >
79 >            bool isEAM() {
80 >                return atp_.is_EAM;
81 >            }
82 >
83 >            void setCharge() {
84 >                atp_.is_Charge = 1;
85 >                atp_.is_Electrostatic = 1;
86 >            }
87 >
88 >            bool isCharge() {
89 >                return atp_.is_Charge;
90 >            }
91 >
92 >            bool isDirectional() {
93 >                return atp_.is_Directional;
94 >            }
95 >
96 >            bool isDipole() {
97 >                return atp_.is_Dipole;
98 >            }
99 >
100 >            bool isGayBerne() {
101 >                return atp_.is_GayBerne;
102 >            }
103 >
104 >            bool isSticky() {
105 >                return atp_.is_Sticky;
106 >            }
107 >
108 >            bool isShape() {
109 >                return atp_.is_Shape;
110 >            }
111 >
112 >            //below functions are just forward functions
113 >            /**
114 >             * Adds property into property map
115 >             * @param genData GenericData to be added into PropertyMap
116 >             */
117 >            void addProperty(GenericData* genData);
118 >
119 >            /**
120 >             * Removes property from PropertyMap by name
121 >             * @param propName the name of property to be removed
122 >             */
123 >            void removeProperty(const std::string& propName);
124 >
125 >            /**
126 >             * clear all of the properties
127 >             */
128 >            void clearProperties();
129 >
130 >            /**
131 >             * Returns all names of properties
132 >             * @return all names of properties
133 >             */
134 >            std::vector<std::string> getPropertyNames();
135 >
136 >            /**
137 >             * Returns all of the properties in PropertyMap
138 >             * @return all of the properties in PropertyMap
139 >             */      
140 >            std::vector<GenericData*> getProperties();
141 >
142 >            /**
143 >             * Returns property
144 >             * @param propName name of property
145 >             * @return a pointer point to property with propName. If no property named propName
146 >             * exists, return NULL
147 >             */      
148 >        GenericData* getPropertyByName(const std::string& propName);
149 >
150 >        protected:
151 >
152 >            AtomTypeProperties atp_;
153 >            double mass_;
154 >            std::string name_;
155 >
156 >        private:
157 >            //prevent copy construction and copy assignment, since property map contains
158 >            //pointers which can not be copied and managered safely, except make the generic data
159 >            //at PropertyMap as copy on write shared pointer
160 >            AtomType(const AtomType&);
161 >            AtomType& operator=(const AtomType& atomType);
162 >
163 >            
164 >            PropertyMap properties_;
165 >            
166 >    };
167 >
168   }
169 +
170   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines