Integration of OCCT 6.5.0 from SVN
[occt.git] / src / TCollection / TCollection_Array1.lxx
1 #include <Standard_OutOfRange.hxx>
2
3 #include Array1Item_hxx
4
5 //=======================================================================
6 //function : Length
7 //purpose  : 
8 //=======================================================================
9
10 inline Standard_Integer TCollection_Array1::Length () const 
11 {
12         return myUpperBound - myLowerBound + 1 ;
13 }
14
15
16 //=======================================================================
17 //function : Lower
18 //purpose  : 
19 //=======================================================================
20
21 inline Standard_Integer TCollection_Array1::Lower () const
22 {
23         return myLowerBound ;
24 }
25
26
27 //=======================================================================
28 //function : Upper
29 //purpose  : 
30 //=======================================================================
31
32 inline Standard_Integer TCollection_Array1::Upper () const
33 {
34         return myUpperBound ;
35 }
36
37
38 //=======================================================================
39 //function : IsAllocated
40 //purpose  : 
41 //=======================================================================
42
43 inline Standard_Boolean TCollection_Array1::IsAllocated () const
44 {
45  return isAllocated;
46 }
47
48 //=======================================================================
49 //function : Value
50 //purpose  : 
51 //=======================================================================
52
53 inline const Array1Item& TCollection_Array1::Value
54 (const Standard_Integer Index) const
55 {
56   Standard_OutOfRange_Raise_if((Index < myLowerBound || Index > myUpperBound),NULL);
57   return ((Array1Item *)myStart)[Index];
58 }
59
60 //=======================================================================
61 //function : SetValue
62 //purpose  : 
63 //=======================================================================
64
65 inline  void TCollection_Array1::SetValue (const Standard_Integer Index,
66                                    const Array1Item& Value)
67 {
68   Standard_OutOfRange_Raise_if((Index < myLowerBound || Index > myUpperBound),NULL);
69
70   ((Array1Item *)myStart)[Index] = Value ;
71 }
72
73
74 //=======================================================================
75 //function : ChangeValue
76 //purpose  : 
77 //=======================================================================
78
79 inline Array1Item& TCollection_Array1::ChangeValue(const Standard_Integer Index)
80 {
81   Standard_OutOfRange_Raise_if((Index < myLowerBound || Index > myUpperBound),NULL);
82
83   return ((Array1Item *)myStart)[Index];
84 }
85
86
87