Back to index

salome-kernel  6.5.0
SALOMEDS_AttributeTableOfReal.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  File   : SALOMEDS_AttributeTableOfReal.cxx
00024 //  Author : Sergey RUIN
00025 //  Module : SALOME
00026 //
00027 #include "SALOMEDS_AttributeTableOfReal.hxx"
00028 #include "SALOMEDS.hxx"
00029 
00030 SALOMEDS_AttributeTableOfReal::SALOMEDS_AttributeTableOfReal
00031                   (SALOMEDSImpl_AttributeTableOfReal* theAttr)
00032 :SALOMEDS_GenericAttribute(theAttr)
00033 {}
00034 
00035 SALOMEDS_AttributeTableOfReal::SALOMEDS_AttributeTableOfReal(SALOMEDS::AttributeTableOfReal_ptr theAttr)
00036 :SALOMEDS_GenericAttribute(theAttr)
00037 {}
00038 
00039 SALOMEDS_AttributeTableOfReal::~SALOMEDS_AttributeTableOfReal()
00040 {}
00041 
00042 
00043 void SALOMEDS_AttributeTableOfReal::SetTitle(const std::string& theTitle)
00044 {
00045   if (_isLocal) {
00046     CheckLocked();
00047     SALOMEDS::Locker lock;     
00048     dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SetTitle(theTitle);
00049   }
00050   else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetTitle(theTitle.c_str());
00051 }
00052 
00053 std::string SALOMEDS_AttributeTableOfReal::GetTitle()
00054 {
00055   std::string aStr;
00056   if (_isLocal) {
00057     SALOMEDS::Locker lock; 
00058     aStr = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetTitle();
00059   }
00060   else aStr = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetTitle();
00061   return aStr;
00062 }
00063 
00064 void SALOMEDS_AttributeTableOfReal::SetRowTitle(int theIndex, const std::string& theTitle)
00065 {
00066   if (_isLocal) {
00067     CheckLocked();
00068     SALOMEDS::Locker lock;     
00069     dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SetRowTitle(theIndex, theTitle);
00070   }
00071   else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowTitle(theIndex, theTitle.c_str());
00072 }
00073 
00074 std::string SALOMEDS_AttributeTableOfReal::GetRowTitle(int theIndex)
00075 {
00076   std::string aTitle;
00077   if (_isLocal) {
00078     SALOMEDS::Locker lock;
00079     try {
00080       aTitle = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetRowTitle(theIndex);
00081     }
00082     catch(...) {
00083       throw SALOMEDS::AttributeTable::IncorrectIndex();
00084     }
00085   }
00086   else {
00087     aTitle = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRowTitle(theIndex);
00088   }
00089   return aTitle;
00090 }
00091 
00092 void SALOMEDS_AttributeTableOfReal::SetRowTitles(const std::vector<std::string>& theTitles)
00093 {
00094   CheckLocked();
00095   int aLength = theTitles.size(), i;
00096   if (_isLocal) {
00097     CheckLocked();
00098     SALOMEDS::Locker lock;     
00099     dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SetRowTitles(theTitles);
00100   }
00101   else {
00102     SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
00103     aSeq->length(aLength);
00104     for (i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str();
00105     SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowTitles(aSeq);
00106   }
00107 }
00108 
00109 std::vector<std::string> SALOMEDS_AttributeTableOfReal::GetRowTitles()
00110 {
00111   std::vector<std::string> aVector;
00112   int aLength, i;
00113   if (_isLocal) {
00114     SALOMEDS::Locker lock; 
00115     aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetRowTitles();
00116   }
00117   else {
00118     SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRowTitles();
00119     aLength = aSeq->length();
00120     for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
00121   }
00122   return aVector;
00123 }
00124 
00125 void SALOMEDS_AttributeTableOfReal::SetColumnTitle(int theIndex, const std::string& theTitle)
00126 {
00127   if (_isLocal) {
00128     CheckLocked();
00129     SALOMEDS::Locker lock; 
00130     dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SetColumnTitle(theIndex, theTitle);
00131   }
00132   else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetColumnTitle(theIndex, theTitle.c_str());
00133 }
00134 
00135 std::string SALOMEDS_AttributeTableOfReal::GetColumnTitle(int theIndex)
00136 {
00137   std::string aTitle;
00138   if (_isLocal) {
00139     SALOMEDS::Locker lock;
00140     try {
00141       aTitle = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetColumnTitle(theIndex);
00142     }
00143     catch(...) {
00144       throw SALOMEDS::AttributeTable::IncorrectIndex();
00145     }
00146   }
00147   else {
00148     aTitle = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetColumnTitle(theIndex);
00149   }
00150   return aTitle;
00151 }
00152 
00153 void SALOMEDS_AttributeTableOfReal::SetColumnTitles(const std::vector<std::string>& theTitles)
00154 {
00155   int aLength = theTitles.size(), i;
00156   if (_isLocal) {
00157     CheckLocked();
00158     SALOMEDS::Locker lock; 
00159     dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SetColumnTitles(theTitles);
00160   }
00161   else {
00162     SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
00163     aSeq->length(aLength);
00164     for (i = 0; i < aLength; i++) aSeq[i] = (char*)theTitles[i].c_str();
00165     SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetColumnTitles(aSeq);
00166   }
00167 }
00168 
00169 std::vector<std::string> SALOMEDS_AttributeTableOfReal::GetColumnTitles()
00170 {
00171   std::vector<std::string> aVector;
00172   int aLength, i;
00173   if (_isLocal) {
00174     SALOMEDS::Locker lock; 
00175     aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetColumnTitles();
00176   }
00177   else {
00178     SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetColumnTitles();
00179     aLength = aSeq->length();
00180     for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
00181   }
00182   return aVector;
00183 }
00184 
00185 void SALOMEDS_AttributeTableOfReal::SetRowUnit(int theIndex, const std::string& theUnit)
00186 {
00187   if (_isLocal) {
00188     CheckLocked();
00189     SALOMEDS::Locker lock; 
00190     dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SetRowUnit(theIndex, theUnit);
00191   }
00192   else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowUnit(theIndex, theUnit.c_str());
00193 }
00194 
00195 std::string SALOMEDS_AttributeTableOfReal::GetRowUnit(int theIndex)
00196 {
00197   std::string aTitle;
00198   if (_isLocal) {
00199     SALOMEDS::Locker lock;
00200     try {
00201       aTitle = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetRowUnit(theIndex);
00202     }
00203     catch(...) {
00204       throw SALOMEDS::AttributeTable::IncorrectIndex();
00205     }
00206   }
00207   else {
00208     aTitle = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRowUnit(theIndex);
00209   }
00210   return aTitle;
00211 }
00212 
00213 void SALOMEDS_AttributeTableOfReal::SetRowUnits(const std::vector<std::string>& theUnits)
00214 {
00215   int aLength = theUnits.size(), i;
00216   if (_isLocal) {
00217     CheckLocked();
00218     SALOMEDS::Locker lock; 
00219     dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SetRowUnits(theUnits);
00220   }
00221   else {
00222     SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
00223     aSeq->length(aLength);
00224     for (i = 0; i < aLength; i++) aSeq[i] = (char*)theUnits[i].c_str();
00225     SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRowUnits(aSeq);
00226   }
00227 }
00228 
00229 std::vector<std::string> SALOMEDS_AttributeTableOfReal::GetRowUnits()
00230 {
00231   std::vector<std::string> aVector;
00232   int aLength, i;
00233   if (_isLocal) {
00234     SALOMEDS::Locker lock; 
00235     aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetRowUnits();
00236   }
00237   else {
00238     SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRowUnits();
00239     aLength = aSeq->length();
00240     for (i = 0; i < aLength; i++) aVector.push_back(std::string(aSeq[i].in()));
00241   }
00242   return aVector;
00243 }
00244 
00245 int SALOMEDS_AttributeTableOfReal::GetNbRows()
00246 {
00247   int aNb;
00248   if (_isLocal) {
00249     SALOMEDS::Locker lock; 
00250     aNb = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetNbRows();
00251   }
00252   else aNb = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetNbRows();
00253   return aNb;
00254 }
00255 
00256 int SALOMEDS_AttributeTableOfReal::GetNbColumns()
00257 {  
00258   int aNb;
00259   if (_isLocal) {
00260     SALOMEDS::Locker lock; 
00261     aNb = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetNbColumns();
00262   }
00263   else aNb = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetNbColumns();
00264   return aNb;
00265 }
00266 
00267 void SALOMEDS_AttributeTableOfReal::AddRow(const std::vector<double>& theData)
00268 {
00269   int aLength = theData.size(), i;
00270   if (_isLocal) {
00271     CheckLocked();
00272     SALOMEDS::Locker lock; 
00273     SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl);
00274     try {
00275       aTable->SetRowData(aTable->GetNbRows() + 1, theData);
00276     }   
00277     catch(...) {
00278       throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
00279     }
00280   }
00281   else {
00282     SALOMEDS::DoubleSeq_var aSeq = new SALOMEDS::DoubleSeq();
00283     aSeq->length(aLength);
00284     for (i = 0; i < aLength; i++) aSeq[i] = theData[i];
00285     SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->AddRow(aSeq);
00286   }
00287 }
00288 
00289 void SALOMEDS_AttributeTableOfReal::SetRow(int theRow, const std::vector<double>& theData)
00290 {
00291   int aLength = theData.size(), i;
00292   if (_isLocal) {
00293     CheckLocked();
00294     SALOMEDS::Locker lock; 
00295     SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl);
00296     try {
00297       aTable->SetRowData(theRow, theData);
00298     }   
00299     catch(...) {
00300       throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
00301     }
00302   }
00303   else {
00304     SALOMEDS::DoubleSeq_var aSeq = new SALOMEDS::DoubleSeq();
00305     aSeq->length(aLength);
00306     for (i = 0; i < aLength; i++) aSeq[i] = theData[i];
00307     SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetRow(theRow, aSeq);
00308   }
00309 }
00310 
00311 std::vector<double> SALOMEDS_AttributeTableOfReal::GetRow(int theRow)
00312 {
00313   std::vector<double> aVector;
00314   int aLength, i;
00315   if (_isLocal) {
00316     SALOMEDS::Locker lock; 
00317     aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetRowData(theRow);
00318   }
00319   else {
00320     SALOMEDS::DoubleSeq_var aRow = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRow(theRow);
00321     aLength = aRow->length();
00322     for (i = 0; i < aLength; i++) aVector.push_back(aRow[i]);
00323   }
00324 
00325   return aVector;
00326 }
00327 
00328 void SALOMEDS_AttributeTableOfReal::AddColumn(const std::vector<double>& theData)
00329 {
00330   int aLength = theData.size(), i;
00331   if (_isLocal) {
00332     CheckLocked();
00333     SALOMEDS::Locker lock; 
00334     SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl);
00335     try {
00336       aTable->SetColumnData(aTable->GetNbColumns() + 1, theData);
00337     }   
00338     catch(...) {
00339       throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
00340     }
00341   }
00342   else {
00343     SALOMEDS::DoubleSeq_var aColumn = new SALOMEDS::DoubleSeq();
00344     aColumn->length(aLength);
00345     for (i = 0; i < aLength; i++) aColumn[i] = theData[i];
00346     SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->AddColumn(aColumn);
00347   }
00348 }
00349 
00350 void SALOMEDS_AttributeTableOfReal::SetColumn(int theColumn, const std::vector<double>& theData)
00351 {
00352   int aLength = theData.size(), i;
00353   if (_isLocal) {
00354     CheckLocked();
00355     SALOMEDS::Locker lock; 
00356     SALOMEDSImpl_AttributeTableOfReal* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl);
00357     try {
00358       aTable->SetColumnData(theColumn, theData);
00359     }   
00360     catch(...) {
00361       throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
00362     }
00363   }
00364   else {
00365     SALOMEDS::DoubleSeq_var aColumn = new SALOMEDS::DoubleSeq();
00366     aColumn->length(aLength);
00367     for (i = 0; i < aLength; i++) aColumn[i] = theData[i];
00368     SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetColumn(theColumn, aColumn);
00369   }
00370 }
00371 
00372 std::vector<double> SALOMEDS_AttributeTableOfReal::GetColumn(int theColumn)
00373 {
00374   std::vector<double> aVector;
00375   int aLength, i;
00376   if (_isLocal) {
00377     SALOMEDS::Locker lock; 
00378     aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetColumnData(theColumn);
00379   }
00380   else {
00381     SALOMEDS::DoubleSeq_var aColumn = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetColumn(theColumn);
00382     aLength = aColumn->length();
00383     for (i = 0; i < aLength; i++) aVector.push_back(aColumn[i]);
00384   }
00385   return aVector;
00386 }
00387 
00388 void SALOMEDS_AttributeTableOfReal::PutValue(double theValue, int theRow, int theColumn)
00389 {
00390   if (_isLocal) {
00391     CheckLocked();
00392     SALOMEDS::Locker lock; 
00393     try {
00394       dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->PutValue(theValue, theRow, theColumn);
00395     }   
00396     catch(...) {
00397       throw SALOMEDS::AttributeTable::IncorrectIndex();
00398     }
00399   }
00400   else {
00401     SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->PutValue(theValue, theRow, theColumn);
00402   }
00403 }
00404 
00405 bool SALOMEDS_AttributeTableOfReal::HasValue(int theRow, int theColumn)
00406 {
00407   bool ret;
00408   if (_isLocal) {
00409     SALOMEDS::Locker lock; 
00410     ret = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->HasValue(theRow, theColumn);
00411   }
00412   else ret = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->HasValue(theRow, theColumn);
00413   return ret;
00414 }
00415 
00416 double SALOMEDS_AttributeTableOfReal::GetValue(int theRow, int theColumn)
00417 {
00418   double aValue;
00419   if (_isLocal) {
00420     SALOMEDS::Locker lock; 
00421     try {
00422       aValue = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetValue(theRow, theColumn);
00423     }   
00424     catch(...) {
00425       throw SALOMEDS::AttributeTable::IncorrectIndex();
00426     }
00427   }
00428   else {
00429     aValue = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetValue(theRow, theColumn);
00430   }
00431   return aValue;
00432 }
00433 
00434 void SALOMEDS_AttributeTableOfReal::RemoveValue(int theRow, int theColumn)
00435 {
00436   if (_isLocal) {
00437     SALOMEDS::Locker lock;
00438     try {
00439       dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->RemoveValue(theRow, theColumn);
00440     }   
00441     catch(...) {
00442       throw SALOMEDS::AttributeTable::IncorrectIndex();
00443     }
00444   }
00445   else {
00446     SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->RemoveValue(theRow, theColumn);
00447   }
00448 }
00449 
00450 std::vector<int> SALOMEDS_AttributeTableOfReal::GetRowSetIndices(int theRow)
00451 {
00452   std::vector<int> aVector;
00453   int aLength, i;
00454   if (_isLocal) {
00455     SALOMEDS::Locker lock; 
00456     aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->GetSetRowIndices(theRow);
00457   }
00458   else {
00459     SALOMEDS::LongSeq_var aSet = SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->GetRowSetIndices(theRow);
00460     aLength = aSet->length();
00461     for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
00462   }
00463   return aVector;
00464 }
00465 
00466 void SALOMEDS_AttributeTableOfReal::SetNbColumns(int theNbColumns)
00467 {
00468   if (_isLocal) {
00469     SALOMEDS::Locker lock; 
00470     dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SetNbColumns(theNbColumns);
00471   }
00472   else SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SetNbColumns(theNbColumns);
00473 }
00474 
00475 std::vector<int> SALOMEDS_AttributeTableOfReal::SortRow(int theRow, SortOrder theOrder, SortPolicy thePolicy)
00476 {
00477   std::vector<int> aVector;
00478   int aLength, i;
00479   if (_isLocal) {
00480     SALOMEDS::Locker lock;
00481     try {
00482       aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SortRow(theRow, 
00483                                                                                        (SALOMEDSImpl_AttributeTable::SortOrder)theOrder, 
00484                                                                                        (SALOMEDSImpl_AttributeTable::SortPolicy)thePolicy);
00485     }   
00486     catch(...) {
00487       throw SALOMEDS::AttributeTable::IncorrectIndex();
00488     }
00489   }
00490   else {
00491     SALOMEDS::LongSeq_var aSet =
00492       SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SortRow(theRow, 
00493                                                                     (SALOMEDS::AttributeTable::SortOrder)theOrder, 
00494                                                                     (SALOMEDS::AttributeTable::SortPolicy)thePolicy);
00495     aLength = aSet->length();  
00496     for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
00497   }
00498   return aVector;
00499 }
00500 
00501 std::vector<int> SALOMEDS_AttributeTableOfReal::SortColumn(int theColumn, SortOrder theOrder, SortPolicy thePolicy)
00502 {
00503   std::vector<int> aVector;
00504   int aLength, i;
00505   if (_isLocal) {
00506     SALOMEDS::Locker lock;
00507     try {
00508       aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SortColumn(theColumn, 
00509                                                                                           (SALOMEDSImpl_AttributeTable::SortOrder)theOrder, 
00510                                                                                           (SALOMEDSImpl_AttributeTable::SortPolicy)thePolicy);
00511     }   
00512     catch(...) {
00513       throw SALOMEDS::AttributeTable::IncorrectIndex();
00514     }
00515   }
00516   else {
00517     SALOMEDS::LongSeq_var aSet =
00518       SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SortColumn(theColumn, 
00519                                                                        (SALOMEDS::AttributeTable::SortOrder)theOrder, 
00520                                                                        (SALOMEDS::AttributeTable::SortPolicy)thePolicy);
00521     aLength = aSet->length();  
00522     for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
00523   }
00524   return aVector;
00525 }
00526 
00527 std::vector<int> SALOMEDS_AttributeTableOfReal::SortByRow(int theRow, SortOrder theOrder, SortPolicy thePolicy)
00528 {
00529   std::vector<int> aVector;
00530   int aLength, i;
00531   if (_isLocal) {
00532     SALOMEDS::Locker lock;
00533     try {
00534       aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SortByRow(theRow, 
00535                                                                                          (SALOMEDSImpl_AttributeTable::SortOrder)theOrder, 
00536                                                                                          (SALOMEDSImpl_AttributeTable::SortPolicy)thePolicy);
00537     }   
00538     catch(...) {
00539       throw SALOMEDS::AttributeTable::IncorrectIndex();
00540     }
00541   }
00542   else {
00543     SALOMEDS::LongSeq_var aSet =
00544       SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SortByRow(theRow, 
00545                                                                       (SALOMEDS::AttributeTable::SortOrder)theOrder, 
00546                                                                       (SALOMEDS::AttributeTable::SortPolicy)thePolicy);
00547     aLength = aSet->length();  
00548     for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
00549   }
00550   return aVector;
00551 }
00552 
00553 std::vector<int> SALOMEDS_AttributeTableOfReal::SortByColumn(int theColumn, SortOrder theOrder, SortPolicy thePolicy)
00554 {
00555   std::vector<int> aVector;
00556   int aLength, i;
00557   if (_isLocal) {
00558     SALOMEDS::Locker lock;
00559     try {
00560       aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SortByColumn(theColumn, 
00561                                                                                             (SALOMEDSImpl_AttributeTable::SortOrder)theOrder, 
00562                                                                                             (SALOMEDSImpl_AttributeTable::SortPolicy)thePolicy);
00563     }   
00564     catch(...) {
00565       throw SALOMEDS::AttributeTable::IncorrectIndex();
00566     }
00567   }
00568   else {
00569     SALOMEDS::LongSeq_var aSet =
00570       SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SortByColumn(theColumn, 
00571                                                                          (SALOMEDS::AttributeTable::SortOrder)theOrder, 
00572                                                                          (SALOMEDS::AttributeTable::SortPolicy)thePolicy);
00573     aLength = aSet->length();  
00574     for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
00575   }
00576   return aVector;
00577 }
00578 
00579 void SALOMEDS_AttributeTableOfReal::SwapCells(int theRow1, int theColumn1, int theRow2, int theColumn2)
00580 {
00581   if (_isLocal) {
00582     SALOMEDS::Locker lock;
00583     try {
00584       dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SwapCells(theRow1, theColumn1, theRow2, theColumn2);
00585     }   
00586     catch(...) {
00587       throw SALOMEDS::AttributeTable::IncorrectIndex();
00588     }
00589   }
00590   else {
00591     SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SwapCells(theRow1, theColumn1, theRow2, theColumn2);
00592   }
00593 }
00594 
00595 void SALOMEDS_AttributeTableOfReal::SwapRows(int theRow1, int theRow2)
00596 {
00597   if (_isLocal) {
00598     SALOMEDS::Locker lock;
00599     try {
00600       dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SwapRows(theRow1, theRow2);
00601     }   
00602     catch(...) {
00603       throw SALOMEDS::AttributeTable::IncorrectIndex();
00604     }
00605   }
00606   else {
00607     SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SwapRows(theRow1, theRow2);
00608   }
00609 }
00610 
00611 void SALOMEDS_AttributeTableOfReal::SwapColumns(int theColumn1, int theColumn2)
00612 {
00613   if (_isLocal) {
00614     SALOMEDS::Locker lock;
00615     try {
00616       dynamic_cast<SALOMEDSImpl_AttributeTableOfReal*>(_local_impl)->SwapColumns(theColumn1, theColumn2);
00617     }   
00618     catch(...) {
00619       throw SALOMEDS::AttributeTable::IncorrectIndex();
00620     }
00621   }
00622   else {
00623     SALOMEDS::AttributeTableOfReal::_narrow(_corba_impl)->SwapColumns(theColumn1, theColumn2);
00624   }
00625 }