Back to index

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