Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:36

0001 // Created on: 1992-11-25
0002 // Created by: Julia DOROVSKIKH
0003 // Copyright (c) 1992-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _XmlObjMgt_Array1_HeaderFile
0018 #define _XmlObjMgt_Array1_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <XmlObjMgt_Element.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <XmlObjMgt_DOMString.hxx>
0026 
0027 
0028 //! The class Array1 represents unidimensional
0029 //! array of fixed size known at run time.
0030 //! The range of the index is user defined.
0031 //! Warning: Programs clients of such class must be independent
0032 //! of the range of the first element. Then, a C++ for
0033 //! loop must be written like this
0034 //! for (i = A->Lower(); i <= A->Upper(); i++)
0035 class XmlObjMgt_Array1 
0036 {
0037 public:
0038 
0039   DEFINE_STANDARD_ALLOC
0040 
0041   
0042   //! Create an array of lower bound <Low> and
0043   //! upper bound <Up>. Range error is raised
0044   //! when <Up> is less than <Low>.
0045   Standard_EXPORT XmlObjMgt_Array1(const Standard_Integer Low, const Standard_Integer Up);
0046   
0047   //! for restoration from DOM_Element which is child of
0048   //! theParent:
0049   //! <theParent ...>
0050   //! <theName ...>
0051   Standard_EXPORT XmlObjMgt_Array1(const XmlObjMgt_Element& theParent, const XmlObjMgt_DOMString& theName);
0052   
0053   //! Create DOM_Element representing the array, under 'theParent'
0054   Standard_EXPORT void CreateArrayElement (XmlObjMgt_Element& theParent, const XmlObjMgt_DOMString& theName);
0055   
0056   //! Returns the DOM element of <me>.
0057     const XmlObjMgt_Element& Element() const;
0058   
0059   //! Returns the number of elements of <me>.
0060     Standard_Integer Length() const;
0061   
0062   //! Returns the lower bound.
0063     Standard_Integer Lower() const;
0064   
0065   //! Returns the upper bound.
0066     Standard_Integer Upper() const;
0067   
0068   //! Set the <Index>th element of the array to <Value>.
0069   Standard_EXPORT void SetValue (const Standard_Integer Index, XmlObjMgt_Element& Value);
0070   
0071   //! Returns the value of <Index>th element of the array.
0072   Standard_EXPORT XmlObjMgt_Element Value (const Standard_Integer Index) const;
0073 
0074 
0075 
0076 
0077 protected:
0078 
0079 
0080 
0081 
0082 
0083 private:
0084 
0085 
0086 
0087   XmlObjMgt_Element myElement;
0088   Standard_Integer myFirst;
0089   Standard_Integer myLast;
0090 
0091 
0092 };
0093 
0094 
0095 #include <XmlObjMgt_Array1.lxx>
0096 
0097 
0098 
0099 
0100 
0101 #endif // _XmlObjMgt_Array1_HeaderFile