0023024: Update headers of OCCT files
[occt.git] / src / TCollection / TCollection_Array1.lxx
CommitLineData
b311480e 1// Copyright (c) 1998-1999 Matra Datavision
2// Copyright (c) 1999-2012 OPEN CASCADE SAS
3//
4// The content of this file is subject to the Open CASCADE Technology Public
5// License Version 6.5 (the "License"). You may not use the content of this file
6// except in compliance with the License. Please obtain a copy of the License
7// at http://www.opencascade.org and read it completely before using this file.
8//
9// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
10// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11//
12// The Original Code and all software distributed under the License is
13// distributed on an "AS IS" basis, without warranty of any kind, and the
14// Initial Developer hereby disclaims all such warranties, including without
15// limitation, any warranties of merchantability, fitness for a particular
16// purpose or non-infringement. Please see the License for the specific terms
17// and conditions governing the rights and limitations under the License.
18
7fd59977 19#include <Standard_OutOfRange.hxx>
20
21#include Array1Item_hxx
22
23//=======================================================================
24//function : Length
25//purpose :
26//=======================================================================
27
28inline Standard_Integer TCollection_Array1::Length () const
29{
30 return myUpperBound - myLowerBound + 1 ;
31}
32
33
34//=======================================================================
35//function : Lower
36//purpose :
37//=======================================================================
38
39inline Standard_Integer TCollection_Array1::Lower () const
40{
41 return myLowerBound ;
42}
43
44
45//=======================================================================
46//function : Upper
47//purpose :
48//=======================================================================
49
50inline Standard_Integer TCollection_Array1::Upper () const
51{
52 return myUpperBound ;
53}
54
55
56//=======================================================================
57//function : IsAllocated
58//purpose :
59//=======================================================================
60
61inline Standard_Boolean TCollection_Array1::IsAllocated () const
62{
63 return isAllocated;
64}
65
66//=======================================================================
67//function : Value
68//purpose :
69//=======================================================================
70
71inline const Array1Item& TCollection_Array1::Value
72(const Standard_Integer Index) const
73{
74 Standard_OutOfRange_Raise_if((Index < myLowerBound || Index > myUpperBound),NULL);
75 return ((Array1Item *)myStart)[Index];
76}
77
78//=======================================================================
79//function : SetValue
80//purpose :
81//=======================================================================
82
83inline void TCollection_Array1::SetValue (const Standard_Integer Index,
84 const Array1Item& Value)
85{
86 Standard_OutOfRange_Raise_if((Index < myLowerBound || Index > myUpperBound),NULL);
87
88 ((Array1Item *)myStart)[Index] = Value ;
89}
90
91
92//=======================================================================
93//function : ChangeValue
94//purpose :
95//=======================================================================
96
97inline Array1Item& TCollection_Array1::ChangeValue(const Standard_Integer Index)
98{
99 Standard_OutOfRange_Raise_if((Index < myLowerBound || Index > myUpperBound),NULL);
100
101 return ((Array1Item *)myStart)[Index];
102}
103
104
105