b311480e |
1 | -- Created on: 1993-02-03 |
2 | -- Created by: Christian CAILLET |
3 | -- Copyright (c) 1993-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 | |
7fd59977 |
21 | |
22 | |
23 | class Protocol from StepData inherits Protocol from Interface |
24 | |
25 | ---Purpose : Description of Basic Protocol for Step |
26 | -- The class Protocol from StepData itself describes a default |
27 | -- Protocol, which recognizes only UnknownEntities. |
28 | -- Sub-classes will redefine CaseNumber and, if necessary, |
29 | -- NbResources and Resources. |
30 | |
31 | uses CString, Type, |
32 | SequenceOfAsciiString from TColStd, DictionaryOfTransient from Dico, |
33 | DataMapOfTransientInteger from Interface, |
34 | InterfaceModel from Interface, |
35 | EDescr from StepData, ESDescr from StepData, ECDescr from StepData, |
36 | PDescr from StepData |
37 | |
38 | is |
39 | |
40 | Create returns mutable Protocol from StepData; |
41 | |
42 | NbResources (me) returns Integer; |
43 | ---Purpose : Gives the count of Protocols used as Resource (can be zero) |
44 | -- Here, No resource |
45 | |
46 | Resource (me; num : Integer) returns Protocol from Interface; |
47 | ---Purpose : Returns a Resource, given a rank. Here, none |
48 | |
49 | CaseNumber (me; obj : any Transient) returns Integer is redefined; |
50 | ---Purpose : Returns a unique positive number for any recognized entity |
51 | -- Redefined to work by calling both TypeNumber and, for a |
52 | -- Described Entity (late binding) DescrNumber |
53 | |
54 | TypeNumber (me; atype : any Type) returns Integer; |
55 | ---Purpose : Returns a Case Number, specific of each recognized Type |
56 | -- Here, only Unknown Entity is recognized |
57 | |
58 | -- -- Specific for StepData -- -- |
59 | |
60 | SchemaName (me) returns CString is virtual; |
61 | ---Purpose : Returns the Schema Name attached to each class of Protocol |
62 | -- To be redefined by each sub-class |
63 | -- Here, SchemaName returns "(DEFAULT)" |
64 | -- was C++ : return const |
65 | |
66 | -- -- General Services (defined at Norm level) -- -- |
67 | |
68 | NewModel (me) returns mutable InterfaceModel; |
69 | ---Purpose : Creates an empty Model for Step Norm |
70 | |
71 | IsSuitableModel (me; model : InterfaceModel) returns Boolean; |
72 | ---Purpose : Returns True if <model> is a Model of Step Norm |
73 | |
74 | UnknownEntity (me) returns mutable Transient; |
75 | ---Purpose : Creates a new Unknown Entity for Step (UndefinedEntity) |
76 | |
77 | IsUnknownEntity (me; ent : Transient) returns Boolean; |
78 | ---Purpose : Returns True if <ent> is an Unknown Entity for the Norm, i.e. |
79 | -- Type UndefinedEntity, status Unknown |
80 | |
81 | -- -- About Descriptions (late binding) |
82 | |
83 | DescrNumber (me; adescr : any EDescr) returns Integer is virtual; |
84 | ---Purpose : Returns a unique positive CaseNumber for types described by |
85 | -- an EDescr (late binding) |
86 | -- Warning : TypeNumber and DescrNumber must give together a unique |
87 | -- positive case number for each distinct case, type or descr |
88 | |
89 | AddDescr (me : mutable; adescr : EDescr; CN : Integer); |
90 | ---Purpose : Records an EDescr with its case number |
91 | -- Also records its name for an ESDescr (simple type): an ESDescr |
92 | -- is then used, for case number, or for type name |
93 | |
94 | HasDescr (me) returns Boolean; |
95 | ---Purpose : Tells if a Protocol brings at least one ESDescr, i.e. if it |
96 | -- defines at least one entity description by ESDescr mechanism |
97 | |
98 | Descr (me; num : Integer) returns EDescr; |
99 | ---Purpose : Returns the description attached to a case number, or null |
100 | |
101 | Descr (me; name : CString; anylevel : Boolean = Standard_True) |
102 | returns EDescr; |
103 | ---Purpose : Returns a description according to its name |
104 | -- <anylevel> True (D) : for <me> and its resources |
105 | -- <anylevel> False : for <me> only |
106 | |
107 | ESDescr (me; name : CString; anylevel : Boolean = Standard_True) |
108 | returns ESDescr; |
109 | ---Purpose : Idem as Descr but cast to simple description |
110 | |
111 | ECDescr (me; names : SequenceOfAsciiString from TColStd; |
112 | anylevel : Boolean = Standard_True) returns ECDescr; |
113 | ---Purpose : Returns a complex description according to list of names |
114 | -- <anylevel> True (D) : for <me> and its resources |
115 | -- <anylevel> False : for <me> only |
116 | |
117 | |
118 | AddPDescr (me : mutable; pdescr : PDescr); |
119 | ---Purpose : Records an PDescr |
120 | |
121 | PDescr (me; name : CString; anylevel : Boolean = Standard_True) |
122 | returns PDescr; |
123 | ---Purpose : Returns a parameter description according to its name |
124 | -- <anylevel> True (D) : for <me> and its resources |
125 | -- <anylevel> False : for <me> only |
126 | |
127 | AddBasicDescr (me : mutable; esdescr : ESDescr); |
128 | ---Purpose : Records an ESDescr, intended to build complex descriptions |
129 | |
130 | BasicDescr (me; name : CString; anylevel : Boolean = Standard_True) |
131 | returns EDescr; |
132 | ---Purpose : Returns a basic description according to its name |
133 | -- <anylevel> True (D) : for <me> and its resources |
134 | -- <anylevel> False : for <me> only |
135 | |
136 | fields |
137 | |
138 | thedscnum : DataMapOfTransientInteger from Interface; |
139 | thedscnam : DictionaryOfTransient from Dico; |
140 | thepdescr : DictionaryOfTransient from Dico; |
141 | thedscbas : DictionaryOfTransient from Dico; |
142 | |
143 | end Protocol; |