Salome HOME
7de967c2ceb13f8880a7abe4410ae7585d0ceaaa
[modules/kernel.git] / src / SALOMEDSImpl / SALOMEDSImpl_GenericVariable.cxx
1 // Copyright (C) 2008  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 //  File   : SALOMEDSImpl_GenericVariable.cxx
21 //  Author : Roman NIKOLAEV, Open CASCADE S.A.S.
22 //  Module : SALOME
23
24 #include "SALOMEDSImpl_GenericVariable.hxx"
25 #include "SALOMEDSImpl_Attributes.hxx"
26 #include "SALOMEDSImpl_Study.hxx"
27
28 #include <string>
29
30
31 using namespace std;
32
33 //============================================================================
34 /*! Function : SALOMEDSImpl_GenericVariable
35  *  Purpose  : 
36  */
37 //============================================================================
38 SALOMEDSImpl_GenericVariable::
39 SALOMEDSImpl_GenericVariable(SALOMEDSImpl_GenericVariable::VariableTypes theType,
40                              const string& theName): 
41   _type(theType),
42   _name(theName)
43 {}
44
45 //============================================================================
46 /*! Function : ~SALOMEDSImpl_GenericVariable
47  *  Purpose  : 
48  */
49 //============================================================================
50 SALOMEDSImpl_GenericVariable::~SALOMEDSImpl_GenericVariable()
51 {}
52
53 //============================================================================
54 /*! Function : Type
55  *  Purpose  : 
56  */
57 //============================================================================
58 SALOMEDSImpl_GenericVariable::VariableTypes SALOMEDSImpl_GenericVariable::Type() const
59 {
60   return _type;
61 }
62
63 //============================================================================
64 /*! Function : Name
65  *  Purpose  : 
66  */
67 //============================================================================
68 string SALOMEDSImpl_GenericVariable::Name() const
69 {
70   return _name;
71 }
72
73 //============================================================================
74 /*! Function : setType
75  *  Purpose  : 
76  */
77 //============================================================================
78 bool SALOMEDSImpl_GenericVariable::setType(const SALOMEDSImpl_GenericVariable::VariableTypes theType)
79 {
80   if(_type == theType)
81     return false;
82
83   _type = theType;
84   return true;
85 }
86
87 //============================================================================
88 /*! Function : setName
89  *  Purpose  : 
90  */
91 //============================================================================
92 bool SALOMEDSImpl_GenericVariable::setName(const std::string& theName)
93 {
94   if(_name.compare(theName) == 0)
95     return false;
96
97   _name = theName;
98   return true;
99 }
100
101 //============================================================================
102 /*! Function : String2VariableType
103  *  Purpose  : 
104  */
105 //============================================================================
106 SALOMEDSImpl_GenericVariable::VariableTypes SALOMEDSImpl_GenericVariable::String2VariableType(const string& theStrType)
107 {
108   return(SALOMEDSImpl_GenericVariable::VariableTypes)atoi((char*)theStrType.c_str());
109 }
110
111 //============================================================================
112 /*! Function : Save
113  *  Purpose  : 
114  */
115 //============================================================================
116 string SALOMEDSImpl_GenericVariable::Save() const
117 {
118   return string();
119 }
120
121
122 //============================================================================
123 /*! Function : SaveToScript
124  *  Purpose  : 
125  */
126 //============================================================================
127 string SALOMEDSImpl_GenericVariable::SaveToScript() const
128 {
129   return string();
130 }
131 //============================================================================
132 /*! Function : SaveType
133  *  Purpose  : 
134  */
135 //============================================================================
136 string SALOMEDSImpl_GenericVariable::SaveType() const
137 {
138   return string();
139 }
140
141 //============================================================================
142 /*! Function : Load
143  *  Purpose  : 
144  */
145 //============================================================================
146 void SALOMEDSImpl_GenericVariable::Load(const string& theStrValue)
147 {
148 }