Salome HOME
Synchronize adm files
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_AttributeParameter_i.cxx
old mode 100644 (file)
new mode 100755 (executable)
index da57b5a..282301b
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014  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
+// 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
-//  version 2.1 of the License.
+// 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, or (at your option) any later version.
 //
-//  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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : SALOMEDS_AttributeParameter_i.cxx
 //  Author : Sergey RUIN
 //  Module : SALOME
@@ -28,7 +29,8 @@
 
 #include <vector>
 
-using namespace std;
+#include "Utils_ExceptHandlers.hxx"
+UNEXPECT_CATCH(AP_InvalidIdentifier, SALOMEDS::AttributeParameter::InvalidIdentifier);
 
 //=======================================================================
 /*!
@@ -50,8 +52,10 @@ void SALOMEDS_AttributeParameter_i::SetInt(const char* theID, CORBA::Long theVal
  */
 //=======================================================================
 CORBA::Long SALOMEDS_AttributeParameter_i::GetInt(const char* theID)
+  throw (SALOMEDS::AttributeParameter::InvalidIdentifier)
 {
   SALOMEDS::Locker lock; 
+  Unexpect aCatch (AP_InvalidIdentifier);
   return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetInt(theID);
 }
 
@@ -75,8 +79,10 @@ void SALOMEDS_AttributeParameter_i::SetReal(const char* theID, CORBA::Double the
  */
 //=======================================================================
 CORBA::Double SALOMEDS_AttributeParameter_i::GetReal(const char* theID)
+  throw (SALOMEDS::AttributeParameter::InvalidIdentifier)
 {
   SALOMEDS::Locker lock; 
+  Unexpect aCatch (AP_InvalidIdentifier);
   return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetReal(theID);
 }
 
@@ -101,8 +107,10 @@ void SALOMEDS_AttributeParameter_i::SetString(const char* theID, const char* the
  */
 //=======================================================================
 char* SALOMEDS_AttributeParameter_i::GetString(const char* theID)
+  throw (SALOMEDS::AttributeParameter::InvalidIdentifier)
 {
   SALOMEDS::Locker lock; 
+  Unexpect aCatch (AP_InvalidIdentifier);
   SALOMEDSImpl_AttributeParameter* impl = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl);
   CORBA::String_var c_s = CORBA::string_dup(impl->GetString(theID).c_str());
   return c_s._retn();
@@ -128,8 +136,10 @@ void SALOMEDS_AttributeParameter_i::SetBool(const char* theID, CORBA::Boolean th
  */
 //=======================================================================
 CORBA::Boolean SALOMEDS_AttributeParameter_i::GetBool(const char* theID)
+  throw (SALOMEDS::AttributeParameter::InvalidIdentifier)
 {
   SALOMEDS::Locker lock; 
+  Unexpect aCatch (AP_InvalidIdentifier);
   return dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetBool(theID);
 }
   
@@ -143,7 +153,7 @@ void SALOMEDS_AttributeParameter_i::SetRealArray(const char* theID, const SALOME
 {
   SALOMEDS::Locker lock; 
   CheckLocked();
-  vector<double> v;
+  std::vector<double> v;
   int length = theArray.length();
   if(length) {
     v.resize(length);
@@ -159,10 +169,12 @@ void SALOMEDS_AttributeParameter_i::SetRealArray(const char* theID, const SALOME
  */
 //=======================================================================
 SALOMEDS::DoubleSeq* SALOMEDS_AttributeParameter_i::GetRealArray(const char* theID)
+  throw (SALOMEDS::AttributeParameter::InvalidIdentifier)
 {
   SALOMEDS::Locker lock; 
+  Unexpect aCatch (AP_InvalidIdentifier);
   SALOMEDS::DoubleSeq_var aSeq = new SALOMEDS::DoubleSeq;
-  vector<double> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetRealArray(theID);
+  std::vector<double> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetRealArray(theID);
   int length = v.size();
   if(length) {
     aSeq->length(length);
@@ -181,7 +193,7 @@ void SALOMEDS_AttributeParameter_i::SetIntArray(const char* theID, const SALOMED
 {
   SALOMEDS::Locker lock; 
   CheckLocked();
-  vector<int> v;
+  std::vector<int> v;
   int length = theArray.length();
   if(length) {
     v.resize(length);
@@ -197,10 +209,12 @@ void SALOMEDS_AttributeParameter_i::SetIntArray(const char* theID, const SALOMED
  */
 //=======================================================================
 SALOMEDS::LongSeq* SALOMEDS_AttributeParameter_i::GetIntArray(const char* theID)
+  throw (SALOMEDS::AttributeParameter::InvalidIdentifier)
 {
   SALOMEDS::Locker lock; 
+  Unexpect aCatch (AP_InvalidIdentifier);
   SALOMEDS::LongSeq_var aSeq = new SALOMEDS::LongSeq;
-  vector<int> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetIntArray(theID);
+  std::vector<int> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetIntArray(theID);
   int length = v.size();
   if(length) {
     aSeq->length(length);
@@ -219,11 +233,11 @@ void SALOMEDS_AttributeParameter_i::SetStrArray(const char* theID, const SALOMED
 {
   SALOMEDS::Locker lock; 
   CheckLocked();
-  vector<string> v;
+  std::vector<std::string> v;
   int length = theArray.length();
   if(length) {
     v.resize(length);
-    for(int i = 0; i<length; i++) v[i] = string(theArray[i].in());
+    for(int i = 0; i<length; i++) v[i] = std::string(theArray[i].in());
   }
   dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->SetStrArray(theID, v);
 }
@@ -235,10 +249,12 @@ void SALOMEDS_AttributeParameter_i::SetStrArray(const char* theID, const SALOMED
  */
 //=======================================================================
 SALOMEDS::StringSeq* SALOMEDS_AttributeParameter_i::GetStrArray(const char* theID)
+  throw (SALOMEDS::AttributeParameter::InvalidIdentifier)
 {
   SALOMEDS::Locker lock; 
+  Unexpect aCatch (AP_InvalidIdentifier);
   SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq;
-  vector<string> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetStrArray(theID);
+  std::vector<std::string> v = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetStrArray(theID);
   int length = v.size();
   if(length) {
     aSeq->length(length);
@@ -335,7 +351,7 @@ SALOMEDS::StringSeq* SALOMEDS_AttributeParameter_i::GetIDs(CORBA::Long theType)
 {
   SALOMEDS::Locker lock; 
   SALOMEDS::StringSeq_var CorbaSeq = new SALOMEDS::StringSeq;
-  vector<string> A = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetIDs((Parameter_Types)theType);
+  std::vector<std::string> A = dynamic_cast<SALOMEDSImpl_AttributeParameter*>(_impl)->GetIDs((Parameter_Types)theType);
 
   if(A.size()) {
     int length = A.size();