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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _XmlObjMgt_Array1_HeaderFile
18 #define _XmlObjMgt_Array1_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <XmlObjMgt_Element.hxx>
25 #include <Standard_Integer.hxx>
26 #include <XmlObjMgt_DOMString.hxx>
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
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);
48 //! for restoration from DOM_Element which is child of
52 Standard_EXPORT XmlObjMgt_Array1(const XmlObjMgt_Element& theParent, const XmlObjMgt_DOMString& theName);
54 //! Create DOM_Element representing the array, under 'theParent'
55 Standard_EXPORT void CreateArrayElement (XmlObjMgt_Element& theParent, const XmlObjMgt_DOMString& theName);
57 //! Returns the DOM element of <me>.
58 const XmlObjMgt_Element& Element() const;
60 //! Returns the number of elements of <me>.
61 Standard_Integer Length() const;
63 //! Returns the lower bound.
64 Standard_Integer Lower() const;
66 //! Returns the upper bound.
67 Standard_Integer Upper() const;
69 //! Set the <Index>th element of the array to <Value>.
70 Standard_EXPORT void SetValue (const Standard_Integer Index, XmlObjMgt_Element& Value);
72 //! Returns the value of <Index>th element of the array.
73 Standard_EXPORT XmlObjMgt_Element Value (const Standard_Integer Index) const;
88 XmlObjMgt_Element myElement;
89 Standard_Integer myFirst;
90 Standard_Integer myLast;
96 #include <XmlObjMgt_Array1.lxx>
102 #endif // _XmlObjMgt_Array1_HeaderFile