1 // File : SALOMEDS_ChildIterator.cxx
2 // Author : Sergey RUIN
7 #include "SALOMEDS_ChildIterator.hxx"
8 #include "SALOMEDS_SObject.hxx"
12 SALOMEDS_ChildIterator::SALOMEDS_ChildIterator(const Handle(SALOMEDSImpl_ChildIterator)& theIterator)
15 _local_impl = theIterator;
16 _corba_impl = SALOMEDS::ChildIterator::_nil();
19 SALOMEDS_ChildIterator::SALOMEDS_ChildIterator(SALOMEDS::ChildIterator_ptr theIterator)
23 _corba_impl = SALOMEDS::ChildIterator::_duplicate(theIterator);
26 SALOMEDS_ChildIterator::~SALOMEDS_ChildIterator()
28 if(!_isLocal) _corba_impl->Destroy();
31 void SALOMEDS_ChildIterator::Init()
33 if(_isLocal) _local_impl->Init();
34 else _corba_impl->Init();
37 void SALOMEDS_ChildIterator::InitEx(bool theAllLevels)
39 if(_isLocal) _local_impl->InitEx(theAllLevels);
40 else _corba_impl->InitEx(theAllLevels);
43 bool SALOMEDS_ChildIterator::More()
46 if(_isLocal) ret = _local_impl->More();
47 else ret = _corba_impl->More();
51 void SALOMEDS_ChildIterator::Next()
53 if(_isLocal) _local_impl->Next();
54 else _corba_impl->Next();
57 _PTR(SObject) SALOMEDS_ChildIterator::Value()
59 SALOMEDSClient_SObject* aSO;
60 if(_isLocal) aSO = new SALOMEDS_SObject(_local_impl->Value());
61 else aSO = new SALOMEDS_SObject(_corba_impl->Value());
62 return _PTR(SObject)(aSO);