Back to index

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