]> OCCT Git - occt-copy.git/commitdiff
0024545: Convertation of the generic classes to the non-generic (XmlObjMgt).
authordln <dmitry.lisin@opencascade.com>
Tue, 21 Jan 2014 11:59:23 +0000 (15:59 +0400)
committerbugmaster <bugmaster@opencascade.com>
Thu, 23 Jan 2014 07:41:39 +0000 (11:41 +0400)
In the package "XmlObjMgt" class "XmlObjMgt_Array1" was converted to the non-generic.
And some changes were made in "XmlNaming" package for correct compilation of the application.

src/XmlMNaming/XmlMNaming.cdl
src/XmlMNaming/XmlMNaming_NamedShapeDriver.cxx
src/XmlObjMgt/XmlObjMgt.cdl
src/XmlObjMgt/XmlObjMgt_Array1.cdl
src/XmlObjMgt/XmlObjMgt_Array1.cxx [new file with mode: 0644]
src/XmlObjMgt/XmlObjMgt_Array1.gxx [deleted file]

index 5c1b2676c26e6e7fb177bec9e1c191bd886fe73d..0a865317c4e7b3eb82ea821b46d4c9814f1032ed 100644 (file)
@@ -33,9 +33,6 @@ is
     class NamingDriver;
 
     class Shape1;
-    
-    class Array1OfShape1 instantiates Array1 from XmlObjMgt
-                (Shape1 from XmlMNaming);
 
     AddDrivers (aDriverTable  : ADriverTable  from XmlMDF;
                 aMessageDriver: MessageDriver from CDM);
index 0f1d3845f5cf3b5da4a83048db30b06beca2f969..7a90be70ffb4ebb4c2c322c355cb5140dcf34a55 100644 (file)
@@ -18,7 +18,7 @@
 #include <XmlMNaming_NamedShapeDriver.ixx>
 
 #include <XmlObjMgt.hxx>
-#include <XmlMNaming_Array1OfShape1.hxx>
+#include <XmlObjMgt_Array1.hxx>
 #include <XmlMNaming_Shape1.hxx>
 
 #include <TDF_Label.hxx>
@@ -103,8 +103,8 @@ Standard_Boolean XmlMNaming_NamedShapeDriver::Paste
   // apres creation Builder qui a mis la version a 1 :
   aTarget -> SetVersion (aVersion);
 
-  const XmlMNaming_Array1OfShape1 OldPShapes (anElement, ::OldsString());
-  const XmlMNaming_Array1OfShape1 NewPShapes (anElement, ::NewsString());
+  const XmlObjMgt_Array1 OldPShapes (anElement, ::OldsString());
+  const XmlObjMgt_Array1 NewPShapes (anElement, ::NewsString());
   if (NewPShapes.Length() == 0 && OldPShapes.Length() == 0)
     return Standard_True;
 
@@ -198,7 +198,7 @@ void XmlMNaming_NamedShapeDriver::Paste (const Handle(TDF_Attribute)& theSource,
   }
 
   BRepTools_ShapeSet& aShapeSet = (BRepTools_ShapeSet&) myShapeSet;
-  XmlMNaming_Array1OfShape1 OldPShapes (1,NbShapes), NewPShapes (1,NbShapes);
+  XmlObjMgt_Array1 OldPShapes (1,NbShapes), NewPShapes (1,NbShapes);
 
   OldPShapes.CreateArrayElement (theTarget, ::OldsString());
   NewPShapes.CreateArrayElement (theTarget, ::NewsString());
index 62c9a7dd085afac6925e2b1e6865b15eac5a66b6..3c6ed3bf719086746a1dfd05e0f200c125b53291 100644 (file)
@@ -41,7 +41,7 @@ is
     -- Retrieval Relocation Table
     alias RRelocationTable is DataMapOfIntegerTransient from TColStd;
 
-    generic class Array1; 
+    class Array1; 
 
     -- Package methods
     IdString returns DOMString from XmlObjMgt;
index c67dc433b7be5c3dec118ef4560d58e95774aa21..ca95826279a742c6f144c78441f2d62684adb30f 100644 (file)
@@ -14,7 +14,7 @@
 -- Alternatively, this file may be used under the terms of Open CASCADE
 -- commercial license or contractual agreement.
 
-generic class Array1 from XmlObjMgt  (Item as Storable) 
+class Array1 from XmlObjMgt
 
         ---Purpose: The class Array1 represents unidimensionnal 
         -- array of fixed size known at run time. 
diff --git a/src/XmlObjMgt/XmlObjMgt_Array1.cxx b/src/XmlObjMgt/XmlObjMgt_Array1.cxx
new file mode 100644 (file)
index 0000000..f603e71
--- /dev/null
@@ -0,0 +1,119 @@
+// Created on: 2001-08-01
+// Created by: Julia DOROVSKIKH
+// Copyright (c) 2001-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 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.
+
+//AGV 130202: Changed prototype LDOM_Node::getOwnerDocument()
+#include <XmlObjMgt_Array1.ixx>
+
+#include <XmlObjMgt.hxx>
+#include <XmlObjMgt_DOMString.hxx>
+#include <XmlObjMgt_Document.hxx>
+#include <TCollection_AsciiString.hxx>
+
+IMPLEMENT_DOMSTRING (LowerString, "lower")
+IMPLEMENT_DOMSTRING (UpperString, "upper")
+IMPLEMENT_DOMSTRING (IndString,   "index")
+
+//=======================================================================
+//function : XmlObjMgt_Array1
+//purpose  : Constructor
+//=======================================================================
+
+XmlObjMgt_Array1::XmlObjMgt_Array1 (const XmlObjMgt_Element&   theParent,
+                                    const XmlObjMgt_DOMString& theName)
+     : myElement            (XmlObjMgt::FindChildByName (theParent, theName)),
+       myFirst              (1),
+       myLast               (0)
+{
+  if (myElement != NULL) {
+    if (!myElement.getAttribute(::LowerString()).GetInteger(myFirst))
+      myFirst = 1;
+    if (!myElement.getAttribute(::UpperString()).GetInteger (myLast))
+      myLast = 1;
+  }
+}
+
+//=======================================================================
+//function : XmlObjMgt_Array1
+//purpose  : Constructor
+//=======================================================================
+
+XmlObjMgt_Array1::XmlObjMgt_Array1 (const Standard_Integer aFirst, 
+                                    const Standard_Integer aLast)
+     : myFirst (aFirst), myLast (aLast)
+{}
+
+//=======================================================================
+//function : CreateArrayElement
+//purpose  : Create DOM_Element representing the array, under 'theParent'
+//=======================================================================
+
+void XmlObjMgt_Array1::CreateArrayElement (XmlObjMgt_Element&         theParent,
+                                           const XmlObjMgt_DOMString& theName)
+{
+  if (myLast > 0)
+  {
+//AGV    XmlObjMgt_Document& anOwnerDoc =
+//AGV      (XmlObjMgt_Document&)theParent.getOwnerDocument();
+    XmlObjMgt_Document anOwnerDoc =
+      XmlObjMgt_Document (theParent.getOwnerDocument());
+    myElement = anOwnerDoc.createElement (theName);
+    theParent.appendChild (myElement);
+    if (myLast > 1) {
+      myElement.setAttribute (::UpperString(), myLast);
+      if (myFirst != 1)
+        myElement.setAttribute (::LowerString(), myFirst);
+    }
+  }
+}
+
+//=======================================================================
+//function : SetValue
+//purpose  : 
+//=======================================================================
+
+void XmlObjMgt_Array1::SetValue
+            (const Standard_Integer theIndex, XmlObjMgt_Element& theValue)
+{
+  myElement.appendChild (theValue);
+  theValue.setAttribute(::IndString(), theIndex);
+}
+
+//=======================================================================
+//function : Value
+//purpose  : 
+//=======================================================================
+
+XmlObjMgt_Element XmlObjMgt_Array1::Value(const Standard_Integer theIndex) const
+{
+  XmlObjMgt_Element anElem;
+
+  if (theIndex >= myFirst && theIndex <= myLast)
+  {
+    Standard_Integer ind;
+    LDOM_Node aNode = myElement.getFirstChild();
+    while (!aNode.isNull())
+    {
+      if (aNode.getNodeType() == LDOM_Node::ELEMENT_NODE)
+      {
+        anElem = (XmlObjMgt_Element &) aNode;
+        if (anElem.getAttribute(::IndString()).GetInteger(ind))
+          if (ind == theIndex)
+            break;
+      }
+      aNode = aNode.getNextSibling();
+    }
+  }
+  return anElem;
+}
diff --git a/src/XmlObjMgt/XmlObjMgt_Array1.gxx b/src/XmlObjMgt/XmlObjMgt_Array1.gxx
deleted file mode 100644 (file)
index 12ba063..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-// Created on: 2001-08-01
-// Created by: Julia DOROVSKIKH
-// Copyright (c) 2001-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 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.
-
-//AGV 130202: Changed prototype LDOM_Node::getOwnerDocument()
-
-#include <XmlObjMgt.hxx>
-#include <XmlObjMgt_DOMString.hxx>
-#include <TCollection_AsciiString.hxx>
-
-IMPLEMENT_DOMSTRING (LowerString, "lower")
-IMPLEMENT_DOMSTRING (UpperString, "upper")
-IMPLEMENT_DOMSTRING (IndString,   "index")
-
-//=======================================================================
-//function : XmlObjMgt_Array1
-//purpose  : Constructor
-//=======================================================================
-
-XmlObjMgt_Array1::XmlObjMgt_Array1 (const XmlObjMgt_Element&   theParent,
-                                    const XmlObjMgt_DOMString& theName)
-     : myElement            (XmlObjMgt::FindChildByName (theParent, theName)),
-       myFirst              (1),
-       myLast               (0)
-{
-  if (myElement != NULL) {
-    if (!myElement.getAttribute(::LowerString()).GetInteger(myFirst))
-      myFirst = 1;
-    if (!myElement.getAttribute(::UpperString()).GetInteger (myLast))
-      myLast = 1;
-  }
-}
-
-//=======================================================================
-//function : XmlObjMgt_Array1
-//purpose  : Constructor
-//=======================================================================
-
-XmlObjMgt_Array1::XmlObjMgt_Array1 (const Standard_Integer aFirst, 
-                                    const Standard_Integer aLast)
-     : myFirst (aFirst), myLast (aLast)
-{}
-
-//=======================================================================
-//function : CreateArrayElement
-//purpose  : Create DOM_Element representing the array, under 'theParent'
-//=======================================================================
-
-void XmlObjMgt_Array1::CreateArrayElement (XmlObjMgt_Element&         theParent,
-                                           const XmlObjMgt_DOMString& theName)
-{
-  if (myLast > 0)
-  {
-//AGV    XmlObjMgt_Document& anOwnerDoc =
-//AGV      (XmlObjMgt_Document&)theParent.getOwnerDocument();
-    XmlObjMgt_Document anOwnerDoc =
-      XmlObjMgt_Document (theParent.getOwnerDocument());
-    myElement = anOwnerDoc.createElement (theName);
-    theParent.appendChild (myElement);
-    if (myLast > 1) {
-      myElement.setAttribute (::UpperString(), myLast);
-      if (myFirst != 1)
-        myElement.setAttribute (::LowerString(), myFirst);
-    }
-  }
-}
-
-//=======================================================================
-//function : SetValue
-//purpose  : 
-//=======================================================================
-
-void XmlObjMgt_Array1::SetValue
-            (const Standard_Integer theIndex, XmlObjMgt_Element& theValue)
-{
-  myElement.appendChild (theValue);
-  theValue.setAttribute(::IndString(), theIndex);
-}
-
-//=======================================================================
-//function : Value
-//purpose  : 
-//=======================================================================
-
-XmlObjMgt_Element XmlObjMgt_Array1::Value(const Standard_Integer theIndex) const
-{
-  XmlObjMgt_Element anElem;
-
-  if (theIndex >= myFirst && theIndex <= myLast)
-  {
-    Standard_Integer ind;
-    LDOM_Node aNode = myElement.getFirstChild();
-    while (!aNode.isNull())
-    {
-      if (aNode.getNodeType() == LDOM_Node::ELEMENT_NODE)
-      {
-        anElem = (XmlObjMgt_Element &) aNode;
-        if (anElem.getAttribute(::IndString()).GetInteger(ind))
-          if (ind == theIndex)
-            break;
-      }
-      aNode = aNode.getNextSibling();
-    }
-  }
-  return anElem;
-}