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