Salome HOME
Removed references to OCC
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_AttributeSequenceOfInteger_i.cxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
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.
8 // 
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.
13 //
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
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 //  File   : SALOMEDS_AttributeSequenceOfInteger_i.cxx
21 //  Author : Sergey RUIN
22 //  Module : SALOME
23
24
25 #include "SALOMEDS_AttributeSequenceOfInteger_i.hxx"
26 #include "SALOMEDS.hxx"
27 #include <TColStd_HSequenceOfInteger.hxx>
28
29 using namespace std;
30
31
32 void SALOMEDS_AttributeSequenceOfInteger_i::Assign(const SALOMEDS::LongSeq& other) 
33 {
34   SALOMEDS::Locker lock;
35   CheckLocked();
36   Handle(TColStd_HSequenceOfInteger) CasCadeSeq = new TColStd_HSequenceOfInteger;
37   for (int i = 0; i < other.length(); i++) {
38     CasCadeSeq->Append(other[i]);
39   }
40   Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_impl)->Assign(CasCadeSeq);
41 }
42  
43 SALOMEDS::LongSeq* SALOMEDS_AttributeSequenceOfInteger_i::CorbaSequence()
44 {
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);;
52   }
53   return CorbaSeq._retn();
54 }
55  
56 void SALOMEDS_AttributeSequenceOfInteger_i::Add(CORBA::Long value) 
57 {
58   SALOMEDS::Locker lock;
59   CheckLocked();
60   Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_impl)->Add(value);
61 }
62
63 void SALOMEDS_AttributeSequenceOfInteger_i::Remove(CORBA::Long index) 
64 {
65   SALOMEDS::Locker lock;
66   CheckLocked();
67   Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_impl)->Remove(index);
68 }
69  
70 void SALOMEDS_AttributeSequenceOfInteger_i::ChangeValue(CORBA::Long index, CORBA::Long value)
71 {
72   SALOMEDS::Locker lock;
73   CheckLocked();
74   Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_impl)->ChangeValue(index, value);
75 }
76  
77 CORBA::Long SALOMEDS_AttributeSequenceOfInteger_i::Value(CORBA::Short index) 
78 {
79   SALOMEDS::Locker lock;
80   return Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_impl)->Value(index);
81 }
82
83 CORBA::Long SALOMEDS_AttributeSequenceOfInteger_i::Length() 
84 {  
85   SALOMEDS::Locker lock;
86   return Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_impl)->Length();
87 }
88