Salome HOME
Update copyrights 2014.
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_AttributeTableOfInteger.cxx
1 // Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  File   : SALOMEDS_AttributeTableOfInteger.cxx
24 //  Author : Sergey RUIN
25 //  Module : SALOME
26 //
27 #include "SALOMEDS_AttributeTableOfInteger.hxx"
28 #include "SALOMEDS.hxx"
29
30 SALOMEDS_AttributeTableOfInteger::SALOMEDS_AttributeTableOfInteger
31                   (SALOMEDSImpl_AttributeTableOfInteger* theAttr)
32 :SALOMEDS_GenericAttribute(theAttr)
33 {}
34
35 SALOMEDS_AttributeTableOfInteger::SALOMEDS_AttributeTableOfInteger
36                   (SALOMEDS::AttributeTableOfInteger_ptr theAttr)
37 :SALOMEDS_GenericAttribute(theAttr)
38 {}
39
40 SALOMEDS_AttributeTableOfInteger::~SALOMEDS_AttributeTableOfInteger()
41 {}
42
43
44 void SALOMEDS_AttributeTableOfInteger::SetTitle(const std::string& theTitle)
45 {
46   if (_isLocal) {
47     CheckLocked();
48     SALOMEDS::Locker lock;
49     dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SetTitle(theTitle);
50   }
51   else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetTitle(theTitle.c_str());
52 }
53
54 std::string SALOMEDS_AttributeTableOfInteger::GetTitle()
55 {
56   std::string aStr;
57   if (_isLocal) {
58     SALOMEDS::Locker lock;
59     aStr = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetTitle();
60   }
61   else aStr = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetTitle();
62   return aStr;
63 }
64
65 void SALOMEDS_AttributeTableOfInteger::SetRowTitle(int theIndex, const std::string& theTitle)
66 {
67   if (_isLocal) {
68     CheckLocked();
69     SALOMEDS::Locker lock;
70     dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SetRowTitle(theIndex, theTitle);
71   }
72   else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowTitle(theIndex, theTitle.c_str());
73 }
74
75 std::string SALOMEDS_AttributeTableOfInteger::GetRowTitle(int theIndex)
76 {
77   std::string aTitle;
78   if (_isLocal) {
79     SALOMEDS::Locker lock;
80     try {
81       aTitle = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetRowTitle(theIndex);
82     }
83     catch(...) {
84       throw SALOMEDS::AttributeTable::IncorrectIndex();
85     }
86   }
87   else {
88     aTitle = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRowTitle(theIndex);
89   }
90   return aTitle;
91 }
92
93 void SALOMEDS_AttributeTableOfInteger::SetRowTitles(const std::vector<std::string>& theTitles)
94 {
95   int aLength = theTitles.size(), i;
96   if (_isLocal) {
97     CheckLocked();
98     SALOMEDS::Locker lock;
99     std::vector<std::string> aSeq;
100     for (i = 0; i < aLength; i++) aSeq.push_back(theTitles[i]);
101     dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SetRowTitles(aSeq);
102   }
103   else {
104     SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
105     aSeq->length(aLength);
106     for(i = 0; i < aLength; i++) aSeq[i] = theTitles[i].c_str();
107     SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowTitles(aSeq);
108   }
109   
110 }
111
112 std::vector<std::string> SALOMEDS_AttributeTableOfInteger::GetRowTitles()
113 {
114   std::vector<std::string> aVector;
115   int aLength, i;
116   if (_isLocal) {
117     SALOMEDS::Locker lock;
118     aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetRowTitles();
119   }
120   else {
121     SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRowTitles();
122     aLength = aSeq->length();
123     for(i = 0; i<aLength; i++) aVector.push_back((char*)aSeq[i].in());
124   }
125   return aVector;
126 }
127
128 void SALOMEDS_AttributeTableOfInteger::SetColumnTitle(int theIndex, const std::string& theTitle)
129 {
130   if (_isLocal) {
131     CheckLocked();
132     SALOMEDS::Locker lock;
133     dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SetColumnTitle(theIndex, theTitle);
134   }
135   else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetColumnTitle(theIndex, theTitle.c_str());
136 }
137
138 std::string SALOMEDS_AttributeTableOfInteger::GetColumnTitle(int theIndex)
139 {
140   std::string aTitle;
141   if (_isLocal) {
142     SALOMEDS::Locker lock;
143     try {
144       aTitle = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetColumnTitle(theIndex);
145     }
146     catch(...) {
147       throw SALOMEDS::AttributeTable::IncorrectIndex();
148     }
149   }
150   else {
151     aTitle = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetColumnTitle(theIndex);
152   }
153   return aTitle;
154 }
155
156 void SALOMEDS_AttributeTableOfInteger::SetColumnTitles(const std::vector<std::string>& theTitles)
157 {
158   int aLength = theTitles.size(), i;
159   if (_isLocal) {
160     CheckLocked();
161     SALOMEDS::Locker lock;
162     std::vector<std::string> aSeq;
163     for (i = 0; i < aLength; i++) aSeq.push_back(theTitles[i]);
164     dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SetColumnTitles(aSeq);
165   }
166   else {
167     SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
168     aSeq->length(aLength);
169     for (i = 0; i < aLength; i++) aSeq[i] = theTitles[i].c_str();
170     SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetColumnTitles(aSeq);
171   }
172 }
173
174 std::vector<std::string> SALOMEDS_AttributeTableOfInteger::GetColumnTitles()
175 {
176   std::vector<std::string> aVector;
177   int aLength, i;
178   if (_isLocal) {
179     SALOMEDS::Locker lock;
180     aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetColumnTitles();
181   }
182   else {
183     SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetColumnTitles();
184     aLength = aSeq->length();
185     for (i = 0; i<aLength; i++) aVector.push_back((char*)aSeq[i].in());
186   }
187   return aVector;
188 }
189
190 void SALOMEDS_AttributeTableOfInteger::SetRowUnit(int theIndex, const std::string& theUnit)
191 {
192   if (_isLocal) {
193     CheckLocked();
194     SALOMEDS::Locker lock;
195     dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SetRowUnit(theIndex, theUnit);
196   }
197   else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowUnit(theIndex, theUnit.c_str());
198 }
199
200 std::string SALOMEDS_AttributeTableOfInteger::GetRowUnit(int theIndex)
201 {
202   std::string aTitle;
203   if (_isLocal) {
204     SALOMEDS::Locker lock;
205     try {
206       aTitle = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetRowUnit(theIndex);
207     }
208     catch(...) {
209       throw SALOMEDS::AttributeTable::IncorrectIndex();
210     }
211   }
212   else {
213     aTitle = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRowUnit(theIndex);
214   }
215   return aTitle;
216 }
217
218 void SALOMEDS_AttributeTableOfInteger::SetRowUnits(const std::vector<std::string>& theUnits)
219 {
220   int aLength = theUnits.size(), i;
221   if (_isLocal) {
222     CheckLocked();
223     SALOMEDS::Locker lock;
224     dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SetRowUnits(theUnits);
225   }
226   else {
227     SALOMEDS::StringSeq_var aSeq = new SALOMEDS::StringSeq();
228     aSeq->length(aLength);
229     for (i = 0; i < aLength; i++) aSeq[i] = (char*)theUnits[i].c_str();
230     SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRowUnits(aSeq);
231   }
232 }
233
234 std::vector<std::string> SALOMEDS_AttributeTableOfInteger::GetRowUnits()
235 {
236   std::vector<std::string> aVector;
237   int aLength, i;
238   if (_isLocal) {
239     SALOMEDS::Locker lock;
240     aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetRowUnits();
241   }
242   else {
243     SALOMEDS::StringSeq_var aSeq = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRowUnits();
244     aLength = aSeq->length();
245     for (i = 0; i < aLength; i++) aVector.push_back((char*)aSeq[i].in());
246   }
247   return aVector;
248 }
249
250 int SALOMEDS_AttributeTableOfInteger::GetNbRows()
251 {
252   int aNb;
253   if (_isLocal) {
254     SALOMEDS::Locker lock;
255     aNb = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetNbRows();
256   }
257   else aNb = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetNbRows();
258   return aNb;
259 }
260
261 int SALOMEDS_AttributeTableOfInteger::GetNbColumns()
262 {  
263   int aNb;
264   if (_isLocal) {
265     SALOMEDS::Locker lock;
266     aNb = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetNbColumns();
267   }
268   else aNb = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetNbColumns();
269   return aNb;
270   
271 }
272
273 void SALOMEDS_AttributeTableOfInteger::AddRow(const std::vector<int>& theData)
274 {
275   int aLength = theData.size(), i;
276   if (_isLocal) {
277     CheckLocked();
278     SALOMEDS::Locker lock;
279     SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl);
280     try {
281       aTable->SetRowData(aTable->GetNbRows() + 1, theData);
282     }   
283     catch(...) {
284       throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
285     }
286   }
287   else {
288     SALOMEDS::LongSeq_var aSeq = new SALOMEDS::LongSeq();
289     aSeq->length(aLength);
290     for(i = 0; i < aLength; i++) aSeq[i] = theData[i];
291     SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->AddRow(aSeq);
292   }
293 }
294
295 void SALOMEDS_AttributeTableOfInteger::SetRow(int theRow, const std::vector<int>& theData)
296 {
297   int aLength = theData.size(), i;
298   if (_isLocal) {
299     CheckLocked();
300     SALOMEDS::Locker lock;
301     SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl);
302     try {
303       aTable->SetRowData(theRow, theData);
304     }   
305     catch(...) {
306       throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
307     }
308   }
309   else {
310     SALOMEDS::LongSeq_var aSeq = new SALOMEDS::LongSeq();
311     aSeq->length(aLength);
312     for (i = 0; i < aLength; i++) aSeq[i] = theData[i];
313     SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetRow(theRow, aSeq);
314   }
315 }
316
317 std::vector<int> SALOMEDS_AttributeTableOfInteger::GetRow(int theRow)
318 {
319   std::vector<int> aVector;
320   int aLength, i;
321   if (_isLocal) {
322     SALOMEDS::Locker lock;
323     aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetRowData(theRow);
324   }
325   else {
326     SALOMEDS::LongSeq_var aRow = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRow(theRow);
327     aLength = aRow->length();
328     for (i = 0; i < aLength; i++) aVector.push_back(aRow[i]);
329   }
330
331   return aVector;
332 }
333
334 void SALOMEDS_AttributeTableOfInteger::AddColumn(const std::vector<int>& theData)
335 {
336   int aLength = theData.size(), i;
337   if (_isLocal) {
338     CheckLocked();
339     SALOMEDS::Locker lock;
340     SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl);
341     try {
342       aTable->SetColumnData(aTable->GetNbColumns() + 1, theData);
343     }   
344     catch(...) {
345       throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
346     }
347   }
348   else {
349     SALOMEDS::LongSeq_var aColumn = new SALOMEDS::LongSeq();
350     aColumn->length(aLength);
351     for(i = 0; i < aLength; i++) aColumn[i] = theData[i];
352     SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->AddColumn(aColumn);
353   }
354 }
355
356 void SALOMEDS_AttributeTableOfInteger::SetColumn(int theColumn, const std::vector<int>& theData)
357 {
358   int aLength = theData.size(), i;
359   if (_isLocal) {
360     CheckLocked();
361     SALOMEDS::Locker lock;
362     SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl);
363     try {
364       aTable->SetColumnData(theColumn, theData);
365     }   
366     catch(...) {
367       throw SALOMEDS::AttributeTable::IncorrectArgumentLength();
368     }
369   }
370   else {
371     SALOMEDS::LongSeq_var aColumn = new SALOMEDS::LongSeq();
372     aColumn->length(aLength);
373     for (i = 0; i < aLength; i++) aColumn[i] = theData[i];
374     SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetColumn(theColumn, aColumn);
375   }
376 }
377
378 std::vector<int> SALOMEDS_AttributeTableOfInteger::GetColumn(int theColumn)
379 {
380   std::vector<int> aVector;
381   int aLength, i;
382   if (_isLocal) {
383     SALOMEDS::Locker lock;
384     aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetColumnData(theColumn);
385   }
386   else {
387     SALOMEDS::LongSeq_var aColumn = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetColumn(theColumn);
388     aLength = aColumn->length();
389     for (i = 0; i < aLength; i++) aVector.push_back(aColumn[i]);
390   }
391   return aVector;
392 }
393
394 void SALOMEDS_AttributeTableOfInteger::PutValue(int theValue, int theRow, int theColumn)
395 {
396   if (_isLocal) {
397     CheckLocked();
398     SALOMEDS::Locker lock;
399     try {
400       dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->PutValue(theValue, theRow, theColumn);
401     }
402     catch(...) {
403       throw SALOMEDS::AttributeTable::IncorrectIndex();
404     }
405   }
406   else {
407     SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->PutValue(theValue, theRow, theColumn);
408   }
409 }
410
411 bool SALOMEDS_AttributeTableOfInteger::HasValue(int theRow, int theColumn)
412 {
413   bool ret;
414   if (_isLocal) {
415     SALOMEDS::Locker lock;
416     ret = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->HasValue(theRow, theColumn);
417   }
418   else ret = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->HasValue(theRow, theColumn);
419   return ret;
420 }
421
422 int SALOMEDS_AttributeTableOfInteger::GetValue(int theRow, int theColumn)
423 {
424   int aValue;
425   if (_isLocal) {
426     SALOMEDS::Locker lock;
427     try {
428       aValue = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetValue(theRow, theColumn);
429     }   
430     catch(...) {
431       throw SALOMEDS::AttributeTable::IncorrectIndex();
432     }
433   }
434   else {
435     aValue = SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetValue(theRow, theColumn);
436   }
437   return aValue;
438 }
439
440 void SALOMEDS_AttributeTableOfInteger::RemoveValue(int theRow, int theColumn)
441 {
442   if (_isLocal) {
443     SALOMEDS::Locker lock;
444     try {
445       dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->RemoveValue(theRow, theColumn);
446     }   
447     catch(...) {
448       throw SALOMEDS::AttributeTable::IncorrectIndex();
449     }
450   }
451   else {
452     SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->RemoveValue(theRow, theColumn);
453   }
454 }
455
456 std::vector<int> SALOMEDS_AttributeTableOfInteger::GetRowSetIndices(int theRow)
457 {
458   std::vector<int> aVector;
459   int aLength, i;
460   if (_isLocal) {
461     SALOMEDS::Locker lock;
462     aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->GetSetRowIndices(theRow);
463   }
464   else {
465     SALOMEDS::LongSeq_var aSet =
466       SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->GetRowSetIndices(theRow);
467     aLength = aSet->length();  
468     for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
469   }
470   return aVector;
471 }
472
473 void SALOMEDS_AttributeTableOfInteger::SetNbColumns(int theNbColumns)
474 {
475   if (_isLocal) {
476     SALOMEDS::Locker lock;
477     dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SetNbColumns(theNbColumns);
478   }
479   else SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SetNbColumns(theNbColumns);
480 }
481
482 std::vector<int> SALOMEDS_AttributeTableOfInteger::SortRow(int theRow, SortOrder theOrder, SortPolicy thePolicy)
483 {
484   std::vector<int> aVector;
485   int aLength, i;
486   if (_isLocal) {
487     SALOMEDS::Locker lock;
488     try {
489       aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SortRow(theRow, 
490                                                                                           (SALOMEDSImpl_AttributeTable::SortOrder)theOrder, 
491                                                                                           (SALOMEDSImpl_AttributeTable::SortPolicy)thePolicy);
492     }   
493     catch(...) {
494       throw SALOMEDS::AttributeTable::IncorrectIndex();
495     }
496   }
497   else {
498     SALOMEDS::LongSeq_var aSet =
499       SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SortRow(theRow, 
500                                                                        (SALOMEDS::AttributeTable::SortOrder)theOrder, 
501                                                                        (SALOMEDS::AttributeTable::SortPolicy)thePolicy);
502     aLength = aSet->length();  
503     for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
504   }
505   return aVector;
506 }
507
508 std::vector<int> SALOMEDS_AttributeTableOfInteger::SortColumn(int theColumn, SortOrder theOrder, SortPolicy thePolicy)
509 {
510   std::vector<int> aVector;
511   int aLength, i;
512   if (_isLocal) {
513     SALOMEDS::Locker lock;
514     try {
515       aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SortColumn(theColumn, 
516                                                                                              (SALOMEDSImpl_AttributeTable::SortOrder)theOrder, 
517                                                                                              (SALOMEDSImpl_AttributeTable::SortPolicy)thePolicy);
518     }   
519     catch(...) {
520       throw SALOMEDS::AttributeTable::IncorrectIndex();
521     }
522   }
523   else {
524     SALOMEDS::LongSeq_var aSet =
525       SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SortColumn(theColumn, 
526                                                                           (SALOMEDS::AttributeTable::SortOrder)theOrder, 
527                                                                           (SALOMEDS::AttributeTable::SortPolicy)thePolicy);
528     aLength = aSet->length();  
529     for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
530   }
531   return aVector;
532 }
533
534 std::vector<int> SALOMEDS_AttributeTableOfInteger::SortByRow(int theRow, SortOrder theOrder, SortPolicy thePolicy)
535 {
536   std::vector<int> aVector;
537   int aLength, i;
538   if (_isLocal) {
539     SALOMEDS::Locker lock;
540     try {
541       aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SortByRow(theRow, 
542                                                                                             (SALOMEDSImpl_AttributeTable::SortOrder)theOrder, 
543                                                                                             (SALOMEDSImpl_AttributeTable::SortPolicy)thePolicy);
544     }   
545     catch(...) {
546       throw SALOMEDS::AttributeTable::IncorrectIndex();
547     }
548   }
549   else {
550     SALOMEDS::LongSeq_var aSet =
551       SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SortByRow(theRow, 
552                                                                          (SALOMEDS::AttributeTable::SortOrder)theOrder, 
553                                                                          (SALOMEDS::AttributeTable::SortPolicy)thePolicy);
554     aLength = aSet->length();  
555     for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
556   }
557   return aVector;
558 }
559
560 std::vector<int> SALOMEDS_AttributeTableOfInteger::SortByColumn(int theColumn, SortOrder theOrder, SortPolicy thePolicy)
561 {
562   std::vector<int> aVector;
563   int aLength, i;
564   if (_isLocal) {
565     SALOMEDS::Locker lock;
566     try {
567       aVector = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SortByColumn(theColumn, 
568                                                                                                (SALOMEDSImpl_AttributeTable::SortOrder)theOrder, 
569                                                                                                (SALOMEDSImpl_AttributeTable::SortPolicy)thePolicy);
570     }   
571     catch(...) {
572       throw SALOMEDS::AttributeTable::IncorrectIndex();
573     }
574   }
575   else {
576     SALOMEDS::LongSeq_var aSet =
577       SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SortByColumn(theColumn, 
578                                                                             (SALOMEDS::AttributeTable::SortOrder)theOrder, 
579                                                                             (SALOMEDS::AttributeTable::SortPolicy)thePolicy);
580     aLength = aSet->length();  
581     for (i = 0; i < aLength; i++) aVector.push_back(aSet[i]);
582   }
583   return aVector;
584 }
585
586 void SALOMEDS_AttributeTableOfInteger::SwapCells(int theRow1, int theColumn1, int theRow2, int theColumn2)
587 {
588   if (_isLocal) {
589     SALOMEDS::Locker lock;
590     try {
591       dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SwapCells(theRow1, theColumn1, theRow2, theColumn2);
592     }   
593     catch(...) {
594       throw SALOMEDS::AttributeTable::IncorrectIndex();
595     }
596   }
597   else {
598     SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SwapCells(theRow1, theColumn1, theRow2, theColumn2);
599   }
600 }
601
602 void SALOMEDS_AttributeTableOfInteger::SwapRows(int theRow1, int theRow2)
603 {
604   if (_isLocal) {
605     SALOMEDS::Locker lock;
606     try {
607       dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SwapRows(theRow1, theRow2);
608     }   
609     catch(...) {
610       throw SALOMEDS::AttributeTable::IncorrectIndex();
611     }
612   }
613   else {
614     SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SwapRows(theRow1, theRow2);
615   }
616 }
617
618 void SALOMEDS_AttributeTableOfInteger::SwapColumns(int theColumn1, int theColumn2)
619 {
620   if (_isLocal) {
621     SALOMEDS::Locker lock;
622     try {
623       dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_local_impl)->SwapColumns(theColumn1, theColumn2);
624     }   
625     catch(...) {
626       throw SALOMEDS::AttributeTable::IncorrectIndex();
627     }
628   }
629   else {
630     SALOMEDS::AttributeTableOfInteger::_narrow(_corba_impl)->SwapColumns(theColumn1, theColumn2);
631   }
632 }