Salome HOME
0020523: String notebook support
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_AttributeTableOfInteger_i.cxx
index 0c97e62467f8349f2fe9d4eb9e57e833a36ce2ef..01a3f03bd2da6143d639dc0cff04edf21ffd5b71 100644 (file)
@@ -1,19 +1,37 @@
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
+//
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
+//
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 //  File   : SALOMEDS_AttributeTableOfInteger_i.cxx
 //  Author : Sergey RUIN
 //  Module : SALOME
-
-
+//
 #include "SALOMEDS_AttributeTableOfInteger_i.hxx"
 #include "SALOMEDS.hxx"
 
-#include <TColStd_HSequenceOfInteger.hxx>
-#include <Standard_Failure.hxx>
-#include <Standard_ErrorHandler.hxx>
 #include "Utils_ExceptHandlers.hxx"
 
 #include <stdexcept>
-#include <strstream>
+#include <sstream>
 #include <string>
+#include <vector>
 
 using namespace std;
 
@@ -25,14 +43,14 @@ void SALOMEDS_AttributeTableOfInteger_i::SetTitle(const char* theTitle)
   SALOMEDS::Locker lock;
   CheckLocked();
   CORBA::String_var aStr = CORBA::string_dup(theTitle);
-  Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl)->SetTitle(TCollection_ExtendedString(aStr));
+  dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl)->SetTitle(string(aStr));
 }
 
 char* SALOMEDS_AttributeTableOfInteger_i::GetTitle() 
 {
   SALOMEDS::Locker lock;
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
-  CORBA::String_var c_s = CORBA::string_dup(TCollection_AsciiString(aTable->GetTitle()).ToCString());
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
+  CORBA::String_var c_s = CORBA::string_dup(aTable->GetTitle().c_str());
   return c_s._retn();
 }
 
@@ -42,9 +60,9 @@ void SALOMEDS_AttributeTableOfInteger_i::SetRowTitle(CORBA::Long theIndex, const
   SALOMEDS::Locker lock;
   Unexpect aCatch (ATI_IncorrectIndex);
   CheckLocked();
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
   if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
-  aTable->SetRowTitle(theIndex, TCollection_ExtendedString((char*)theTitle));
+  aTable->SetRowTitle(theIndex, string(theTitle));
 }
 
 void SALOMEDS_AttributeTableOfInteger_i::SetRowTitles(const SALOMEDS::StringSeq& theTitles)
@@ -53,7 +71,7 @@ void SALOMEDS_AttributeTableOfInteger_i::SetRowTitles(const SALOMEDS::StringSeq&
   SALOMEDS::Locker lock;
   Unexpect aCatch (ATI_IncorrectArgumentLength);
   CheckLocked();
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
   if (theTitles.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
   for (int i = 0; i < theTitles.length(); i++) {
     SetRowTitle(i + 1, theTitles[i]);
@@ -63,11 +81,11 @@ void SALOMEDS_AttributeTableOfInteger_i::SetRowTitles(const SALOMEDS::StringSeq&
 SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowTitles() 
 {
   SALOMEDS::Locker lock;
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
   SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq;
   aTitles->length(aTable->GetNbRows());
   for(int i = 0; i < aTitles->length(); i++)
-    aTitles[i] = CORBA::string_dup(TCollection_AsciiString(aTable->GetRowTitle(i + 1)).ToCString());
+    aTitles[i] = CORBA::string_dup(aTable->GetRowTitle(i + 1).c_str());
   return aTitles._retn();
 }
 
@@ -77,10 +95,10 @@ void SALOMEDS_AttributeTableOfInteger_i::SetColumnTitle(CORBA::Long theIndex, co
   SALOMEDS::Locker lock;
   Unexpect aCatch (ATI_IncorrectIndex);
   CheckLocked();
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
   if (theIndex <= 0 || theIndex > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
   CORBA::String_var aStr = CORBA::string_dup(theTitle);
-  aTable->SetColumnTitle(theIndex, TCollection_ExtendedString(aStr));
+  aTable->SetColumnTitle(theIndex, string(aStr));
 }
 
 void SALOMEDS_AttributeTableOfInteger_i::SetColumnTitles(const SALOMEDS::StringSeq& theTitles)
@@ -89,7 +107,7 @@ void SALOMEDS_AttributeTableOfInteger_i::SetColumnTitles(const SALOMEDS::StringS
   SALOMEDS::Locker lock;
   Unexpect aCatch(ATI_IncorrectArgumentLength);
   CheckLocked();
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
   if (theTitles.length() != aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
   for (int i = 0; i < theTitles.length(); i++) {
     aTable->SetColumnTitle(i + 1, (char*)theTitles[i].in());
@@ -99,11 +117,11 @@ void SALOMEDS_AttributeTableOfInteger_i::SetColumnTitles(const SALOMEDS::StringS
 SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfInteger_i::GetColumnTitles() 
 {
   SALOMEDS::Locker lock;
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
   SALOMEDS::StringSeq_var aTitles = new SALOMEDS::StringSeq;
   aTitles->length(aTable->GetNbColumns());
   for(int i = 0; i < aTitles->length(); i++)
-    aTitles[i] = CORBA::string_dup(TCollection_AsciiString(aTable->GetColumnTitle(i + 1)).ToCString());
+    aTitles[i] = CORBA::string_dup(aTable->GetColumnTitle(i + 1).c_str());
   return aTitles._retn();
 }
 
@@ -114,9 +132,9 @@ void SALOMEDS_AttributeTableOfInteger_i::SetRowUnit(CORBA::Long theIndex, const
   SALOMEDS::Locker lock;
   Unexpect aCatch (ATI_IncorrectIndex);
   CheckLocked();
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
   if (theIndex <= 0 || theIndex > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
-  aTable->SetRowUnit(theIndex, TCollection_ExtendedString((char*)theUnit));
+  aTable->SetRowUnit(theIndex, string(theUnit));
 }
 
 void SALOMEDS_AttributeTableOfInteger_i::SetRowUnits(const SALOMEDS::StringSeq& theUnits)
@@ -125,7 +143,7 @@ void SALOMEDS_AttributeTableOfInteger_i::SetRowUnits(const SALOMEDS::StringSeq&
   SALOMEDS::Locker lock;
   Unexpect aCatch (ATI_IncorrectArgumentLength);
   CheckLocked();
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
   if (theUnits.length() != aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
   for (int i = 0; i < theUnits.length(); i++) {
     aTable->SetRowUnit(i + 1, (char*)theUnits[i].in());
@@ -135,24 +153,24 @@ void SALOMEDS_AttributeTableOfInteger_i::SetRowUnits(const SALOMEDS::StringSeq&
 SALOMEDS::StringSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowUnits() 
 {
   SALOMEDS::Locker lock;
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
   SALOMEDS::StringSeq_var aUnits = new SALOMEDS::StringSeq;
   aUnits->length(aTable->GetNbRows());
   for(int i = 0; i < aUnits->length(); i++)
-    aUnits[i] = CORBA::string_dup(TCollection_AsciiString(aTable->GetRowUnit(i + 1)).ToCString());
+    aUnits[i] = CORBA::string_dup(aTable->GetRowUnit(i + 1).c_str());
   return aUnits._retn();
 }
 
 CORBA::Long SALOMEDS_AttributeTableOfInteger_i::GetNbRows() 
 {
   SALOMEDS::Locker lock;
-  return Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl)->GetNbRows();
+  return dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl)->GetNbRows();
 }
 
 CORBA::Long SALOMEDS_AttributeTableOfInteger_i::GetNbColumns() 
 {
   SALOMEDS::Locker lock;
-  return Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl)->GetNbColumns();
+  return dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl)->GetNbColumns();
 }
 
 void SALOMEDS_AttributeTableOfInteger_i::AddRow(const SALOMEDS::LongSeq& theData)
@@ -161,14 +179,14 @@ void SALOMEDS_AttributeTableOfInteger_i::AddRow(const SALOMEDS::LongSeq& theData
   SALOMEDS::Locker lock;
   Unexpect aCatch(ATI_IncorrectArgumentLength);
   CheckLocked();
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
   
-  Handle(TColStd_HSequenceOfInteger) aRow = new TColStd_HSequenceOfInteger;
-  for (int i = 0; i < theData.length(); i++) aRow->Append(theData[i]);
+  vector<int> aRow;
+  for (int i = 0; i < theData.length(); i++) aRow.push_back(theData[i]);
   try {
     aTable->SetRowData(aTable->GetNbRows() + 1, aRow);
   }
-  catch(Standard_Failure) {
+  catch(...) {
     throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
   }
 }
@@ -179,14 +197,14 @@ void SALOMEDS_AttributeTableOfInteger_i::SetRow(CORBA::Long theRow, const SALOME
   SALOMEDS::Locker lock;
   Unexpect aCatch(ATI_IncorrectArgumentLength);
   CheckLocked();
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
   
-  Handle(TColStd_HSequenceOfInteger) aRow = new TColStd_HSequenceOfInteger;
-  for (int i = 0; i < theData.length(); i++) aRow->Append(theData[i]);
+  vector<int> aRow;
+  for (int i = 0; i < theData.length(); i++) aRow.push_back(theData[i]);
   try {
     aTable->SetRowData(theRow, aRow);
   }
-  catch(Standard_Failure) {
+  catch(...) {
     throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
   }  
 }
@@ -196,14 +214,14 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetRow(CORBA::Long theRow
 {
   SALOMEDS::Locker lock;
   Unexpect aCatch(ATI_IncorrectIndex);
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
   if (theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
 
   SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
-  Handle(TColStd_HSequenceOfInteger) aRow = aTable->GetRowData(theRow);
-  CorbaSeq->length(aRow->Length());
-  for (int i = 0; i < aRow->Length(); i++) {
-    CorbaSeq[i] = aRow->Value(i + 1);
+  vector<int> aRow = aTable->GetRowData(theRow);
+  CorbaSeq->length(aRow.size());
+  for (int i = 0; i < aRow.size(); i++) {
+    CorbaSeq[i] = aRow[i];
   }
   return CorbaSeq._retn();
 }
@@ -214,14 +232,14 @@ void SALOMEDS_AttributeTableOfInteger_i::AddColumn(const SALOMEDS::LongSeq& theD
   SALOMEDS::Locker lock;
   Unexpect aCatch(ATI_IncorrectArgumentLength);
   CheckLocked();
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
   
-  Handle(TColStd_HSequenceOfInteger) aColumn = new TColStd_HSequenceOfInteger;
-  for (int i = 0; i < theData.length(); i++) aColumn->Append(theData[i]);
+  vector<int> aColumn;
+  for (int i = 0; i < theData.length(); i++) aColumn.push_back(theData[i]);
   try {
     aTable->SetColumnData(aTable->GetNbColumns() + 1, aColumn);
   }
-  catch(Standard_Failure) {
+  catch(...) {
     throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
   }  
 }
@@ -232,14 +250,14 @@ void SALOMEDS_AttributeTableOfInteger_i::SetColumn(CORBA::Long theColumn, const
   SALOMEDS::Locker lock;
   Unexpect aCatch(ATI_IncorrectArgumentLength);
   CheckLocked();
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
-  
-  Handle(TColStd_HSequenceOfInteger) aColumn = new TColStd_HSequenceOfInteger;
-  for (int i = 0; i < theData.length(); i++) aColumn->Append(theData[i]);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
+
+  vector<int> aColumn; 
+  for (int i = 0; i < theData.length(); i++) aColumn.push_back(theData[i]);
   try {
     aTable->SetColumnData(theColumn, aColumn);
   }
-  catch(Standard_Failure) {
+  catch(...) {
     throw SALOMEDS::AttributeTableOfInteger::IncorrectArgumentLength();
   }
 }
@@ -249,14 +267,14 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetColumn(CORBA::Long the
 {
   SALOMEDS::Locker lock;
   Unexpect aCatch(ATI_IncorrectIndex);
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
   if (theColumn <= 0 || theColumn > aTable->GetNbColumns()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
 
   SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
-  Handle(TColStd_HSequenceOfInteger) aColumn = aTable->GetColumnData(theColumn);
-  CorbaSeq->length(aColumn->Length());
-  for (int i = 0; i < aColumn->Length(); i++) {
-    CorbaSeq[i] = aColumn->Value(i + 1);
+  vector<int> aColumn = aTable->GetColumnData(theColumn);
+  CorbaSeq->length(aColumn.size());
+  for (int i = 0; i < aColumn.size(); i++) {
+    CorbaSeq[i] = aColumn[i];
   }
   return CorbaSeq._retn();
 }
@@ -267,12 +285,12 @@ void SALOMEDS_AttributeTableOfInteger_i::PutValue(CORBA::Long theValue, CORBA::L
   SALOMEDS::Locker lock;
   Unexpect aCatch(ATI_IncorrectIndex);
   CheckLocked();
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
 
   try {
     aTable->PutValue(theValue, theRow, theColumn);
   }
-  catch(Standard_Failure) {
+  catch(...) {
     throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
   }
 }
@@ -280,7 +298,7 @@ void SALOMEDS_AttributeTableOfInteger_i::PutValue(CORBA::Long theValue, CORBA::L
 CORBA::Boolean SALOMEDS_AttributeTableOfInteger_i::HasValue(CORBA::Long theRow, CORBA::Long theColumn) 
 {
   SALOMEDS::Locker lock;
-  return Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl)->HasValue(theRow, theColumn);
+  return dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl)->HasValue(theRow, theColumn);
 }
 
 CORBA::Long SALOMEDS_AttributeTableOfInteger_i::GetValue(CORBA::Long theRow, CORBA::Long theColumn)
@@ -288,14 +306,14 @@ CORBA::Long SALOMEDS_AttributeTableOfInteger_i::GetValue(CORBA::Long theRow, COR
 {
   SALOMEDS::Locker lock;
   Unexpect aCatch(ATI_IncorrectIndex);
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
   if (theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
 
   CORBA::Long aValue;
   try {
     aValue = aTable->GetValue(theRow, theColumn);
   }
-  catch(Standard_Failure) {
+  catch(...) {
     throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
   }
   return aValue;
@@ -304,15 +322,15 @@ CORBA::Long SALOMEDS_AttributeTableOfInteger_i::GetValue(CORBA::Long theRow, COR
 SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowSetIndices(CORBA::Long theRow) 
 {
   SALOMEDS::Locker lock;
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
 
   if(theRow <= 0 || theRow > aTable->GetNbRows()) throw SALOMEDS::AttributeTableOfInteger::IncorrectIndex();
 
   SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
-  Handle(TColStd_HSequenceOfInteger) aSeq = aTable->GetSetRowIndices(theRow);
-  CorbaSeq->length(aSeq->Length());
-  for (int i = 0; i < aSeq->Length(); i++) {
-    CorbaSeq[i] = aSeq->Value(i + 1);
+  vector<int> aSeq = aTable->GetSetRowIndices(theRow);
+  CorbaSeq->length(aSeq.size());
+  for (int i = 0; i < aSeq.size(); i++) {
+    CorbaSeq[i] = aSeq[i];
   }
   return CorbaSeq._retn(); 
 }
@@ -321,29 +339,26 @@ SALOMEDS::LongSeq* SALOMEDS_AttributeTableOfInteger_i::GetRowSetIndices(CORBA::L
 void SALOMEDS_AttributeTableOfInteger_i::SetNbColumns(CORBA::Long theNbColumns)
 {
   SALOMEDS::Locker lock;
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
   aTable->SetNbColumns(theNbColumns);
 }
 
 bool SALOMEDS_AttributeTableOfInteger_i::ReadFromFile(const SALOMEDS::TMPFile& theStream) 
 {
   SALOMEDS::Locker lock;
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
 
-  istrstream aStream((char*)&theStream[0], theStream.length());
-  return aTable->RestoreFromString(aStream);
+  string aStream((char*)&theStream[0], theStream.length());
+  aTable->Load(aStream);
+  return true;
 }
 
 SALOMEDS::TMPFile*  SALOMEDS_AttributeTableOfInteger_i::SaveToFile()
 {
   SALOMEDS::Locker lock;
-  Handle(SALOMEDSImpl_AttributeTableOfInteger) aTable = Handle(SALOMEDSImpl_AttributeTableOfInteger)::DownCast(_impl);
-
-  ostrstream ostr;
-  string aString;
-  aTable->ConvertToString(ostr);
+  SALOMEDSImpl_AttributeTableOfInteger* aTable = dynamic_cast<SALOMEDSImpl_AttributeTableOfInteger*>(_impl);
 
-  aString = ostr.rdbuf()->str();
+  string aString = aTable->Save();
 
   char* aBuffer = (char*)CORBA::string_dup(aString.c_str());
   int aBufferSize = strlen((char*)aBuffer);