Salome HOME
Issue 0020194: EDF 977 ALL: Get rid of warnings PACKAGE_VERSION already defined
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_AttributeSequenceOfInteger.cxx
index 16cc47d2b8ace8e5484b4f31b5607dd896cbbda2..15eb473052700c976b39ad45107c2644fa9a99ab 100644 (file)
@@ -1,35 +1,33 @@
-// Copyright (C) 2005  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 
-// 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 
-// Lesser General Public License for more details.
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// 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
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  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
+//  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
+//  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
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : SALOMEDS_AttributeSequenceOfInteger.cxx
 //  Author : Sergey RUIN
 //  Module : SALOME
-
+//
 #include "SALOMEDS_AttributeSequenceOfInteger.hxx"
 #include "SALOMEDS.hxx"
 
-#include <TCollection_AsciiString.hxx>
-#include <TCollection_ExtendedString.hxx>
-#include <TColStd_HSequenceOfInteger.hxx>
-
 SALOMEDS_AttributeSequenceOfInteger::SALOMEDS_AttributeSequenceOfInteger
-                  (const Handle(SALOMEDSImpl_AttributeSequenceOfInteger)& theAttr)
+                  (SALOMEDSImpl_AttributeSequenceOfInteger* theAttr)
 :SALOMEDS_GenericAttribute(theAttr)
 {}
 
@@ -47,9 +45,7 @@ void SALOMEDS_AttributeSequenceOfInteger::Assign(const std::vector<int>& other)
   if (_isLocal) {
     CheckLocked();
     SALOMEDS::Locker lock;
-    Handle(TColStd_HSequenceOfInteger) aSeq = new TColStd_HSequenceOfInteger;
-    for (i = 0; i < aLength; i++) aSeq->Append(other[i]);
-    Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_local_impl)->Assign(aSeq);
+    dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_local_impl)->Assign(other);
   }
   else {
     SALOMEDS::LongSeq_var aSeq = new SALOMEDS::LongSeq();
@@ -65,8 +61,8 @@ std::vector<int> SALOMEDS_AttributeSequenceOfInteger::CorbaSequence()
   int i, aLength;
   if (_isLocal) {
     SALOMEDS::Locker lock;
-    Handle(SALOMEDSImpl_AttributeSequenceOfInteger) aSeqAttr;
-    aSeqAttr = Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_local_impl);
+    SALOMEDSImpl_AttributeSequenceOfInteger* aSeqAttr;
+    aSeqAttr = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_local_impl);
     aLength = aSeqAttr->Length();
     for (i = 1; i <=aLength; i++) aVector.push_back(aSeqAttr->Value(i));
   }
@@ -84,7 +80,7 @@ void SALOMEDS_AttributeSequenceOfInteger::Add(int value)
   if (_isLocal) {
     CheckLocked();
     SALOMEDS::Locker lock;
-    Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_local_impl)->Add(value);
+    dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_local_impl)->Add(value);
   }
   else SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl)->Add(value);
 }
@@ -94,7 +90,7 @@ void SALOMEDS_AttributeSequenceOfInteger::Remove(int index)
   if (_isLocal) {
     CheckLocked();
     SALOMEDS::Locker lock;
-    Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_local_impl)->Remove(index);
+    dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_local_impl)->Remove(index);
   }
   else SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl)->Remove(index);
 }
@@ -104,7 +100,7 @@ void SALOMEDS_AttributeSequenceOfInteger::ChangeValue(int index, int value)
   if (_isLocal) {
     CheckLocked();
     SALOMEDS::Locker lock;
-    Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_local_impl)->ChangeValue(index, value);
+    dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_local_impl)->ChangeValue(index, value);
   }
   else SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl)->ChangeValue(index, value);
 }
@@ -114,7 +110,7 @@ int SALOMEDS_AttributeSequenceOfInteger::Value(int index)
   int aValue;
   if (_isLocal) {
     SALOMEDS::Locker lock;
-    aValue = Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_local_impl)->Value(index);
+    aValue = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_local_impl)->Value(index);
   }
   else aValue = SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl)->Value(index);
   return aValue;
@@ -125,7 +121,7 @@ int SALOMEDS_AttributeSequenceOfInteger::Length()
   int aValue;
   if (_isLocal) {
     SALOMEDS::Locker lock;
-    aValue = Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_local_impl)-> Length();
+    aValue = dynamic_cast<SALOMEDSImpl_AttributeSequenceOfInteger*>(_local_impl)-> Length();
   }
   else aValue = SALOMEDS::AttributeSequenceOfInteger::_narrow(_corba_impl)-> Length();
   return aValue;