7fd59977 |
1 | // File: PDataStd_ReferenceArray.cxx |
2 | // Created: May 29 11:40:00 2007 |
3 | // Author: Vlad Romashko |
4 | // <vladislav.romashko@opencascade.com> |
5 | // Copyright: Open CASCADE |
6 | |
7 | #include <PDataStd_ReferenceArray.ixx> |
8 | |
9 | //======================================================================= |
10 | //function : PDataStd_ReferenceArray |
11 | //purpose : |
12 | //======================================================================= |
13 | PDataStd_ReferenceArray::PDataStd_ReferenceArray() |
14 | { |
15 | |
16 | } |
17 | |
18 | //======================================================================= |
19 | //function : Init |
20 | //purpose : |
21 | //======================================================================= |
22 | void PDataStd_ReferenceArray::Init(const Standard_Integer lower, |
23 | const Standard_Integer upper) |
24 | { |
25 | if (upper >= lower) |
26 | myValue = new PColStd_HArray1OfExtendedString(lower, upper); |
27 | } |
28 | |
29 | //======================================================================= |
30 | //function : SetValue |
31 | //purpose : |
32 | //======================================================================= |
33 | void PDataStd_ReferenceArray::SetValue(const Standard_Integer index, const Handle(PCollection_HExtendedString)& value) |
34 | { |
35 | myValue->SetValue(index, value); |
36 | } |
37 | |
38 | //======================================================================= |
39 | //function : Value |
40 | //purpose : |
41 | //======================================================================= |
42 | Handle(PCollection_HExtendedString) PDataStd_ReferenceArray::Value( const Standard_Integer index ) const |
43 | { |
44 | return myValue->Value(index); |
45 | } |
46 | |
47 | //======================================================================= |
48 | //function : Lower |
49 | //purpose : |
50 | //======================================================================= |
51 | Standard_Integer PDataStd_ReferenceArray::Lower (void) const |
52 | { |
53 | if (!myValue.IsNull()) |
54 | return myValue->Lower(); |
55 | return 0; |
56 | } |
57 | |
58 | //======================================================================= |
59 | //function : Upper |
60 | //purpose : |
61 | //======================================================================= |
62 | Standard_Integer PDataStd_ReferenceArray::Upper (void) const |
63 | { |
64 | if (!myValue.IsNull()) |
65 | return myValue->Upper(); |
66 | return -1; |
67 | } |