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