2 // File : SALOMEDS_AttributeSequenceOfInteger_i.cxx
3 // Created : Fri Jul 05 18:09:47 2002
4 // Author : Yves FRICAUD
8 // Copyright : Open CASCADE 2002
12 #include "SALOMEDS_AttributeSequenceOfInteger_i.hxx"
13 #include "SALOMEDS_SObject_i.hxx"
14 #include <TColStd_HSequenceOfInteger.hxx>
17 void SALOMEDS_AttributeSequenceOfInteger_i::Assign(const SALOMEDS::LongSeq& other)
20 Handle(TColStd_HSequenceOfInteger) CasCadeSeq = new TColStd_HSequenceOfInteger;
21 for (int i = 0; i < other.length(); i++) {
22 CasCadeSeq->Append(other[i]);
24 Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->Assign(CasCadeSeq);
27 SALOMEDS::LongSeq* SALOMEDS_AttributeSequenceOfInteger_i::CorbaSequence()
29 SALOMEDS::LongSeq_var CorbaSeq = new SALOMEDS::LongSeq;
30 Handle(SALOMEDS_SequenceOfIntegerAttribute) CasCadeSeq = Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr);
31 CorbaSeq->length(CasCadeSeq->Length());
32 for (int i = 0; i < CasCadeSeq->Length(); i++) {
33 CorbaSeq[i] = CasCadeSeq->Value(i+1);;
35 return CorbaSeq._retn();
38 void SALOMEDS_AttributeSequenceOfInteger_i::Add(CORBA::Long value)
41 Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->Add(value);
44 void SALOMEDS_AttributeSequenceOfInteger_i::Remove(CORBA::Long index)
47 Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->Remove(index);
50 void SALOMEDS_AttributeSequenceOfInteger_i::ChangeValue(CORBA::Long index, CORBA::Long value)
53 Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->ChangeValue(index, value);
56 CORBA::Long SALOMEDS_AttributeSequenceOfInteger_i::Value(CORBA::Short index)
58 return Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->Value(index);
61 CORBA::Long SALOMEDS_AttributeSequenceOfInteger_i::Length()
63 return Handle(SALOMEDS_SequenceOfIntegerAttribute)::DownCast(_myAttr)->Length();