X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSALOMEDS%2FSALOMEDS_AttributeParameter_i.cxx;h=2840f4d59018ba3d0956ee04e52b92f0c1488419;hb=83f6420d3682a53ec22b946b95c037e83a05ca59;hp=da57b5a983a5d52ceb7271e0d13d97045fb5f0d7;hpb=7d2fe213bdf5bf962ce11e253020c9d3e0bc1cce;p=modules%2Fkernel.git diff --git a/src/SALOMEDS/SALOMEDS_AttributeParameter_i.cxx b/src/SALOMEDS/SALOMEDS_AttributeParameter_i.cxx index da57b5a98..2840f4d59 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeParameter_i.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeParameter_i.cxx @@ -1,24 +1,25 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2013 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. // -// 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 -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(_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(_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(_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(_impl)->GetBool(theID); } @@ -143,7 +153,7 @@ void SALOMEDS_AttributeParameter_i::SetRealArray(const char* theID, const SALOME { SALOMEDS::Locker lock; CheckLocked(); - vector v; + std::vector 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 v = dynamic_cast(_impl)->GetRealArray(theID); + std::vector v = dynamic_cast(_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 v; + std::vector 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 v = dynamic_cast(_impl)->GetIntArray(theID); + std::vector v = dynamic_cast(_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 v; + std::vector v; int length = theArray.length(); if(length) { v.resize(length); - for(int i = 0; i(_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 v = dynamic_cast(_impl)->GetStrArray(theID); + std::vector v = dynamic_cast(_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 A = dynamic_cast(_impl)->GetIDs((Parameter_Types)theType); + std::vector A = dynamic_cast(_impl)->GetIDs((Parameter_Types)theType); if(A.size()) { int length = A.size();