Salome HOME
ENV: Windows porting.
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_AttributeSequenceOfInteger_i.cxx
1 //  File   : SALOMEDS_AttributeSequenceOfInteger_i.cxx
2 //  Author : Sergey RUIN
3 //  Module : SALOME
4
5
6 #include "SALOMEDS_AttributeSequenceOfInteger_i.hxx"
7 #include "SALOMEDS.hxx"
8 #include <TColStd_HSequenceOfInteger.hxx>
9
10 using namespace std;
11
12
13 void SALOMEDS_AttributeSequenceOfInteger_i::Assign(const SALOMEDS::LongSeq& other) 
14 {
15   SALOMEDS::Locker lock;
16   CheckLocked();
17   Handle(TColStd_HSequenceOfInteger) CasCadeSeq = new TColStd_HSequenceOfInteger;
18   for (int i = 0; i < other.length(); i++) {
19     CasCadeSeq->Append(other[i]);
20   }
21   Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_impl)->Assign(CasCadeSeq);
22 }
23  
24 SALOMEDS::LongSeq* SALOMEDS_AttributeSequenceOfInteger_i::CorbaSequence()
25 {
26   SALOMEDS::Locker lock;
27   SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
28   Handle(SALOMEDSImpl_AttributeSequenceOfInteger) CasCadeSeq;
29   CasCadeSeq = Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_impl);
30   CorbaSeq->length(CasCadeSeq->Length());
31   for (int i = 0; i < CasCadeSeq->Length(); i++) {
32     CorbaSeq[i] = CasCadeSeq->Value(i+1);;
33   }
34   return CorbaSeq._retn();
35 }
36  
37 void SALOMEDS_AttributeSequenceOfInteger_i::Add(CORBA::Long value) 
38 {
39   SALOMEDS::Locker lock;
40   CheckLocked();
41   Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_impl)->Add(value);
42 }
43
44 void SALOMEDS_AttributeSequenceOfInteger_i::Remove(CORBA::Long index) 
45 {
46   SALOMEDS::Locker lock;
47   CheckLocked();
48   Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_impl)->Remove(index);
49 }
50  
51 void SALOMEDS_AttributeSequenceOfInteger_i::ChangeValue(CORBA::Long index, CORBA::Long value)
52 {
53   SALOMEDS::Locker lock;
54   CheckLocked();
55   Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_impl)->ChangeValue(index, value);
56 }
57  
58 CORBA::Long SALOMEDS_AttributeSequenceOfInteger_i::Value(CORBA::Short index) 
59 {
60   SALOMEDS::Locker lock;
61   return Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_impl)->Value(index);
62 }
63
64 CORBA::Long SALOMEDS_AttributeSequenceOfInteger_i::Length() 
65 {  
66   SALOMEDS::Locker lock;
67   return Handle(SALOMEDSImpl_AttributeSequenceOfInteger)::DownCast(_impl)->Length();
68 }
69