0023024: Update headers of OCCT files
[occt.git] / src / PDataStd / PDataStd_IntPackedMap.cxx
CommitLineData
b311480e 1// Created on: 2007-08-22
2// Created by: Sergey ZARITCHNY
3// Copyright (c) 2007-2012 OPEN CASCADE SAS
4//
5// The content of this file is subject to the Open CASCADE Technology Public
6// License Version 6.5 (the "License"). You may not use the content of this file
7// except in compliance with the License. Please obtain a copy of the License
8// at http://www.opencascade.org and read it completely before using this file.
9//
10// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12//
13// The Original Code and all software distributed under the License is
14// distributed on an "AS IS" basis, without warranty of any kind, and the
15// Initial Developer hereby disclaims all such warranties, including without
16// limitation, any warranties of merchantability, fitness for a particular
17// purpose or non-infringement. Please see the License for the specific terms
18// and conditions governing the rights and limitations under the License.
19
7fd59977 20
21#include <PDataStd_IntPackedMap.ixx>
22#include <PColStd_HArray1OfInteger.hxx>
23//=======================================================================
24//function : PDataStd_IntPackedMap
25//purpose : Constructor
26//=======================================================================
27PDataStd_IntPackedMap::PDataStd_IntPackedMap() {}
28
29//=======================================================================
30//function : Init
31//purpose : Initializes the internal container
32//=======================================================================
33void PDataStd_IntPackedMap::Init(const Standard_Integer theLow,
34const Standard_Integer theUp) {
35 myIntValues = new PColStd_HArray1OfInteger(theLow, theUp);
36}
37
38//=======================================================================
39//function : GetValue
40//purpose :
41//=======================================================================
42Standard_Integer PDataStd_IntPackedMap::GetValue(
43 const Standard_Integer theIndex) const
44{ return myIntValues->Value(theIndex); }
45
46//=======================================================================
47//function : SetValue
48//purpose :
49//=======================================================================
50void PDataStd_IntPackedMap::SetValue(const Standard_Integer theIndx,
51 const Standard_Integer theValue)
52{
53 myIntValues->SetValue(theIndx, theValue);
54}
55
56//=======================================================================
57//function : IsEmpty
58//purpose :
59//=======================================================================
60Standard_Boolean PDataStd_IntPackedMap::IsEmpty() const
61{
62 if(myIntValues.IsNull()) return Standard_True;
63 if(!myIntValues->Upper() && !myIntValues->Lower()) return Standard_True;
64 return Standard_False;
65}
66
67//=======================================================================
68//function : Returns an upper bound of the internal container
69//purpose :
70//=======================================================================
71Standard_Integer PDataStd_IntPackedMap::Upper() const
72{
73 if(myIntValues.IsNull()) return 0;
74 return myIntValues->Upper();
75}
76
77//=======================================================================
78//function : Returns a lower bound of the internal container
79//purpose :
80//=======================================================================
81Standard_Integer PDataStd_IntPackedMap::Lower() const
82{
83 if(myIntValues.IsNull()) return 0;
84 return myIntValues->Lower();
85}