b311480e |
1 | // Created on: 2008-01-21 |
2 | // Created by: Galina KULIKOVA |
973c2be1 |
3 | // Copyright (c) 2008-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
6 | // |
d5f74e42 |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
7fd59977 |
15 | |
42cf5bc1 |
16 | |
17 | #include <Interface_FileParameter.hxx> |
18 | #include <Interface_ParamList.hxx> |
19 | #include <Standard_OutOfMemory.hxx> |
20 | #include <Standard_OutOfRange.hxx> |
21 | #include <Standard_RangeError.hxx> |
22 | #include <Standard_Type.hxx> |
7fd59977 |
23 | |
25e59720 |
24 | IMPLEMENT_STANDARD_RTTIEXT(Interface_ParamList,Standard_Transient) |
92efcf78 |
25 | |
7fd59977 |
26 | //======================================================================= |
27 | //function : Interface_ParamList |
28 | //purpose : |
29 | //======================================================================= |
7fd59977 |
30 | Interface_ParamList::Interface_ParamList(const Standard_Integer theIncrement) : |
31 | myVector (theIncrement) |
32 | { |
33 | |
34 | } |
35 | |
36 | //======================================================================= |
37 | //function : SetValue |
38 | //purpose : |
39 | //======================================================================= |
40 | |
41 | void Interface_ParamList::SetValue(const Standard_Integer theIndex,const Interface_FileParameter& theValue) |
42 | { |
43 | Standard_Integer ind = theIndex-1; |
44 | myVector.SetValue(ind,theValue); |
45 | } |
46 | |
47 | |
48 | //======================================================================= |
49 | //function : Value |
50 | //purpose : |
51 | //======================================================================= |
52 | |
53 | const Interface_FileParameter& Interface_ParamList::Value(const Standard_Integer theIndex) const |
54 | { |
55 | Standard_Integer ind = theIndex-1; |
56 | return myVector.Value(ind); |
57 | } |
58 | |
59 | |
60 | //======================================================================= |
61 | //function : ChangeValue |
62 | //purpose : |
63 | //======================================================================= |
64 | |
65 | Interface_FileParameter& Interface_ParamList::ChangeValue(const Standard_Integer theIndex) |
66 | { |
67 | Standard_Integer ind = theIndex-1; |
68 | if(ind >= myVector.Length()) |
69 | { |
70 | Interface_FileParameter aFP; |
71 | myVector.SetValue(ind,aFP); |
72 | } |
73 | return myVector.ChangeValue(ind); |
74 | } |
75 | |
76 | void Interface_ParamList::Clear() |
77 | { |
78 | myVector.Clear(); |
79 | } |