b311480e |
1 | -- Created on: 1992-06-22 |
2 | -- Created by: Gilles DEBARBOUILLE |
3 | -- Copyright (c) 1992-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | deferred class MethodDefinitionsDictionary from Dynamic |
18 | |
19 | inherits |
20 | |
21 | Transient |
22 | |
23 | ---Purpose: This class groups in a dictionary of all the |
24 | -- various definitions of methods. It also allows the |
25 | -- share of the same definition by more than one |
26 | -- MethodInstance to preserve a global coherence and |
27 | -- also to manage the memory. To use this class an |
28 | -- inheritance is necessary with perhaps the overload |
29 | -- of the Switch method if the parameter types are |
30 | -- not of the type BooleanParameter, |
31 | -- IntegerParameter, RealParameter and |
32 | -- StringParameter. |
33 | |
34 | uses |
35 | |
36 | CString from Standard, |
37 | OStream from Standard, |
38 | Boolean from Standard, |
39 | Integer from Standard, |
40 | HAsciiString from TCollection, |
41 | Parameter from Dynamic, |
42 | SequenceOfMethodDefinitions from Dynamic, |
43 | Method from Dynamic |
44 | |
45 | is |
46 | |
47 | Initialize; |
48 | |
49 | ---Level: Internal |
50 | |
51 | ---Purpose: Deferred constructor of the class. |
52 | |
53 | Creates(me : mutable ; afilename : CString from Standard) |
54 | |
55 | ---Level: Internal |
56 | |
57 | ---Purpose: Starting with a file named <afilename>, fills the |
58 | -- dictionary with all the wishes definitions. |
59 | |
60 | is static; |
61 | |
62 | Definition(me : mutable ; adefinition : Method from Dynamic) returns Boolean from Standard |
63 | |
64 | ---Level: Advanced |
65 | |
66 | ---Purpose: This method sets the new definition <adefinition> in |
67 | -- the dictionary. It returns true if the operation is |
68 | -- successful, false otherwise. |
69 | |
70 | is static; |
71 | |
72 | Switch(me ; aname , atype , avalue : CString from Standard) |
73 | |
74 | ---Level: Internal |
75 | |
76 | ---Purpose: This virtual method allows the user to add recognition |
77 | -- of its own parameters when reading the file to fill |
78 | -- the dictionary. |
79 | |
80 | returns Parameter from Dynamic; |
81 | |
82 | Definition(me ; atype : CString from Standard |
83 | ; adefinition : out Method from Dynamic) returns Boolean from Standard |
84 | |
85 | ---Level: Public |
86 | |
87 | ---Purpose: Returns from the dictionary in the out variable |
88 | -- <adefinition> a reference to the right instance of the |
89 | -- definition identified by its type <atype>. The method |
90 | -- returns true if the definition exist, false otherwise. |
91 | |
92 | is static; |
93 | |
94 | UpToDate(me) returns Boolean from Standard |
95 | |
96 | ---Level: Advanced |
97 | |
98 | ---Purpose: Returns true if there has been no modification of the |
99 | -- file method-definitions.dat since the creation of the |
100 | -- dictionary object, false otherwise. |
101 | |
102 | is static; |
103 | |
104 | NumberOfDefinitions(me) returns Integer from Standard |
105 | |
106 | ---Level: Public |
107 | |
108 | ---Purpose: Returns the number of definitions stored in the |
109 | -- dictionary. |
110 | |
111 | is static; |
112 | |
113 | Definition(me ; anindex : Integer from Standard) returns any Method from Dynamic |
114 | |
115 | ---Level: Public |
116 | |
117 | ---Purpose: Returns a reference on the definition identified by |
118 | -- the index <anidex>. |
119 | |
120 | is static; |
121 | |
122 | Dump(me ; astream : in out OStream from Standard) |
123 | |
124 | ---Level: Internal |
125 | |
126 | ---Purpose: Useful for debugging. |
127 | |
128 | is static; |
129 | |
130 | fields |
131 | |
132 | thefilename : HAsciiString from TCollection; |
6c3e4c29 |
133 | thetime : Time from Standard; |
134 | thesequenceofmethoddefinitions : SequenceOfMethodDefinitions from Dynamic; |
7fd59977 |
135 | |
136 | end MethodDefinitionsDictionary; |