Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:20

0001 // Created on: 2002-04-23
0002 // Created by: Alexander KARTOMIN
0003 // Copyright (c) 2002-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef NCollection_TListIterator_HeaderFile
0017 #define NCollection_TListIterator_HeaderFile
0018 
0019 #include <NCollection_BaseList.hxx>
0020 #include <NCollection_TListNode.hxx>
0021 
0022 /**
0023  * Purpose:     This Iterator class iterates on BaseList of TListNode and is 
0024  *              instantiated in List/Set/Queue/Stack
0025  * Remark:      TListIterator is internal class
0026  */
0027 template <class TheItemType> class NCollection_TListIterator 
0028   : public NCollection_BaseList::Iterator
0029 {
0030  public:
0031   //! Empty constructor - for later Init
0032   NCollection_TListIterator  (void) :
0033     NCollection_BaseList::Iterator () {}
0034   //! Constructor with initialisation
0035   NCollection_TListIterator  (const NCollection_BaseList& theList) :
0036     NCollection_BaseList::Iterator (theList) {}
0037   //! Check end
0038   Standard_Boolean More (void) const
0039   { return (myCurrent!=NULL); }
0040   //! Make step
0041   void Next (void)
0042   {
0043     myPrevious = myCurrent;
0044     myCurrent = myCurrent->Next();
0045   }
0046 
0047   //! Constant Value access
0048   const TheItemType& Value (void) const
0049   { return ((const NCollection_TListNode<TheItemType>*) myCurrent)->Value(); }
0050 
0051   //! Non-const Value access
0052   TheItemType& Value (void)
0053   { return ((NCollection_TListNode<TheItemType>*) myCurrent)->ChangeValue(); }
0054 
0055   //! Non-const Value access
0056   TheItemType& ChangeValue (void) const
0057   { return ((NCollection_TListNode<TheItemType> *)myCurrent)->ChangeValue(); }
0058 };
0059 
0060 #endif