0003513: There is no check for boundary of array in method Set for array attributes
[occt.git] / src / TDataStd / TDataStd_RealArray.cdl
1 -- Created on: 1999-06-16
2 -- Created by: Sergey RUIN
3 -- Copyright (c) 1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
10 --
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 --
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
20
21
22
23 class RealArray from TDataStd inherits Attribute from TDF
24
25         ---Purpose: A framework for an attribute composed of a real number array.
26
27 uses  
28      HArray1OfReal            from TColStd, 
29      GUID                     from Standard,     
30      Attribute                from TDF,
31      Label                    from TDF, 
32      DeltaOnModification      from TDF,
33      RelocationTable          from TDF
34
35 is 
36
37     ---Purpose: class methods
38     --          =============
39
40     GetID (myclass)   
41         ---C++: return const & 
42         ---Purpose: Returns the GUID for arrays of reals.  
43     returns GUID from Standard;
44
45     Set (myclass; label : Label from TDF; lower, upper : Integer from Standard; 
46                   isDelta : Boolean from Standard = Standard_False)
47         ---Purpose: Finds or creates on the <label> a real array attribute 
48         -- with the specified <lower> and <upper> boundaries.  
49         -- If attribute is already set, all input parameters are refused and the found
50         -- attribute is returned.
51     returns RealArray from TDataStd;
52
53     
54     ---Category: RealArray methods
55     --          ===============
56
57     Init(me : mutable; lower, upper : Integer from Standard);
58     ---Purpose: Initialize the inner array with bounds from <lower> to <upper>  
59
60     SetValue (me : mutable; Index :Integer from Standard; Value : Real from Standard);
61     ---Purpose: Sets  the   <Index>th  element  of   the  array to <Value>
62     -- OutOfRange exception is raised if <Index> doesn't respect Lower and Upper bounds of the internal  array.
63
64     Value (me; Index : Integer from Standard)
65     ---Purpose: Return the value of  the  <Index>th element of the array
66     --
67     ---C++: alias operator ()
68     returns Real from Standard;
69
70     Lower (me) returns Integer from Standard;      
71     ---Purpose:  Returns the lower boundary of the array.
72
73     Upper (me) returns Integer from Standard;
74     ---Purpose: Returns the upper boundary of the array.
75     
76     Length (me) returns Integer from Standard;    
77     ---Purpose: Returns the number of elements of the array of reals
78     --    in terms of the number of elements it contains.
79     
80     ChangeArray(me : mutable; newArray : HArray1OfReal from TColStd; 
81                               isCheckItems : Boolean = Standard_True);      
82         ---Purpose: Sets the inner array <myValue> of the RealArray attribute  
83         -- to <newArray>. If value of <newArray> differs from <myValue>, 
84         -- Backup performed and myValue refers to new instance of HArray1OfReal 
85         -- that holds <newArray> values 
86         -- If <isCheckItems> equal True each item of <newArray> will be checked with each 
87         -- item of <myValue> for coincidence (to avoid backup).
88     
89     Array(me) returns HArray1OfReal from TColStd;
90     ---Purpose: Returns the handle of this array of reals.
91     ---C++: inline 
92     ---C++: return const 
93      
94     GetDelta(me) returns Boolean from Standard;  
95     ---C++: inline  
96     
97     SetDelta(me : mutable; isDelta : Boolean from Standard);     
98     ---C++: inline  
99     ---Purpose: for  internal  use  only!  
100      
101     RemoveArray(me  : mutable) is private;      
102     ---C++: inline      
103     
104     ---Category: methodes of TDF_Attribute
105     --           =========================
106     Create    
107     returns mutable RealArray from TDataStd; 
108     
109     ID (me)
110         ---C++: return const & 
111     returns GUID from Standard;
112
113     Restore (me: mutable; With : Attribute from TDF);
114
115     NewEmpty (me)
116     returns mutable Attribute from TDF;
117
118     Paste (me; Into : mutable Attribute from TDF;
119                RT   : mutable RelocationTable from TDF);    
120     ---Purpose: Note. Uses inside ChangeArray() method 
121     
122     Dump(me; anOS : in out OStream from Standard)
123         returns OStream from Standard
124         is redefined;
125         ---C++: return &
126
127     ---Category: methods to be added for using in DeltaOnModification  
128     --           =====================================================
129     DeltaOnModification(me; anOldAttribute : Attribute from TDF)
130         returns DeltaOnModification from TDF
131         ---Purpose : Makes a DeltaOnModification between <me> and
132         --         <anOldAttribute>.  
133         is redefined virtual;  
134 fields
135
136     myValue : HArray1OfReal from TColStd;
137     myIsDelta : Boolean from Standard; 
138      
139 friends   
140
141     class DeltaOnModificationOfRealArray from TDataStd  
142      
143 end RealArray;