1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : SALOMEDSImpl_GenericAttribute.hxx
21 // Author : SERGEY_RUIN
25 #include "SALOMEDSImpl_Attributes.hxx"
26 #include "SALOMEDSImpl_Study.hxx"
27 #include "SALOMEDSImpl_StudyBuilder.hxx"
31 char* SALOMEDSImpl_GenericAttribute::Impl_GetType(DF_Attribute* theAttr)
33 SALOMEDSImpl_GenericAttribute* ga = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(theAttr);
34 return (char*)ga->Type().c_str();
37 char* SALOMEDSImpl_GenericAttribute::Impl_GetClassType(DF_Attribute* theAttr)
39 SALOMEDSImpl_GenericAttribute* ga = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(theAttr);
40 return (char*)ga->GetClassType().c_str();
43 void SALOMEDSImpl_GenericAttribute::Impl_CheckLocked(DF_Attribute* theAttr)
45 SALOMEDSImpl_GenericAttribute* ga = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(theAttr);
49 string SALOMEDSImpl_GenericAttribute::Type()
55 void SALOMEDSImpl_GenericAttribute::CheckLocked()
57 DF_Label aLabel = Label();
58 if(aLabel.IsNull()) return;
60 SALOMEDSImpl_Study* aStudy = SALOMEDSImpl_Study::GetStudy(aLabel);
62 if(aStudy->IsLocked()) {
63 aStudy->_errorCode = "LockProtection";
64 throw LockProtection("LockProtection");
68 SALOMEDSImpl_SObject SALOMEDSImpl_GenericAttribute::GetSObject()
70 SALOMEDSImpl_SObject so;
71 DF_Label aLabel = Label();
72 if(aLabel.IsNull()) return so;
73 return SALOMEDSImpl_Study::SObject(aLabel);
76 void SALOMEDSImpl_GenericAttribute::SetModifyFlag()
78 DF_Label aLabel = Label();
79 if(aLabel.IsNull()) return;
81 SALOMEDSImpl_Study* aStudy = SALOMEDSImpl_Study::GetStudy(aLabel);
82 if(aStudy) aStudy->Modify();