1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-08 18:40:55 +03:00

0024742: Remove rarely used collection classes: Stack

Generic class TCollection_Stack removed (along with TCollection_StackIterator and TCollection_StackNode).

Code using TCollection_Stack changed to equivalent use of TCollection_List (replacing Push -> Prepend, Top -> First, Pop -> RemoveFirst).
This commit is contained in:
dln 2014-04-08 14:22:56 +04:00 committed by abv
parent bd2de3965e
commit 6af4fe1c46
41 changed files with 73 additions and 986 deletions

@ -21,7 +21,7 @@ uses
StackOfDocument from CDM,
MapOfDocument from CDM,
MapIteratorOfMapOfDocument from CDM,
StackIteratorOfStackOfDocument from CDM,
ListIteratorOfStackOfDocument from CDM,
MetaData from CDM,
ExtendedString from TCollection,
StoreStatus from PCDM

@ -46,7 +46,7 @@ CDF_StoreList::CDF_StoreList(const Handle(CDM_Document)& aDocument) {
void CDF_StoreList::Add(const Handle(CDM_Document)& aDocument) {
if(!myItems.Contains(aDocument) && aDocument != myMainDocument) myItems.Add(aDocument);
myStack.Push(aDocument);
myStack.Prepend(aDocument);
CDM_ReferenceIterator it(aDocument);
for (;it.More();it.Next()) {
@ -83,9 +83,9 @@ PCDM_StoreStatus CDF_StoreList::Store (Handle(CDM_MetaData)& aMetaData, TCollect
{
try {
OCC_CATCH_SIGNALS
for (; !myStack.IsEmpty(); myStack.Pop()) {
for (; !myStack.IsEmpty(); myStack.RemoveFirst()) {
Handle(CDM_Document) theDocument = myStack.Top();
Handle(CDM_Document) theDocument = myStack.First();
if( theDocument == myMainDocument || theDocument->IsModified()) {
if(!PCDM::FindStorageDriver(theDocument)){

@ -64,6 +64,6 @@ is
class DocumentHasher instantiates MapHasher from TCollection(Document from CDM);
class MapOfDocument instantiates Map from TCollection(Document from CDM, DocumentHasher from CDM);
class ListOfDocument instantiates List from TCollection(Document from CDM);
class StackOfDocument instantiates Stack from TCollection(Document from CDM);
class StackOfDocument instantiates List from TCollection(Document from CDM);
end CDM;

@ -49,7 +49,7 @@ is
---Purpose: Encapsulates a Transaction from TDF.
class TransactionStack
instantiates Stack from TCollection (Transaction from DDF);
instantiates List from TCollection (Transaction from DDF);
-- ----------------------------------------------------------------------
-- Package methods

@ -58,7 +58,7 @@ static Standard_Integer OpenTran (Draw_Interpretor& di,
if (DDF::GetDF (a[1], DF)) {
Handle(DDF_Transaction) tr = new DDF_Transaction(DF);
di<<"Open transaction # "<<tr->Open()<<" # "<<DF->Transaction()<<"\n";
DDF_TStack.Push(tr);
DDF_TStack.Prepend(tr);
}
return 0;
}
@ -78,10 +78,10 @@ static Standard_Integer AbortTran (Draw_Interpretor& di,
Handle(TDF_Data) DF;
if (DDF::GetDF (a[1], DF)) {
if (DF->Transaction () > 0) {
Handle(DDF_Transaction) tr = DDF_TStack.Top();
Handle(DDF_Transaction) tr = DDF_TStack.First();
di<<"Abort transaction # "<<tr->Transaction()<<" # "<<DF->Transaction()<<"\n";
tr->Abort();
DDF_TStack.Pop();
DDF_TStack.RemoveFirst();
}
else {
di<<"DDF_BasicCommands::AbortTran - No more transaction to abort"<<"\n";
@ -105,12 +105,12 @@ static Standard_Integer CommitTran (Draw_Interpretor& di,
Handle(TDF_Data) DF;
if (DDF::GetDF (a[1], DF)) {
if (DF->Transaction () > 0) {
Handle(DDF_Transaction) tr = DDF_TStack.Top();
Handle(DDF_Transaction) tr = DDF_TStack.First();
di<<"Commit transaction # "<<tr->Transaction()<<" # "<<DF->Transaction()<<"\n";
Standard_Boolean withDelta = Standard_False;
if (n > 2) withDelta = (Draw::Atoi(a[2]) != 0);
DDF_LastDelta = tr->Commit(withDelta);
DDF_TStack.Pop();
DDF_TStack.RemoveFirst();
}
else {
di<<"DDF_BasicCommands::CommitTran - No more transaction to commit"<<"\n";
@ -135,8 +135,8 @@ static Standard_Integer CurrentTran (Draw_Interpretor& di,
if (DDF::GetDF (a[1], DF)) {
di<<"# "<<DF->Transaction()<<"\n";
if (!DDF_TStack.IsEmpty())
if (DF->Transaction() != DDF_TStack.Top()->Transaction())
di<<"Transaction object said # "<<DDF_TStack.Top()->Transaction()<<"\n";
if (DF->Transaction() != DDF_TStack.First()->Transaction())
di<<"Transaction object said # "<<DDF_TStack.First()->Transaction()<<"\n";
}
return 0;

@ -43,17 +43,17 @@ is
exception SyntaxError inherits Failure from Standard;
private class StackOfGeneralExpression instantiates
Stack from TCollection (GeneralExpression from Expr);
List from TCollection (GeneralExpression from Expr);
private class StackOfGeneralRelation instantiates
Stack from TCollection (GeneralRelation from Expr);
List from TCollection (GeneralRelation from Expr);
private class StackOfGeneralFunction instantiates
Stack from TCollection (GeneralFunction from Expr);
List from TCollection (GeneralFunction from Expr);
private class StackOfNames instantiates
Stack from TCollection (AsciiString from TCollection);
List from TCollection (AsciiString from TCollection);
Parse(gen : Generator; str : AsciiString from TCollection)
returns Boolean

@ -25,7 +25,7 @@ uses Generator from ExprIntrp,
StackOfGeneralExpression from ExprIntrp,
StackOfGeneralRelation from ExprIntrp,
StackOfGeneralFunction from ExprIntrp,
StackOfInteger from TColStd,
ListOfInteger from TColStd,
SequenceOfGeneralExpression from Expr,
SequenceOfNamedFunction from ExprIntrp,
SequenceOfNamedExpression from ExprIntrp,
@ -108,7 +108,7 @@ fields
myGRStack : StackOfGeneralRelation;
myGFStack : StackOfGeneralFunction;
myNameStack : StackOfNames;
myValueStack : StackOfInteger;
myValueStack : ListOfInteger;
myFunctions : SequenceOfNamedFunction;
myNamed : SequenceOfNamedExpression;
myMaster : Generator;

@ -24,35 +24,35 @@ ExprIntrp_Analysis::ExprIntrp_Analysis() {}
void ExprIntrp_Analysis::Push(const Handle(Expr_GeneralExpression)& exp)
{
myGEStack.Push(exp);
myGEStack.Prepend(exp);
}
void ExprIntrp_Analysis::PushRelation(const Handle(Expr_GeneralRelation)& rel)
{
myGRStack.Push(rel);
myGRStack.Prepend(rel);
}
void ExprIntrp_Analysis::PushFunction(const Handle(Expr_GeneralFunction)& func)
{
myGFStack.Push(func);
myGFStack.Prepend(func);
}
void ExprIntrp_Analysis::PushName(const TCollection_AsciiString& name)
{
myNameStack.Push(name);
myNameStack.Prepend(name);
}
void ExprIntrp_Analysis::PushValue(const Standard_Integer val)
{
myValueStack.Push(val);
myValueStack.Prepend(val);
}
Handle(Expr_GeneralExpression) ExprIntrp_Analysis::Pop()
{
Handle(Expr_GeneralExpression) res;
if (!myGEStack.IsEmpty()) {
res = myGEStack.Top();
myGEStack.Pop();
res = myGEStack.First();
myGEStack.RemoveFirst();
}
return res;
}
@ -61,8 +61,8 @@ Handle(Expr_GeneralRelation) ExprIntrp_Analysis::PopRelation()
{
Handle(Expr_GeneralRelation) res;
if (!myGRStack.IsEmpty()) {
res = myGRStack.Top();
myGRStack.Pop();
res = myGRStack.First();
myGRStack.RemoveFirst();
}
return res;
}
@ -71,8 +71,8 @@ Handle(Expr_GeneralFunction) ExprIntrp_Analysis::PopFunction()
{
Handle(Expr_GeneralFunction) res;
if (!myGFStack.IsEmpty()) {
res = myGFStack.Top();
myGFStack.Pop();
res = myGFStack.First();
myGFStack.RemoveFirst();
}
return res;
}
@ -81,8 +81,8 @@ TCollection_AsciiString ExprIntrp_Analysis::PopName()
{
TCollection_AsciiString res;
if (!myNameStack.IsEmpty()) {
res = myNameStack.Top();
myNameStack.Pop();
res = myNameStack.First();
myNameStack.RemoveFirst();
}
return res;
}
@ -91,8 +91,8 @@ Standard_Integer ExprIntrp_Analysis::PopValue()
{
Standard_Integer res =0;
if (!myValueStack.IsEmpty()) {
res = myValueStack.Top();
myValueStack.Pop();
res = myValueStack.First();
myValueStack.RemoveFirst();
}
return res;
}

@ -16,7 +16,7 @@
#include <Standard_NoMoreObject.hxx>
#include <Standard_NoSuchObject.hxx>
#include <TColStd_StackOfInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
//=======================================================================
//function : GraphTools_DFSIterator
@ -36,18 +36,18 @@ void GraphTools_DFSIterator::Perform
{
Standard_Integer index;
myVisited.Clear();
TColStd_StackOfInteger myReady;
TColStd_ListOfInteger myReady;
index = myVisited.Add(V);
myReady.Push(index);
myReady.Prepend(index);
while (!myReady.IsEmpty()) {
Vertex w1 = myVisited (myReady.Top());
myReady.Pop();
Vertex w1 = myVisited (myReady.First());
myReady.RemoveFirst();
for (VIterator it(G,w1); it.More(); it.Next()) {
Vertex w2 = it.Value();
if (!myVisited.Contains(w2)) {
index = myVisited.Add(w2);
myReady.Push(index);
myReady.Prepend(index);
}
}
}

@ -69,7 +69,7 @@ generic class ReducedGraph from GraphTools
uses SC from GraphTools,
SCList from GraphTools,
ListIteratorOfSCList from GraphTools,
StackOfInteger from TColStd
ListOfInteger from TColStd
raises NoSuchObject from Standard,
NoMoreObject from Standard,
@ -233,7 +233,7 @@ fields
-- algorithm
performed : Boolean from Standard;
myNowIndex : Integer from Standard;
myStack : StackOfInteger from TColStd;
myStack : ListOfInteger from TColStd;
-- result
mySort : SCList from GraphTools;

@ -220,7 +220,7 @@ Standard_Integer GraphTools_ReducedGraph::Visit
myNowIndex++;
myVertices(k).SetVisited(myNowIndex);
MIN = myNowIndex;
myStack.Push(k);
myStack.Prepend(k);
Standard_Integer currentVisited;
currentVisited = myVertices(k).GetVisited();
Standard_Integer adjacentIndex;
@ -242,11 +242,11 @@ Standard_Integer GraphTools_ReducedGraph::Visit
Handle(GraphTools_SC) SC = new GraphTools_SC();
Standard_Boolean more;
do {
SC->AddVertex(myStack.Top());
myVertices(myStack.Top()).SetVisited(IntegerLast());
myVertices(myStack.Top()).SetSC(SC);
more = myStack.Top() != k;
myStack.Pop() ;
SC->AddVertex(myStack.First());
myVertices(myStack.First()).SetVisited(IntegerLast());
myVertices(myStack.First()).SetSC(SC);
more = myStack.First() != k;
myStack.RemoveFirst() ;
}
while (more);
mySort.Prepend(SC);

@ -33,7 +33,7 @@ generic class SortedStrgCmptsFromIterator from GraphTools
-- returned before an other which point to it.
uses StackOfInteger from TColStd,
uses ListOfInteger from TColStd,
ListOfSequenceOfInteger from GraphTools,
ListIteratorOfListOfSequenceOfInteger from GraphTools
@ -105,7 +105,7 @@ fields
myVertices : SCMap from GraphTools;
-- algorithm
myNowIndex : Integer from Standard;
myStack : StackOfInteger from TColStd;
myStack : ListOfInteger from TColStd;
-- result
mySort : ListOfSequenceOfInteger from GraphTools;
myIterator : ListIteratorOfListOfSequenceOfInteger from GraphTools;

@ -143,7 +143,7 @@ Standard_Integer GraphTools_SortedStrgCmptsFromIterator::Visit
myNowIndex++;
myVertices(k) = myNowIndex;
MIN = myNowIndex;
myStack.Push(k);
myStack.Prepend(k);
Standard_Integer currentVisited;
currentVisited = myVertices.FindFromIndex (k);
Standard_Integer adjacentIndex;
@ -165,10 +165,10 @@ Standard_Integer GraphTools_SortedStrgCmptsFromIterator::Visit
TColStd_SequenceOfInteger& newSC = mySort.First();
Standard_Boolean more;
do {
newSC.Append(myStack.Top());
myVertices(myStack.Top()) = IntegerLast();
more = myStack.Top() != k;
myStack.Pop() ;
newSC.Append(myStack.First());
myVertices(myStack.First()) = IntegerLast();
more = myStack.First() != k;
myStack.RemoveFirst() ;
}
while (more);
}

@ -27,7 +27,6 @@ NCollection_Array1.hxx
NCollection_HArray1.hxx
NCollection_Array2.hxx
NCollection_HArray2.hxx
NCollection_Stack.hxx
NCollection_List.hxx
NCollection_Set.hxx
NCollection_HSet.hxx
@ -54,7 +53,6 @@ NCollection_DefineSequence.hxx
NCollection_DefineHSequence.hxx
NCollection_DefineSet.hxx
NCollection_DefineHSet.hxx
NCollection_DefineStack.hxx
NCollection_BaseVector.hxx
NCollection_BaseVector.cxx

@ -1,35 +0,0 @@
// Created on: 2002-04-17
// Created by: Alexander Kartomin (akm)
// Copyright (c) 2002-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
// Automatically created from NCollection_Stack.hxx by GAWK
// Purpose: A stack is a structure where item can be added and
// removed from the top. Like a stack of plates in a
// kitchen. The last entered item will be be the
// first removed. This is called a LIFO (last In First Out).
// Inherits BaseList, adding the data item to each node.
#ifndef NCollection_DefineStack_HeaderFile
#define NCollection_DefineStack_HeaderFile
#include <NCollection_DefineBaseCollection.hxx>
#include <NCollection_Stack.hxx>
// **************************************** Template for Stack class ********
#define DEFINE_STACK(_ClassName_, _BaseCollection_, TheItemType) \
typedef NCollection_Stack<TheItemType > _ClassName_;
#endif

@ -1,142 +0,0 @@
// Created on: 2002-04-17
// Created by: Alexander Kartomin (akm)
// Copyright (c) 2002-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef NCollection_Stack_HeaderFile
#define NCollection_Stack_HeaderFile
#include <NCollection_BaseCollection.hxx>
#include <NCollection_BaseList.hxx>
#include <NCollection_TListNode.hxx>
#include <NCollection_TListIterator.hxx>
#if !defined No_Exception && !defined No_Standard_NoSuchObject
#include <Standard_NoSuchObject.hxx>
#endif
/**
* Purpose: A stack is a structure where item can be added and
* removed from the top. Like a stack of plates in a
* kitchen. The last entered item will be be the
* first removed. This is called a LIFO (last In First Out).
* Inherits BaseList, adding the data item to each node.
*/
template <class TheItemType> class NCollection_Stack
: public NCollection_BaseCollection<TheItemType>,
public NCollection_BaseList
{
public:
typedef NCollection_TListNode<TheItemType> StackNode;
typedef NCollection_TListIterator<TheItemType> Iterator;
public:
// ---------- PUBLIC METHODS ------------
//! Constructor
NCollection_Stack(const Handle(NCollection_BaseAllocator)& theAllocator=0L) :
NCollection_BaseCollection<TheItemType>(theAllocator),
NCollection_BaseList() {}
//! Copy constructor
NCollection_Stack (const NCollection_Stack& theOther) :
NCollection_BaseCollection<TheItemType>(theOther.myAllocator),
NCollection_BaseList()
{ *this = theOther; }
//! Size - Number of items
virtual Standard_Integer Size (void) const
{ return Extent(); }
//! Depth - Number of items
Standard_Integer Depth (void) const
{ return Extent(); }
//! Replace this list by the items of theOther collection
virtual void Assign (const NCollection_BaseCollection<TheItemType>& theOther)
{
if (this == &theOther)
return;
Clear();
TYPENAME NCollection_BaseCollection<TheItemType>::Iterator& anIter =
theOther.CreateIterator();
for (; anIter.More(); anIter.Next())
{
StackNode* pNew = new (this->myAllocator) StackNode(anIter.Value());
PAppend(pNew);
}
}
//! Replace this list by the items of theOther Stack
NCollection_Stack& operator= (const NCollection_Stack& theOther)
{
if (this == &theOther)
return *this;
Clear ();
StackNode * pCur = (StackNode *) theOther.PFirst();
while (pCur)
{
StackNode* pNew = new (this->myAllocator) StackNode(pCur->Value());
PAppend(pNew);
pCur = (StackNode *) pCur->Next();
}
return *this;
}
//! Clear this stack
void Clear (void)
{ PClear (StackNode::delNode, this->myAllocator); }
//! Top item - constant
const TheItemType& Top (void) const
{
#if !defined No_Exception && !defined No_Standard_NoSuchObject
if (IsEmpty()) Standard_NoSuchObject::Raise ("NCollection_Stack::Top");
#endif
return ((StackNode *) PFirst())->Value();
}
//! Top item - variable
TheItemType& ChangeTop (void)
{
#if !defined No_Exception && !defined No_Standard_NoSuchObject
if (IsEmpty()) Standard_NoSuchObject::Raise("NCollection_Stack::ChangeTop");
#endif
return ((StackNode *) PFirst())->ChangeValue();
}
//! Push one item
void Push (const TheItemType& theItem)
{
StackNode * pNew = new (this->myAllocator) StackNode(theItem);
PPrepend(pNew);
}
//! Pop top item
void Pop (void)
{ PRemoveFirst (StackNode::delNode, this->myAllocator); }
//! Destructor - clears the List
~NCollection_Stack (void)
{ Clear(); }
private:
// ----------- PRIVATE METHODS -----------
//! Creates Iterator for use on BaseCollection
virtual TYPENAME NCollection_BaseCollection<TheItemType>::Iterator&
CreateIterator(void) const
{ return *(new (this->IterAllocator()) Iterator(*this)); }
};
#endif

@ -34,7 +34,7 @@ is
--
-- utilities and internal Classes
class StackOfPlate instantiates Stack from TCollection
class StackOfPlate instantiates List from TCollection
(Plate from Plate);
class SequenceOfHGPPConstraint instantiates Sequence from TCollection
(HGPPConstraint);

@ -27,7 +27,7 @@
#include <Plate_PinpointConstraint.hxx>
#include <Plate_FreeGtoCConstraint.hxx>
#include <NLPlate_StackIteratorOfStackOfPlate.hxx>
#include <NLPlate_ListIteratorOfStackOfPlate.hxx>
#include <NLPlate_NLPlate.ixx>
@ -73,7 +73,7 @@ NLPlate_NLPlate::NLPlate_NLPlate(const Handle(Geom_Surface)& InitialSurface) :
if(ordre<maxOrder+2) ordre = maxOrder+2;
if(Iterate(0,ord))
{
mySOP.ChangeTop().SetPolynomialPartOnly(Standard_True);
mySOP.First().SetPolynomialPartOnly(Standard_True);
ConstraintsSliding();
}
@ -152,7 +152,7 @@ NLPlate_NLPlate::NLPlate_NLPlate(const Handle(Geom_Surface)& InitialSurface) :
else
Value = myInitialSurface->DN(point2d.X(),point2d.Y(),iu,iv).XYZ();
for(NLPlate_StackIteratorOfStackOfPlate SI(mySOP);SI.More();SI.Next())
for(NLPlate_ListIteratorOfStackOfPlate SI(mySOP);SI.More();SI.Next())
{
if(SI.Value().IsDone())
Value += SI.Value().EvaluateDerivative(point2d,iu,iv);
@ -168,7 +168,7 @@ NLPlate_NLPlate::NLPlate_NLPlate(const Handle(Geom_Surface)& InitialSurface) :
{
if(!(myInitialSurface->IsCNu(cont+1)&&myInitialSurface->IsCNv(cont+1)))break;
}
for(NLPlate_StackIteratorOfStackOfPlate SI(mySOP);SI.More();SI.Next())
for(NLPlate_ListIteratorOfStackOfPlate SI(mySOP);SI.More();SI.Next())
{
if((SI.Value().IsDone())&&(cont > SI.Value().Continuity())) cont = SI.Value().Continuity();
}
@ -181,8 +181,8 @@ const Standard_Integer ResolutionOrder,
const Standard_Real IncrementalLoading)
{
Plate_Plate EmptyPlate;
mySOP.Push(EmptyPlate);
Plate_Plate &TopP = mySOP.ChangeTop();
mySOP.Prepend(EmptyPlate);
Plate_Plate &TopP = mySOP.First();
for(Standard_Integer index =1; index <= myHGPPConstraints.Length(); index++)
{
const Handle(NLPlate_HGPPConstraint) &HGPP = myHGPPConstraints(index);
@ -265,7 +265,7 @@ const Standard_Real IncrementalLoading)
TopP.SolveTI(ResolutionOrder);
if(!TopP.IsDone())
{
mySOP.Pop();
mySOP.RemoveFirst();
return Standard_False;
}
else

@ -43,7 +43,7 @@ Standard_Size OpenGl_StateInterface::Index() const
// =======================================================================
void OpenGl_StateInterface::Update()
{
myStateStack.Push (myIndex);
myStateStack.Prepend (myIndex);
myIndex = myNextIndex;
++myNextIndex;
}
@ -56,8 +56,8 @@ void OpenGl_StateInterface::Revert()
{
if (!myStateStack.IsEmpty())
{
myIndex = myStateStack.Top();
myStateStack.Pop();
myIndex = myStateStack.First();
myStateStack.RemoveFirst();
}
else
{

@ -21,7 +21,7 @@
#include <OpenGl_Element.hxx>
#include <OpenGl_Light.hxx>
#include <NCollection_Stack.hxx>
#include <NCollection_List.hxx>
//! Defines interface for OpenGL state.
class OpenGl_StateInterface
@ -44,7 +44,7 @@ protected:
Standard_Size myIndex; //!< Current state index
Standard_Size myNextIndex; //!< Next state index
NCollection_Stack<Standard_Size> myStateStack; //!< Stack of previous states.
NCollection_List<Standard_Size> myStateStack; //!< Stack of previous states.
};

@ -22,7 +22,6 @@
#include <V3d_View.hxx>
#include <ViewerTest.hxx>
#include <ViewerTest_EventManager.hxx>
#include <TColStd_StackOfInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_HSequenceOfReal.hxx>

@ -23,7 +23,6 @@ uses
is
class ListOfPnt instantiates List from TCollection (Pnt from gp);
class StackOfPnt instantiates Stack from TCollection (Pnt from gp);
class DataMapOfRealPnt instantiates DataMap from TCollection
(Real from Standard,
Pnt from gp,

@ -207,21 +207,6 @@ static Standard_Integer QANColTestList(Draw_Interpretor& di, Standard_Integer ar
return 0;
}
//=======================================================================
//function : QANColTestStack
//purpose :
//=======================================================================
static Standard_Integer QANColTestStack(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{
if ( argc != 1) {
di << "Usage : " << argv[0] << "\n";
return 1;
}
QANCollection_StackFunc aStack;
TestStack(aStack);
return 0;
}
//=======================================================================
//function : QANColTestSet
//purpose :
@ -264,7 +249,6 @@ void QANCollection::Commands2(Draw_Interpretor& theCommands) {
theCommands.Add("QANColTestIndexedMap", "QANColTestIndexedMap", __FILE__, QANColTestIndexedMap, group);
theCommands.Add("QANColTestIndexedDataMap", "QANColTestIndexedDataMap", __FILE__, QANColTestIndexedDataMap, group);
theCommands.Add("QANColTestList", "QANColTestList", __FILE__, QANColTestList, group);
theCommands.Add("QANColTestStack", "QANColTestStack", __FILE__, QANColTestStack, group);
theCommands.Add("QANColTestSet", "QANColTestSet", __FILE__, QANColTestSet, group);
theCommands.Add("QANColTestSequence", "QANColTestSequence", __FILE__, QANColTestSequence, group);

@ -97,20 +97,6 @@ static Standard_Integer QANColPerfList(Draw_Interpretor& di, Standard_Integer ar
return 0;
}
//=======================================================================
//function : QANColPerfStack
//purpose :
//=======================================================================
static Standard_Integer QANColPerfStack(Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
{
Standard_Integer Repeat, Size;
if ( CheckArguments(di, argc, argv, Repeat, Size) ) {
return 1;
}
CompStack(Repeat,Size);
return 0;
}
//=======================================================================
//function : QANColPerfSet
//purpose :
@ -230,7 +216,6 @@ void QANCollection::Commands3(Draw_Interpretor& theCommands) {
theCommands.Add("QANColPerfArray1", "QANColPerfArray1 Repeat Size", __FILE__, QANColPerfArray1, group);
theCommands.Add("QANColPerfArray2", "QANColPerfArray2 Repeat Size", __FILE__, QANColPerfArray2, group);
theCommands.Add("QANColPerfList", "QANColPerfList Repeat Size", __FILE__, QANColPerfList, group);
theCommands.Add("QANColPerfStack", "QANColPerfStack Repeat Size", __FILE__, QANColPerfStack, group);
theCommands.Add("QANColPerfSet", "QANColPerfSet Repeat Size", __FILE__, QANColPerfSet, group);
theCommands.Add("QANColPerfSequence", "QANColPerfSequence Repeat Size", __FILE__, QANColPerfSequence, group);
theCommands.Add("QANColPerfMap", "QANColPerfMap Repeat Size", __FILE__, QANColPerfMap, group);

@ -67,15 +67,12 @@ DEFINE_INDEXEDMAP(QANCollection_IndexedMapFunc,QANCollection_Key1BaseColFunc,Key
DEFINE_INDEXEDDATAMAP(QANCollection_IDMapFunc,QANCollection_BaseColFunc,Key1Type,ItemType)
#include <NCollection_DefineList.hxx>
#include <NCollection_DefineStack.hxx>
#include <NCollection_DefineSet.hxx>
#include <NCollection_DefineHSet.hxx>
////////////////////////////////DEFINE_LIST(QANCollection_List,QANCollection_BaseCol,ItemType)
////////////////////////////////DEFINE_STACK(QANCollection_Stack,QANCollection_BaseCol,ItemType)
////////////////////////////////DEFINE_SET(QANCollection_Set,QANCollection_Key2BaseCol,Key2Type)
////////////////////////////////DEFINE_HSET(QANCollection_HSet,QANCollection_Set)
DEFINE_LIST(QANCollection_ListFunc,QANCollection_BaseColFunc,ItemType)
DEFINE_STACK(QANCollection_StackFunc,QANCollection_BaseColFunc,ItemType)
DEFINE_SET(QANCollection_SetFunc,QANCollection_Key2BaseColFunc,Key2Type)
DEFINE_HSET(QANCollection_HSetFunc,QANCollection_SetFunc)

@ -67,15 +67,12 @@ DEFINE_INDEXEDMAP(QANCollection_IndexedMapPerf,QANCollection_Key1BaseColPerf,Key
DEFINE_INDEXEDDATAMAP(QANCollection_IDMapPerf,QANCollection_BaseColPerf,Key1Type,ItemType)
#include <NCollection_DefineList.hxx>
#include <NCollection_DefineStack.hxx>
#include <NCollection_DefineSet.hxx>
#include <NCollection_DefineHSet.hxx>
////////////////////////////////DEFINE_LIST(QANCollection_List,QANCollection_BaseCol,ItemType)
////////////////////////////////DEFINE_STACK(QANCollection_Stack,QANCollection_BaseCol,ItemType)
////////////////////////////////DEFINE_SET(QANCollection_Set,QANCollection_Key2BaseCol,Key2Type)
////////////////////////////////DEFINE_HSET(QANCollection_HSet,QANCollection_Set)
DEFINE_LIST(QANCollection_ListPerf,QANCollection_BaseColPerf,ItemType)
DEFINE_STACK(QANCollection_StackPerf,QANCollection_BaseColPerf,ItemType)
DEFINE_SET(QANCollection_SetPerf,QANCollection_Key2BaseColPerf,Key2Type)
DEFINE_HSET(QANCollection_HSetPerf,QANCollection_SetPerf)

@ -70,40 +70,6 @@ void TestList (QANCollection_ListFunc& theL)
aL.Clear();
}
// ===================== Test methods of Stack type ===========================
////////////////////////////////void TestStack (QANCollection_Stack& theS)
void TestStack (QANCollection_StackFunc& theS)
{
// Depth
Standard_Integer iDep=theS.Depth();
Standard_Integer i;
printf ("Info: testing Stack(%d)\n", iDep);
// Push, Pop, Top, ChangeTop
ItemType anItem;
////////////////////////////////QANCollection_Stack aS;
QANCollection_StackFunc aS;
for (i=0; i<4; i++)
{
Random (anItem);
aS.Push (anItem);
Random(aS.ChangeTop());
Random (anItem);
aS.Push (anItem);
PrintItem(aS.Top());
aS.Pop();
}
// Copy constructor + operator=
////////////////////////////////theS = QANCollection_Stack(aS);
theS = QANCollection_StackFunc(aS);
// Assign
AssignCollection (theS, aS);
// Clear
aS.Clear();
}
// ===================== Test methods of Set type =============================
////////////////////////////////void TestSet (QANCollection_Set& theS)
void TestSet (QANCollection_SetFunc& theS)

@ -34,7 +34,6 @@
// Standard_EXPORT void TestInDaMap (QANCollection_IDMap& theNM);
#include <QANCollection_FuncMaps.hxx>
// Standard_EXPORT void TestList (QANCollection_List& theLi);
// Standard_EXPORT void TestStack (QANCollection_Stack& theSt);
// Standard_EXPORT void TestSet (QANCollection_Set& theSe);
// Standard_EXPORT void TestSequence(QANCollection_Sequence& theSq);
#include <QANCollection_FuncLists.hxx>

@ -17,7 +17,6 @@
#define QANCollection_PerfLists_HeaderFile
#include <QANCollection_ListOfPnt.hxx>
#include <QANCollection_StackOfPnt.hxx>
#include <TColgp_SequenceOfPnt.hxx>
#include <TColStd_SetOfInteger.hxx>
@ -93,92 +92,6 @@ void CompList (const Standard_Integer theRep,
}
// ===================== Test perform of Stack type ==========================
void CompStack (const Standard_Integer theRep,
const Standard_Integer theSize)
{
Standard_Integer i,j;
////////////////////////////////Perf_Meter aNPush ("NCollection_Stack pushing",0);
////////////////////////////////Perf_Meter aTPush ("TCollection_Stack pushing",0);
////////////////////////////////Perf_Meter aNPopp ("NCollection_Stack popping",0);
////////////////////////////////Perf_Meter aTPopp ("TCollection_Stack popping",0);
////////////////////////////////Perf_Meter aNOper ("NCollection_Stack operator=",0);
////////////////////////////////Perf_Meter aTOper ("TCollection_Stack operator=",0);
////////////////////////////////Perf_Meter aNClea ("NCollection_Stack clearing",0);
////////////////////////////////Perf_Meter aTClea ("TCollection_Stack clearing",0);
////////////////////////////////Perf_Meter aNAssi ("NCollection_Stack Assign",0);
for (i=0; i<theRep; i++)
{
////////////////////////////////QANCollection_Stack a1, a2;
QANCollection_StackPerf a1, a2;
////////////////////////////////aNPush.Start();
PERF_START_METER("NCollection_Stack pushing")
for (j=1; j<=theSize; j++)
{
ItemType anItem;
Random(anItem);
a1.Push(anItem);
}
////////////////////////////////aNPush.Stop();
PERF_STOP_METER("NCollection_Stack pushing")
////////////////////////////////aNOper.Start();
PERF_START_METER("NCollection_Stack operator=")
a2 = a1;
////////////////////////////////aNOper.Stop();
PERF_STOP_METER("NCollection_Stack operator=")
////////////////////////////////aNAssi.Start();
PERF_START_METER("NCollection_Stack Assign")
a2.Assign(a1);
////////////////////////////////aNAssi.Stop();
PERF_STOP_METER("NCollection_Stack Assign")
////////////////////////////////aNPopp.Start();
PERF_START_METER("NCollection_Stack popping")
for (j=1; j<=theSize; j++)
a1.Pop();
////////////////////////////////aNPopp.Stop();
PERF_STOP_METER("NCollection_Stack popping")
////////////////////////////////aNClea.Start();
PERF_START_METER("NCollection_Stack clearing")
a2.Clear();
////////////////////////////////aNClea.Stop();
PERF_STOP_METER("NCollection_Stack clearing")
}
for (i=0; i<theRep; i++)
{
QANCollection_StackOfPnt a1, a2;
////////////////////////////////aTPush.Start();
PERF_START_METER("TCollection_Stack pushing")
for (j=1; j<=theSize; j++)
{
ItemType anItem;
Random(anItem);
a1.Push(anItem);
}
////////////////////////////////aTPush.Stop();
PERF_STOP_METER("TCollection_Stack pushing")
////////////////////////////////aTOper.Start();
PERF_START_METER("TCollection_Stack operator=")
a2 = a1;
////////////////////////////////aTOper.Stop();
PERF_STOP_METER("TCollection_Stack operator=")
////////////////////////////////aTPopp.Start();
PERF_START_METER("TCollection_Stack popping")
for (j=1; j<=theSize; j++)
a1.Pop();
////////////////////////////////aTPopp.Stop();
PERF_STOP_METER("TCollection_Stack popping")
////////////////////////////////aTClea.Start();
PERF_START_METER("TCollection_Stack clearing")
a2.Clear();
////////////////////////////////aTClea.Stop();
PERF_STOP_METER("TCollection_Stack clearing")
}
PERF_PRINT_ALL
}
// ===================== Test perform of Set type ==========================
void CompSet (const Standard_Integer theRep,
const Standard_Integer theSize)

@ -171,14 +171,6 @@ class ListOfReal instantiates List from TCollection(Real );
class ListOfTransient instantiates List from TCollection(Transient);
class ListOfAsciiString instantiates List from TCollection(AsciiString from TCollection);
--
-- Instantiations Stack (Integer,Real,Transient)
-- *********************************************
--
class StackOfInteger instantiates Stack from TCollection(Integer );
class StackOfReal instantiates Stack from TCollection(Real );
class StackOfTransient instantiates Stack from TCollection(Transient);
--
-- Instantiations MapHasher (Integer,Real, Transient, Persistent)
-- **************************************************************

@ -23,7 +23,6 @@
-- - Sequence, HSequence
-- - Set, HSet
-- - List
-- - Stack
-- - BasicMap, BasicMapIterator
-- - Map, DataMap, DoubleMap, IndexedMap, IndexedDataMap
@ -51,9 +50,6 @@ is
generic class Array2;
generic class HArray2;
generic class Stack, StackNode, StackIterator;
---Purpose: A stack handled by value.
generic class List, ListNode, ListIterator;
---Purpose: A single list handled by value.

@ -1,244 +0,0 @@
-- Created on: 1993-01-18
-- Created by: Remi LEQUETTE
-- Copyright (c) 1993-1999 Matra Datavision
-- Copyright (c) 1999-2014 OPEN CASCADE SAS
--
-- This file is part of Open CASCADE Technology software library.
--
-- This library is free software; you can redistribute it and/or modify it under
-- the terms of the GNU Lesser General Public License version 2.1 as published
-- by the Free Software Foundation, with special exception defined in the file
-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-- distribution for complete text of the license and disclaimer of any warranty.
--
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
-- Updated: M. MERCIEN 26, Oct 1994
-- Subject: StackIterator implementation
generic class Stack from TCollection (Item as any)
---Purpose: A stack is a structure where item can be added and
-- removed from the top. Like a stack of plates in a
-- kitchen. The last entered item will be be the
-- first removed. This is called a LIFO (last In First Out).
-- Stack is a generic class which depends on Item, the type
-- of element in the structure.
-- Use a StackIterator iterator to explore a Stack structure.
-- Note: An iterator class is automatically instantiated from
-- the TCollection_StackIterator class at the time of
-- instantiation of a Stack structure.
raises
NoSuchObject from Standard
class StackNode from TCollection
inherits MapNode from TCollection
uses MapNodePtr from TCollection
is
Create(I : Item; n : MapNodePtr from TCollection) returns StackNode from TCollection;
---C++: inline
Value(me) returns Item;
---C++: return &
---C++: inline
fields
myValue : Item;
end;
class StackIterator from TCollection
---Purpose: Functions used for iterating the contents of a Stack data structure.
-- Note: an iterator class is automatically instantiated from
-- this generic class at the time of instantiation of a Stack structure.
raises NoSuchObject from Standard
is
Create returns StackIterator from TCollection;
---Purpose: Constructs an empty iterator for a Stack data structure.
-- Use the function Initialize to define the stack to explore.
Create(S : Stack from TCollection) returns StackIterator from TCollection;
---Purpose: Constructs an iterator on the stack stack, and positions it
-- on the first item of the stack stack, if it exists.
-- The current position is undefined if the stack stack is empty.
-- Use in a loop:
-- - the function More to know if there is a current item,
-- - then the function Value to read the value of the current item,
-- - then the function Next to position the iterator on the
-- next item, if it exists.
Initialize(me : in out; S : Stack from TCollection)
---Purpose: Sets, or resets this iterator for the stack stack, and
-- positions it on the first item of the stack stack, if it exists.
-- The current position is undefined if the stack stack is empty.
-- Example
-- TColStd_StackOfInteger stack;
-- TColStd_StackIteratorOfStackOfInteger
-- pos;
-- pos.Initialize(stack);
-- Use in a loop:
-- - the function More to know if there is a current item,
-- - then the function Value to read the value of the current item,
-- - then the function Next to position the iterator on the
-- next item, if it exists.
is static;
More(me) returns Boolean from Standard
---Purpose:Returns true if there is a current item in the stack explored
-- with this iterator (i.e. when the current position is defined).
-- More is false if:
-- - the iterator is not initialized, or
-- - the stack is empty, or
-- - the exploration is finished.
-- Use:
-- - the function Value to read the current item,
-- - the function Next to position this iterator on the next item, if it exists.
---C++: inline
is static;
Next(me: in out)
---Purpose: Sets the iterator to the next item in the explored stack.
-- If the current position of this iterator corresponds to the
-- top of the stack, it becomes undefined.
is static;
Value(me) returns any Item
raises NoSuchObject from Standard
---Purpose: Returns the value of the current item of this iterator in the explored stack.
-- Note: Item is the type of element in the explored Stack stack.
-- Example
-- TColStd_StackOfInteger stack;
-- TColStd_StackIteratorOfStackOfInteger
-- pos(stack);
-- stack.Push(1);
-- assert ( pos.Value() == 1 );
-- Exceptions
-- Standard_NoSuchObject if the current position of this
-- iterator is undefined.
---C++: return const &
is static;
fields
current : Address from Standard;
end StackIterator from TCollection;
is
Create returns Stack from TCollection;
---Purpose: Constructs an empty stack.
-- Use:
-- - the function Push to add an item at the top of the stack,
-- - the function Top to read the item at the top of the stack,
-- - the function ChangeTop to assign a new value to the
-- item at the top of the stack,
-- - the function Pop to remove the item at the top of the stack,
-- - and a stack iterator to explore the stack and read all its items.
-- Warning
-- To copy a stack, you must explicitly call the assignment
-- operator (operator=)..
Create(Other : Stack from TCollection)
returns Stack from TCollection
is private;
---Purpose: Creates by copying an existing Stack.
-- Warning: Prints a message when other is not empty. It is
-- recommanded to use Assign (operator =).
Assign(me : in out; Other : Stack from TCollection)
returns Stack from TCollection
---Purpose: Copies in this stack the content of <Other>.
--If this stack is not empty, it is automatically cleared before copying.
-- Note that this method is an alias of the assignment
-- operator operator =.
---C++: alias operator =
---C++: return const &
is static;
IsEmpty(me) returns Boolean
---Purpose: Returns True when the stack is empty.
-- i.e. Depth() == 0
---C++: inline
is static;
Depth(me) returns Integer
---Level: Public
---Purpose: Returns the number of Items in the stack.
-- The depth of this stack is:
-- - incremented by Push, and
-- - decremented by Pop.
-- Example:
-- me = (A B C)
-- returns 3
---C++: inline
is static;
Top(me) returns any Item
---Level: Public
---Purpose: Returns the Item at the top of the stack.
-- Example:
-- before
-- me = (A B C)
-- after
-- me = (A B C)
-- returns
-- A
-- Trigger: Raises an exception when <me> is empty
---C++: return const &
raises NoSuchObject from Standard
is static;
Push(me : in out; I : Item)
---Level: Public
---Purpose: Adds <I> at the top of the stack. Depth is
-- incremented.
-- Example:
-- before
-- me = (A B C) I = D
-- after
-- me = (D A B C)
is static;
Pop(me : in out)
---Level: Public
---Purpose: Removes the Item at the top of the stack. Depth is
-- decremented.
-- Example:
-- before
-- me = (A B C)
-- after
-- me = (B C)
-- Trigger: Raises an exception when <me> is empty
raises NoSuchObject from Standard
is static;
Clear(me : in out)
---Level: Public
---Purpose: Removes all the items from the stack.
---C++: alias ~
is static;
ChangeTop(me : in out) returns any Item
---Level: Public
---Purpose: Returns a modifiable reference of the top of the stack.
-- Example:
-- before
-- me = (A B C)
-- me.ChangeTop() = D
-- after
-- me = (D B C)
-- Trigger: Raises an exception when <me> is empty
raises NoSuchObject from Standard
---C++: return &
is static;
fields
myTop : Address from Standard;
myDepth : Integer from Standard;
friends
class StackIterator from TCollection
end Stack;

@ -1,164 +0,0 @@
// Created on: 1993-01-18
// Created by: Remi LEQUETTE
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Standard_NoSuchObject.hxx>
//=======================================================================
//function : TCollection_Stack
//purpose :
//=======================================================================
TCollection_Stack::TCollection_Stack() :
myTop(NULL),
myDepth(0)
{
}
//=======================================================================
//function : TCollection_Stack
//purpose :
//=======================================================================
TCollection_Stack::TCollection_Stack(const TCollection_Stack& Other)
{
if (!Other.IsEmpty()) {
cout << "WARNING copy constructor of non empty stack !"<<endl;
}
TCollection_StackNode* p = (TCollection_StackNode*) Other.myTop;
TCollection_StackNode* q;
TCollection_StackNode* r = NULL;
myTop = NULL;
while (p) {
q = new TCollection_StackNode(p->Value(),(TCollection_MapNode*)0L);
if (r) r->Next() = q;
else myTop = q;
r = q;
p = (TCollection_StackNode*)p->Next();
}
myDepth = Other.myDepth;
}
//=======================================================================
//function : Assign
//purpose :
//=======================================================================
const TCollection_Stack& TCollection_Stack::Assign
(const TCollection_Stack& Other)
{
if (this == &Other) return *this;
Clear();
TCollection_StackNode* p = (TCollection_StackNode*) Other.myTop;
TCollection_StackNode* q;
TCollection_StackNode* r = NULL;
while (p) {
q = new TCollection_StackNode(p->Value(),(TCollection_MapNode*)0L);
if (r) r->Next() = q;
else myTop = q;
r = q;
p = (TCollection_StackNode*)p->Next();
}
myDepth = Other.myDepth;
return *this;
}
//=======================================================================
//function : Top
//purpose :
//=======================================================================
const Item& TCollection_Stack::Top() const
{
Standard_NoSuchObject_Raise_if(IsEmpty(),"TCollection_Stack");
return ((TCollection_StackNode*)myTop)->Value();
}
//=======================================================================
//function : Push
//purpose :
//=======================================================================
void TCollection_Stack::Push(const Item& I)
{
myTop = new TCollection_StackNode(I,(TCollection_StackNode*)myTop);
myDepth++;
}
//=======================================================================
//function : Pop
//purpose :
//=======================================================================
void TCollection_Stack::Pop()
{
Standard_NoSuchObject_Raise_if(IsEmpty(),"TCollection_Stack");
TCollection_StackNode* p = (TCollection_StackNode*) myTop;
myTop = p->Next();
delete p;
myDepth--;
}
//=======================================================================
//function : Clear
//purpose :
//=======================================================================
void TCollection_Stack::Clear()
{
TCollection_StackNode* p = (TCollection_StackNode*) myTop;
TCollection_StackNode* q;
while(p) {
q = (TCollection_StackNode*)p->Next();
delete p;
p = q;
}
myDepth = 0;
myTop = NULL;
}
//=======================================================================
//function : ChangeTop
//purpose :
//=======================================================================
Item& TCollection_Stack::ChangeTop()
{
Standard_NoSuchObject_Raise_if(IsEmpty(),"TCollection_Stack");
return ((TCollection_StackNode*)myTop)->Value();
}
//=======================================================================
//function : Next
//purpose :
//=======================================================================
void TCollection_StackIterator::Next()
{
current = ((TCollection_StackNode*)current)->Next();
}
//=======================================================================
//function : Value
//purpose :
//=======================================================================
const Item& TCollection_StackIterator::Value() const
{
Standard_NoSuchObject_Raise_if(current == NULL,
"TCollection_StackIterator");
return ((TCollection_StackNode*)current)->Value();
}

@ -1,36 +0,0 @@
// Created on: 1993-01-18
// Created by: Remi LEQUETTE
// Copyright (c) 1993-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
//=======================================================================
//function : IsEmpty
//purpose :
//=======================================================================
inline Standard_Boolean TCollection_Stack::IsEmpty() const
{
return myDepth == 0;
}
//=======================================================================
//function : Depth
//purpose :
//=======================================================================
inline Standard_Integer TCollection_Stack::Depth() const
{
return myDepth;
}

@ -1,50 +0,0 @@
// Created on: 1994-10-26
// Created by: Mireille MERCIEN
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
// The methods of Iterator needing the Node class
// are defined in TCollection_Stack.gxx
//=======================================================================
//function : TCollection_StackIterator
//purpose :
//=======================================================================
TCollection_StackIterator::TCollection_StackIterator() : current(NULL)
{}
//=======================================================================
//function : TCollection_StackIterator
//purpose :
//=======================================================================
TCollection_StackIterator::TCollection_StackIterator(const TCollection_Stack& L) :
current(L.myTop)
{}
//=======================================================================
//function : Initialize
//purpose :
//=======================================================================
void TCollection_StackIterator::Initialize(const TCollection_Stack& L)
{
current = L.myTop;
}

@ -1,26 +0,0 @@
// Created on: 1994-10-26
// Created by: Mireille MERCIEN
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
//=======================================================================
//function : More
//purpose :
//=======================================================================
inline Standard_Boolean TCollection_StackIterator::More() const
{
return current != 0L;
}

@ -1,13 +0,0 @@
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.

@ -1,25 +0,0 @@
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
inline TCollection_StackNode::TCollection_StackNode(const Item& I,const TCollection_MapNodePtr& n)
: TCollection_MapNode(n)
{
myValue = I;
}
inline Item& TCollection_StackNode::Value() const
{
return (Item&)myValue;
}

@ -41,7 +41,7 @@ uses
LabelNodePtr from TDF,
Delta from TDF,
IDFilter from TDF,
StackOfInteger from TColStd,
ListOfInteger from TColStd,
HAllocator from TDF
raises
@ -226,7 +226,7 @@ fields
myNbTouchedAtt : Integer from Standard;
myNotUndoMode : Boolean from Standard;
myTime : Integer from Standard;
myTimes : StackOfInteger from TColStd;
myTimes : ListOfInteger from TColStd;
myLabelNodeAllocator: HAllocator from TDF;
myAllowModification : Boolean from Standard;

@ -118,7 +118,7 @@ void TDF_Data::Destroy()
Standard_Integer TDF_Data::OpenTransaction()
{
myTimes.Push(myTime);
myTimes.Prepend(myTime);
return ++myTransaction;
}
@ -148,7 +148,7 @@ Handle(TDF_Delta) TDF_Data::CommitTransaction
--myTransaction;
if (withDelta) {
if (!delta->IsEmpty()) {
delta->Validity(myTimes.Top(),myTime);
delta->Validity(myTimes.First(),myTime);
#ifdef DEB_DELTA
if (myTransaction == 0) {
cout<<"TDF_Data::Commit generated this delta in t=0:"<<endl;
@ -163,7 +163,7 @@ Handle(TDF_Delta) TDF_Data::CommitTransaction
}
#endif
}
myTimes.Pop();
myTimes.RemoveFirst();
}
TDF_Data_DebugModified("COMMIT");
return delta;

@ -38,9 +38,6 @@ uses
is
private class StackOfIterator instantiates
Stack from TCollection (Iterator from TopoDS);
pointer Stack to Iterator from TopoDS;
class Explorer;