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_ChildIterator.cxx
21 // Author : Sergey RUIN
26 #include "SALOMEDS_ChildIterator.hxx"
27 #include "SALOMEDS_SObject.hxx"
31 SALOMEDS_ChildIterator::SALOMEDS_ChildIterator(const Handle(SALOMEDSImpl_ChildIterator)& theIterator)
34 _local_impl = theIterator;
35 _corba_impl = SALOMEDS::ChildIterator::_nil();
38 SALOMEDS_ChildIterator::SALOMEDS_ChildIterator(SALOMEDS::ChildIterator_ptr theIterator)
42 _corba_impl = SALOMEDS::ChildIterator::_duplicate(theIterator);
45 SALOMEDS_ChildIterator::~SALOMEDS_ChildIterator()
47 if(!_isLocal) _corba_impl->Destroy();
50 void SALOMEDS_ChildIterator::Init()
52 if(_isLocal) _local_impl->Init();
53 else _corba_impl->Init();
56 void SALOMEDS_ChildIterator::InitEx(bool theAllLevels)
58 if(_isLocal) _local_impl->InitEx(theAllLevels);
59 else _corba_impl->InitEx(theAllLevels);
62 bool SALOMEDS_ChildIterator::More()
65 if(_isLocal) ret = _local_impl->More();
66 else ret = _corba_impl->More();
70 void SALOMEDS_ChildIterator::Next()
72 if(_isLocal) _local_impl->Next();
73 else _corba_impl->Next();
76 _PTR(SObject) SALOMEDS_ChildIterator::Value()
78 SALOMEDSClient_SObject* aSO;
79 if(_isLocal) aSO = new SALOMEDS_SObject(_local_impl->Value());
80 else aSO = new SALOMEDS_SObject(_corba_impl->Value());
81 return _PTR(SObject)(aSO);