7fd59977 |
1 | -- File: TFunction_Scope.cdl |
2 | -- Created: Mon Jun 22 11:25:42 2008 |
3 | -- Author: Vladislav ROMASHKO |
4 | -- <vladislav.romashko@opencascade.com> |
5 | ---Copyright: Open CASCADE S.A. |
6 | |
7 | class Scope from TFunction inherits Attribute from TDF |
8 | |
9 | ---Purpose: Keeps a scope of functions. |
10 | |
11 | uses |
12 | |
13 | GUID from Standard, |
14 | OStream from Standard, |
15 | Attribute from TDF, |
16 | RelocationTable from TDF, |
17 | DataSet from TDF, |
18 | Label from TDF, |
19 | Logbook from TFunction, |
20 | DoubleMapOfIntegerLabel from TFunction |
21 | |
22 | is |
23 | |
24 | ---Purpose: Static methods |
25 | -- ============== |
26 | |
27 | Set (myclass; Access : Label from TDF) |
28 | ---Purpose: Finds or Creates a TFunction_Scope attribute at the root label accessed by <Access>. |
29 | -- Returns the attribute. |
30 | returns Scope from TFunction; |
31 | |
32 | GetID (myclass) |
33 | ---Purpose: Returns the GUID for Scope attribute. |
34 | ---C++: return const & |
35 | returns GUID from Standard; |
36 | |
37 | |
38 | ---Purpose: Instant methods |
39 | -- =============== |
40 | |
41 | Create |
42 | ---Purpose: Constructor (empty). |
43 | returns mutable Scope from TFunction; |
44 | |
45 | |
46 | AddFunction (me : mutable; |
47 | L : Label from TDF) |
48 | ---Purpose: Adds a function to the scope of functions. |
49 | returns Boolean from Standard; |
50 | |
51 | RemoveFunction (me : mutable; |
52 | L : Label from TDF) |
53 | ---Purpose: Removes a function from the scope of functions. |
54 | returns Boolean from Standard; |
55 | |
56 | RemoveFunction (me : mutable; |
57 | ID : Integer from Standard) |
58 | ---Purpose: Removes a function from the scope of functions. |
59 | returns Boolean from Standard; |
60 | |
61 | RemoveAllFunctions (me : mutable); |
62 | ---Purpose: Removes all functions from the scope of functions. |
63 | |
64 | |
65 | ---Category: Access to the functions and their IDs |
66 | -- ===================================== |
67 | |
68 | HasFunction (me; |
69 | ID : Integer from Standard) |
70 | ---Purpose: Returns true if the function exists with such an ID. |
71 | returns Boolean from Standard; |
72 | |
73 | HasFunction (me; |
74 | L : Label from TDF) |
75 | ---Purpose: Returns true if the label contains a function of this scope. |
76 | returns Boolean from Standard; |
77 | |
78 | GetFunction (me; |
79 | L : Label from TDF) |
80 | ---Purpose: Returns an ID of the function. |
81 | returns Integer from Standard; |
82 | |
83 | GetFunction (me; |
84 | ID : Integer from Standard) |
85 | ---Purpose: Returns the label of the function with this ID. |
86 | ---C++: return const & |
87 | returns Label from TDF; |
88 | |
89 | |
90 | ---Category: Logbook |
91 | -- ======= |
92 | |
93 | GetLogbook (me : mutable) |
94 | ---Purpose: Returns the Logbook used in TFunction_Driver methods. |
95 | ---C++: return & |
96 | returns Logbook from TFunction; |
97 | |
98 | |
99 | ---Purpose: Implementation of Attribute methods |
100 | -- =================================== |
101 | |
102 | ID (me) |
103 | ---C++: return const & |
104 | returns GUID from Standard; |
105 | |
106 | Restore (me: mutable; with : Attribute from TDF) |
107 | is virtual; |
108 | |
109 | Paste (me; into : mutable Attribute from TDF; |
110 | RT : mutable RelocationTable from TDF) |
111 | is virtual; |
112 | |
113 | NewEmpty (me) |
114 | returns mutable Attribute from TDF |
115 | is redefined; |
116 | |
117 | Dump (me; anOS : in out OStream from Standard) |
118 | ---C++: return & |
119 | returns OStream from Standard |
120 | is redefined; |
121 | |
122 | |
123 | ---Category: Private methods |
124 | -- =============== |
125 | |
126 | GetFunctions (me) |
127 | ---Purpose: Returns the scope of functions. |
128 | ---C++: return const & |
129 | returns DoubleMapOfIntegerLabel from TFunction; |
130 | |
131 | ChangeFunctions (me : mutable) |
132 | ---Purpose: Returns the scope of functions for modification. |
133 | -- Warning: Don't use this method if You are not sure what You do! |
134 | ---C++: return & |
135 | returns DoubleMapOfIntegerLabel from TFunction; |
136 | |
137 | SetFreeID (me : mutable; |
138 | ID : Integer from Standard); |
139 | |
140 | GetFreeID (me) |
141 | returns Integer from Standard; |
142 | |
143 | |
144 | fields |
145 | |
146 | myFunctions : DoubleMapOfIntegerLabel from TFunction; |
147 | myLogbook : Logbook from TFunction; |
148 | myFreeID : Integer from Standard; |
149 | |
150 | end Scope; |