Salome HOME
This commit was generated by cvs2git to create branch 'IMPORT'.
[modules/smesh.git] / src / SMDS / SMDS_MeshIDFactory.lxx
1 // File:        SMDS_MeshIDFactory.lxx
2 // Created:     Thu Jan 24 12:10:57 2002
3 // Author:      Jean-Michel BOULCOURT
4 //              <jmb@coulox.paris1.matra-dtv.fr>
5
6
7 //=======================================================================
8 //function : GetFreeID
9 //purpose  : 
10 //=======================================================================
11 inline Standard_Integer  SMDS_MeshIDFactory::GetFreeID()
12 {
13   if (myPoolOfID.IsEmpty())
14     return ++myMaxID;
15   else {
16     Standard_Integer ID = myPoolOfID.Top();
17     myPoolOfID.Pop();
18     return ID;
19   }
20
21 }
22
23 //=======================================================================
24 //function : ReleaseID
25 //purpose  : 
26 //=======================================================================
27 inline void SMDS_MeshIDFactory::ReleaseID(const Standard_Integer ID)
28 {
29   if (ID < myMaxID)
30     myPoolOfID.Push(ID);
31
32 }
33
34