1 // Copyright (c) 1998-1999 Matra Datavision
2 // Copyright (c) 1999-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #include <Standard.hxx>
16 #include <Standard_OutOfRange.hxx>
18 #include Array2Item_hxx
20 //=======================================================================
21 //function : ColLength
23 //=======================================================================
24 inline Standard_Integer TCollection_Array2::ColLength () const
26 return myUpperRow - myLowerRow + 1 ;
29 //=======================================================================
32 //=======================================================================
33 inline Standard_Integer TCollection_Array2::LowerCol () const
35 return myLowerColumn ;
38 //=======================================================================
41 //=======================================================================
42 inline Standard_Integer TCollection_Array2::LowerRow () const
47 //=======================================================================
48 //function : RowLength
50 //=======================================================================
51 inline Standard_Integer TCollection_Array2::RowLength () const
53 return myUpperColumn - myLowerColumn + 1 ;
56 //=======================================================================
59 //=======================================================================
60 inline Standard_Integer TCollection_Array2::UpperRow () const
65 //=======================================================================
68 //=======================================================================
69 inline Standard_Integer TCollection_Array2::UpperCol () const
71 return myUpperColumn ;
74 //=======================================================================
77 //=======================================================================
79 inline void TCollection_Array2::SetValue ( const Standard_Integer Row,
80 const Standard_Integer Col,
81 const Array2Item& Value )
83 Standard_OutOfRange_Raise_if((Row < myLowerRow || Row > myUpperRow ||
84 Col < myLowerColumn || Col > myUpperColumn),
87 ((Array2Item **)myData)[Row][Col] = Value ;
90 //=======================================================================
93 //=======================================================================
94 inline const Array2Item& TCollection_Array2::Value(const Standard_Integer Row,
95 const Standard_Integer Col) const
97 Standard_OutOfRange_Raise_if((Row < myLowerRow || Row > myUpperRow ||
98 Col < myLowerColumn || Col > myUpperColumn),
101 return ((Array2Item **)myData)[Row][Col];
104 //=======================================================================
105 //function : ChangeValue
107 //=======================================================================
109 inline Array2Item& TCollection_Array2::ChangeValue(const Standard_Integer Row,
110 const Standard_Integer Col)
112 Standard_OutOfRange_Raise_if((Row < myLowerRow || Row > myUpperRow ||
113 Col < myLowerColumn || Col > myUpperColumn),
116 return ((Array2Item **)myData)[Row][Col];