1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/
20 // File : SALOMEDS_AttributeSequenceOfInteger_i.cxx
21 // Author : Sergey RUIN
25 #include "SALOMEDS_AttributeSequenceOfInteger_i.hxx"
26 #include "SALOMEDS.hxx"
27 #include <TColStd_HSequenceOfInteger.hxx>
32 void SALOMEDS_AttributeSequenceOfInteger_i::Assign(const SALOMEDS::LongSeq& other)
34 SALOMEDS::Locker lock;
36 Handle(TColStd_HSequenceOfInteger) CasCadeSeq = new TColStd_HSequenceOfInteger;
37 for (int i = 0; i < other.length(); i++) {
38 CasCadeSeq->Append(other[i]);
40 Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_impl)->Assign(CasCadeSeq);
43 SALOMEDS::LongSeq* SALOMEDS_AttributeSequenceOfInteger_i::CorbaSequence()
45 SALOMEDS::Locker lock;
46 SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
47 Handle(SALOMEDSImpl_AttributeSequenceOfInteger) CasCadeSeq;
48 CasCadeSeq = Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_impl);
49 CorbaSeq->length(CasCadeSeq->Length());
50 for (int i = 0; i < CasCadeSeq->Length(); i++) {
51 CorbaSeq[i] = CasCadeSeq->Value(i+1);;
53 return CorbaSeq._retn();
56 void SALOMEDS_AttributeSequenceOfInteger_i::Add(CORBA::Long value)
58 SALOMEDS::Locker lock;
60 Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_impl)->Add(value);
63 void SALOMEDS_AttributeSequenceOfInteger_i::Remove(CORBA::Long index)
65 SALOMEDS::Locker lock;
67 Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_impl)->Remove(index);
70 void SALOMEDS_AttributeSequenceOfInteger_i::ChangeValue(CORBA::Long index, CORBA::Long value)
72 SALOMEDS::Locker lock;
74 Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_impl)->ChangeValue(index, value);
77 CORBA::Long SALOMEDS_AttributeSequenceOfInteger_i::Value(CORBA::Short index)
79 SALOMEDS::Locker lock;
80 return Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_impl)->Value(index);
83 CORBA::Long SALOMEDS_AttributeSequenceOfInteger_i::Length()
85 SALOMEDS::Locker lock;
86 return Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_impl)->Length();