Salome HOME
Fix SIGSEGV in data server, in local driver implementation, if some component does...
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_Attributes.hxx
index a0c5586ebf09daf4101a74a5685a40017e9cb5f0..edf76f0edeffd4bfe7f3cc6c8ee70ac255e815b2 100644 (file)
@@ -1,26 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// 
+//
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
+// License as published by the Free Software Foundation; either
 // version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 // Lesser General Public License for more details.
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : SALOMEDS_Attributes.hxx
 //  Author : Sergey RUIN
 //  Module : SALOME
-
+//
 #ifndef __SALOMEDS_ATTRIBUTES__H__
 #define __SALOMEDS_ATTRIBUTES__H__
 
@@ -54,6 +57,8 @@
 #include "SALOMEDSImpl_AttributeFileType.hxx"
 #include "SALOMEDSImpl_AttributeFlags.hxx"
 #include "SALOMEDSImpl_AttributeGraphic.hxx"
+#include "SALOMEDSImpl_AttributeParameter.hxx"
+#include "SALOMEDSImpl_AttributeString.hxx"
 
 #include "SALOMEDS_GenericAttribute_i.hxx"
 #include "SALOMEDS_AttributeName_i.hxx"
 #include "SALOMEDS_AttributeFileType_i.hxx"
 #include "SALOMEDS_AttributeFlags_i.hxx"
 #include "SALOMEDS_AttributeGraphic_i.hxx"
+#include "SALOMEDS_AttributeParameter_i.hxx"
+#include "SALOMEDS_AttributeString_i.hxx"
 
-#define __CreateCORBAAttribute(CORBA_Name) if (strcmp(aTypeOfAttribute, #CORBA_Name) == 0) { \
-    Handle(SALOMEDSImpl_##CORBA_Name) A = Handle(SALOMEDSImpl_##CORBA_Name)::DownCast(theAttr); \
+#define __CreateCORBAAttribute(CORBA_Name) else if (strcmp(aTypeOfAttribute, #CORBA_Name) == 0) { \
+    SALOMEDSImpl_##CORBA_Name* A = dynamic_cast<SALOMEDSImpl_##CORBA_Name*>(theAttr); \
     SALOMEDS_##CORBA_Name##_i* Attr = new SALOMEDS_##CORBA_Name##_i(A, theOrb); \
     attr_servant = Attr; \
     anAttribute = Attr->CORBA_Name::_this(); \
 
 
 #define __CreateGenericCORBAAttribute \
+  if(0){} \
 __CreateCORBAAttribute(AttributeReal) \
 __CreateCORBAAttribute(AttributeInteger) \
 __CreateCORBAAttribute(AttributeSequenceOfReal) \
@@ -121,6 +129,8 @@ __CreateCORBAAttribute(AttributeFileType) \
 __CreateCORBAAttribute(AttributeFlags) \
 __CreateCORBAAttribute(AttributeGraphic) \
 __CreateCORBAAttribute(AttributeTreeNode) \
-__CreateCORBAAttribute(AttributeUserID)
+__CreateCORBAAttribute(AttributeUserID) \
+__CreateCORBAAttribute(AttributeParameter) \
+__CreateCORBAAttribute(AttributeString)
 
 #endif