1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : SALOMEDSImpl_GenericAttribute.hxx
23 // Author : SERGEY_RUIN
26 #include "SALOMEDSImpl_Attributes.hxx"
27 #include "SALOMEDSImpl_Study.hxx"
28 #include "SALOMEDSImpl_StudyBuilder.hxx"
32 string SALOMEDSImpl_GenericAttribute::Impl_GetType(DF_Attribute* theAttr)
34 SALOMEDSImpl_GenericAttribute* ga = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(theAttr);
41 string SALOMEDSImpl_GenericAttribute::Impl_GetClassType(DF_Attribute* theAttr)
43 SALOMEDSImpl_GenericAttribute* ga = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(theAttr);
45 return ga->GetClassType();
50 void SALOMEDSImpl_GenericAttribute::Impl_CheckLocked(DF_Attribute* theAttr)
52 SALOMEDSImpl_GenericAttribute* ga = dynamic_cast<SALOMEDSImpl_GenericAttribute*>(theAttr);
56 string SALOMEDSImpl_GenericAttribute::Type()
62 void SALOMEDSImpl_GenericAttribute::CheckLocked()
64 DF_Label aLabel = Label();
65 if(aLabel.IsNull()) return;
67 SALOMEDSImpl_Study* aStudy = SALOMEDSImpl_Study::GetStudy(aLabel);
69 if(aStudy->IsLocked()) {
70 aStudy->_errorCode = "LockProtection";
71 throw LockProtection("LockProtection");
75 SALOMEDSImpl_SObject SALOMEDSImpl_GenericAttribute::GetSObject()
77 SALOMEDSImpl_SObject so;
78 DF_Label aLabel = Label();
79 if(aLabel.IsNull()) return so;
80 return SALOMEDSImpl_Study::SObject(aLabel);
83 void SALOMEDSImpl_GenericAttribute::SetModifyFlag()
85 DF_Label aLabel = Label();
86 if(aLabel.IsNull()) return;
88 SALOMEDSImpl_Study* aStudy = SALOMEDSImpl_Study::GetStudy(aLabel);
89 if(aStudy) aStudy->Modify();