]> SALOME platform Git repositories - modules/smesh.git/blobdiff - src/SMDS/SMDS_MeshIDFactory.lxx
Salome HOME
NRI : First integration.
[modules/smesh.git] / src / SMDS / SMDS_MeshIDFactory.lxx
diff --git a/src/SMDS/SMDS_MeshIDFactory.lxx b/src/SMDS/SMDS_MeshIDFactory.lxx
new file mode 100644 (file)
index 0000000..3731249
--- /dev/null
@@ -0,0 +1,34 @@
+// File:       SMDS_MeshIDFactory.lxx
+// Created:    Thu Jan 24 12:10:57 2002
+// Author:     Jean-Michel BOULCOURT
+//             <jmb@coulox.paris1.matra-dtv.fr>
+
+
+//=======================================================================
+//function : GetFreeID
+//purpose  : 
+//=======================================================================
+inline Standard_Integer  SMDS_MeshIDFactory::GetFreeID()
+{
+  if (myPoolOfID.IsEmpty())
+    return ++myMaxID;
+  else {
+    Standard_Integer ID = myPoolOfID.Top();
+    myPoolOfID.Pop();
+    return ID;
+  }
+
+}
+
+//=======================================================================
+//function : ReleaseID
+//purpose  : 
+//=======================================================================
+inline void SMDS_MeshIDFactory::ReleaseID(const Standard_Integer ID)
+{
+  if (ID < myMaxID)
+    myPoolOfID.Push(ID);
+
+}
+
+