|
|
|||
File indexing completed on 2026-08-31 09:19:21
0001 // Created on: 1993-02-26 0002 // Created by: Remi LEQUETTE 0003 // Copyright (c) 1993-1999 Matra Datavision 0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS 0005 // 0006 // This file is part of Open CASCADE Technology software library. 0007 // 0008 // This library is free software; you can redistribute it and/or modify it under 0009 // the terms of the GNU Lesser General Public License version 2.1 as published 0010 // by the Free Software Foundation, with special exception defined in the file 0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT 0012 // distribution for complete text of the license and disclaimer of any warranty. 0013 // 0014 // Alternatively, this file may be used under the terms of Open CASCADE 0015 // commercial license or contractual agreement. 0016 0017 #ifndef _TopLoc_SListOfItemLocation_HeaderFile 0018 #define _TopLoc_SListOfItemLocation_HeaderFile 0019 0020 #include <Standard.hxx> 0021 #include <Standard_DefineAlloc.hxx> 0022 #include <Standard_Handle.hxx> 0023 0024 #include <Standard_Macro.hxx> 0025 class TopLoc_SListNodeOfItemLocation; 0026 class TopLoc_ItemLocation; 0027 0028 //! An SListOfItemLocation is a LISP like list of Items. 0029 //! An SListOfItemLocation is : 0030 //! . Empty. 0031 //! . Or it has a Value and a Tail which is an other SListOfItemLocation. 0032 //! 0033 //! The Tail of an empty list is an empty list. 0034 //! SListOfItemLocation are shared. It means that they can be 0035 //! modified through other lists. 0036 //! SListOfItemLocation may be used as Iterators. They have Next, 0037 //! More, and value methods. To iterate on the content 0038 //! of the list S just do. 0039 //! 0040 //! SListOfItemLocation Iterator; 0041 //! for (Iterator = S; Iterator.More(); Iterator.Next()) 0042 //! X = Iterator.Value(); 0043 class TopLoc_SListOfItemLocation 0044 { 0045 public: 0046 DEFINE_STANDARD_ALLOC 0047 0048 //! Creates an empty List. 0049 TopLoc_SListOfItemLocation() {} 0050 0051 //! Creates a List with <anItem> as value and <aTail> as tail. 0052 Standard_EXPORT TopLoc_SListOfItemLocation(const TopLoc_ItemLocation& anItem, 0053 const TopLoc_SListOfItemLocation& aTail); 0054 0055 //! Creates a list from an other one. The lists are shared. 0056 TopLoc_SListOfItemLocation(const TopLoc_SListOfItemLocation& Other) 0057 : myNode(Other.myNode) 0058 { 0059 } 0060 0061 //! Sets a list from an other one. The lists are 0062 //! shared. The list itself is returned. 0063 Standard_EXPORT TopLoc_SListOfItemLocation& Assign(const TopLoc_SListOfItemLocation& Other); 0064 0065 //! Assignment 0066 TopLoc_SListOfItemLocation& operator=(const TopLoc_SListOfItemLocation& Other) 0067 { 0068 return Assign(Other); 0069 } 0070 0071 //! Move constructor 0072 TopLoc_SListOfItemLocation(TopLoc_SListOfItemLocation&& theOther) Standard_Noexcept 0073 : myNode(std::move(theOther.myNode)) 0074 { 0075 } 0076 0077 //! Move operator 0078 TopLoc_SListOfItemLocation& operator=(TopLoc_SListOfItemLocation&& theOther) Standard_Noexcept 0079 { 0080 myNode = std::move(theOther.myNode); 0081 return *this; 0082 } 0083 0084 //! Return true if this list is empty 0085 Standard_Boolean IsEmpty() const { return myNode.IsNull(); } 0086 0087 //! Sets the list to be empty. 0088 void Clear() { myNode.Nullify(); } 0089 0090 //! Destructor 0091 ~TopLoc_SListOfItemLocation() { Clear(); } 0092 0093 //! Returns the current value of the list. An error is 0094 //! raised if the list is empty. 0095 Standard_EXPORT const TopLoc_ItemLocation& Value() const; 0096 0097 //! Returns the current tail of the list. On an empty 0098 //! list the tail is the list itself. 0099 Standard_EXPORT const TopLoc_SListOfItemLocation& Tail() const; 0100 0101 //! Replaces the list by a list with <anItem> as Value 0102 //! and the list <me> as tail. 0103 void Construct(const TopLoc_ItemLocation& anItem) 0104 { 0105 Assign(TopLoc_SListOfItemLocation(anItem, *this)); 0106 } 0107 0108 //! Replaces the list <me> by its tail. 0109 void ToTail() { Assign(Tail()); } 0110 0111 //! Returns True if the iterator has a current value. 0112 //! This is !IsEmpty() 0113 Standard_Boolean More() const { return !IsEmpty(); } 0114 0115 //! Moves the iterator to the next object in the list. 0116 //! If the iterator is empty it will stay empty. This is ToTail() 0117 void Next() { ToTail(); } 0118 0119 private: 0120 Handle(TopLoc_SListNodeOfItemLocation) myNode; 0121 }; 0122 0123 #endif // _TopLoc_SListOfItemLocation_HeaderFile
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|