0024830: Remove redundant keyword 'mutable' in CDL declarations
[occt.git] / src / DBC / DBC_VArray.cdl
1 -- Created on: 1996-01-30
2 -- Created by: Kernel
3 -- Copyright (c) 1996-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 generic class VArray from DBC (Item as Storable) inherits BaseArray from DBC
18
19         ---Purpose: The class VArray represents a unidimensional 
20         --          array of fixed size known at  execution time. 
21         --          The range of the element is user defined and varies
22         --          from 0 to N - 1.
23         --  Warning: Programs client of such a class must be independant
24         --          of the range of the last element. Thus, a C++ "for"
25         --          loop must be written like this
26         --
27         --          for (i = 0; i < A.Size(); i++)
28         --  Implement for ObjectStore and Objectivity
29         --           with the same functionnality           
30         --  Purpose: New development for OBJY 3.5
31
32 uses
33     BaseArray from DBC
34     
35 raises NegativeValue, OutOfRange , DimensionMismatch, NullObject
36
37     class VArrayNode from DBC
38       inherits ArrayNode from PStandard
39       is
40       
41         Create returns VArrayNode from DBC;
42         Create(aValue : Item)  returns VArrayNode from DBC;
43         
44         SetValue(me : mutable; aValue : Item);
45         Value(me) returns Address from Standard;
46         
47       fields
48         myValue : Item;
49       end;
50      
51      ---Purpose: for DFLT profile, we dont need persistent nodes      
52      class VArrayTNode from DBC
53       is
54         Create returns VArrayTNode from DBC;
55         ---C++: inline
56         Create(aValue : Item)  returns VArrayTNode from DBC;
57         ---C++: inline
58         SetValue(me : out; aValue : Item);
59         ---C++: inline
60         Value(me) returns Address from Standard;
61         ---C++: inline
62
63       fields
64         myValue : Item;
65       end;
66       
67 is
68
69         Create returns VArray;
70             ---Puspose: Creates an array of null size
71             --          Raise NullOject if there is no
72             --          default database
73         
74         Create (Size: Integer) returns VArray
75                 ---Purpose: Creates an array of lower bound 0 and 
76                 --          upper bound <Size>-1 . NegativeValue is raised 
77                 --          when <Size> is less than 0.
78                 raises NegativeValue;
79
80         Create (Varray: VArray) returns VArray;
81                 ---Purpose: Creates an array which  is the copy of the given
82                 --          argument.
83
84
85         Resize (me : in out; Size: Integer)
86            raises NegativeValue;
87         ---Purpose: Change the size of an array with lower 
88         --          bound 0 and upper bound <Size>-1 . NegativeValue 
89         --          is raised when <Size> is less than 0.
90
91         Assign (me: in out; Other: VArray from DBC)
92            ---Purpose: copy the contents of <Other> into <me>.
93            --          <Other> and <me> must have the same dimension.
94            ---C++: alias operator = 
95           raises DimensionMismatch from Standard
96             is static;
97             
98         SetValue (me : in out; Index: Integer; Value: Item) 
99                 ---Purpose: Sets the <Index>th element of the array
100                 --          to <Value>.
101                 raises OutOfRange
102                 is static ;
103
104
105         Value (me; Index: Integer) returns Item
106                 ---Purpose: Returns the value of the <Index>th element
107                 --          of the array.
108                 ---C++: alias operator ()
109                 ---C++: return &
110                 raises OutOfRange
111                 is static;
112
113         Destroy(me : in out);
114         ---C++: alias ~
115
116 end VArray ;