0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / XmlObjMgt / XmlObjMgt_Array1.hxx
1 // Created on: 1992-11-25
2 // Created by: Julia DOROVSKIKH
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _XmlObjMgt_Array1_HeaderFile
18 #define _XmlObjMgt_Array1_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <XmlObjMgt_Element.hxx>
25 #include <Standard_Integer.hxx>
26 #include <XmlObjMgt_DOMString.hxx>
27
28
29 //! The class Array1 represents unidimensionnal
30 //! array of fixed size known at run time.
31 //! The range of the index is user defined.
32 //! Warning: Programs clients of such class must be independant
33 //! of the range of the first element. Then, a C++ for
34 //! loop must be written like this
35 //! for (i = A->Lower(); i <= A->Upper(); i++)
36 class XmlObjMgt_Array1 
37 {
38 public:
39
40   DEFINE_STANDARD_ALLOC
41
42   
43   //! Create an array of lower bound <Low> and
44   //! upper bound <Up>. Range error is raised
45   //! when <Up> is less than <Low>.
46   Standard_EXPORT XmlObjMgt_Array1(const Standard_Integer Low, const Standard_Integer Up);
47   
48   //! for restoration from DOM_Element which is child of
49   //! theParent:
50   //! <theParent ...>
51   //! <theName ...>
52   Standard_EXPORT XmlObjMgt_Array1(const XmlObjMgt_Element& theParent, const XmlObjMgt_DOMString& theName);
53   
54   //! Create DOM_Element representing the array, under 'theParent'
55   Standard_EXPORT void CreateArrayElement (XmlObjMgt_Element& theParent, const XmlObjMgt_DOMString& theName);
56   
57   //! Returns the DOM element of <me>.
58     const XmlObjMgt_Element& Element() const;
59   
60   //! Returns the number of elements of <me>.
61     Standard_Integer Length() const;
62   
63   //! Returns the lower bound.
64     Standard_Integer Lower() const;
65   
66   //! Returns the upper bound.
67     Standard_Integer Upper() const;
68   
69   //! Set the <Index>th element of the array to <Value>.
70   Standard_EXPORT void SetValue (const Standard_Integer Index, XmlObjMgt_Element& Value);
71   
72   //! Returns the value of <Index>th element of the array.
73   Standard_EXPORT XmlObjMgt_Element Value (const Standard_Integer Index) const;
74
75
76
77
78 protected:
79
80
81
82
83
84 private:
85
86
87
88   XmlObjMgt_Element myElement;
89   Standard_Integer myFirst;
90   Standard_Integer myLast;
91
92
93 };
94
95
96 #include <XmlObjMgt_Array1.lxx>
97
98
99
100
101
102 #endif // _XmlObjMgt_Array1_HeaderFile