1 -- Created on: 1993-02-03
2 -- Created by: Christian CAILLET
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and / or modify it
9 -- under the terms of the GNU Lesser General Public 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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class Protocol from StepData inherits Protocol from Interface
19 ---Purpose : Description of Basic Protocol for Step
20 -- The class Protocol from StepData itself describes a default
21 -- Protocol, which recognizes only UnknownEntities.
22 -- Sub-classes will redefine CaseNumber and, if necessary,
23 -- NbResources and Resources.
26 SequenceOfAsciiString from TColStd, DictionaryOfTransient from Dico,
27 DataMapOfTransientInteger from Interface,
28 InterfaceModel from Interface,
29 EDescr from StepData, ESDescr from StepData, ECDescr from StepData,
34 Create returns mutable Protocol from StepData;
36 NbResources (me) returns Integer;
37 ---Purpose : Gives the count of Protocols used as Resource (can be zero)
40 Resource (me; num : Integer) returns Protocol from Interface;
41 ---Purpose : Returns a Resource, given a rank. Here, none
43 CaseNumber (me; obj : any Transient) returns Integer is redefined;
44 ---Purpose : Returns a unique positive number for any recognized entity
45 -- Redefined to work by calling both TypeNumber and, for a
46 -- Described Entity (late binding) DescrNumber
48 TypeNumber (me; atype : any Type) returns Integer;
49 ---Purpose : Returns a Case Number, specific of each recognized Type
50 -- Here, only Unknown Entity is recognized
52 -- -- Specific for StepData -- --
54 SchemaName (me) returns CString is virtual;
55 ---Purpose : Returns the Schema Name attached to each class of Protocol
56 -- To be redefined by each sub-class
57 -- Here, SchemaName returns "(DEFAULT)"
58 -- was C++ : return const
60 -- -- General Services (defined at Norm level) -- --
62 NewModel (me) returns mutable InterfaceModel;
63 ---Purpose : Creates an empty Model for Step Norm
65 IsSuitableModel (me; model : InterfaceModel) returns Boolean;
66 ---Purpose : Returns True if <model> is a Model of Step Norm
68 UnknownEntity (me) returns mutable Transient;
69 ---Purpose : Creates a new Unknown Entity for Step (UndefinedEntity)
71 IsUnknownEntity (me; ent : Transient) returns Boolean;
72 ---Purpose : Returns True if <ent> is an Unknown Entity for the Norm, i.e.
73 -- Type UndefinedEntity, status Unknown
75 -- -- About Descriptions (late binding)
77 DescrNumber (me; adescr : any EDescr) returns Integer is virtual;
78 ---Purpose : Returns a unique positive CaseNumber for types described by
79 -- an EDescr (late binding)
80 -- Warning : TypeNumber and DescrNumber must give together a unique
81 -- positive case number for each distinct case, type or descr
83 AddDescr (me : mutable; adescr : EDescr; CN : Integer);
84 ---Purpose : Records an EDescr with its case number
85 -- Also records its name for an ESDescr (simple type): an ESDescr
86 -- is then used, for case number, or for type name
88 HasDescr (me) returns Boolean;
89 ---Purpose : Tells if a Protocol brings at least one ESDescr, i.e. if it
90 -- defines at least one entity description by ESDescr mechanism
92 Descr (me; num : Integer) returns EDescr;
93 ---Purpose : Returns the description attached to a case number, or null
95 Descr (me; name : CString; anylevel : Boolean = Standard_True)
97 ---Purpose : Returns a description according to its name
98 -- <anylevel> True (D) : for <me> and its resources
99 -- <anylevel> False : for <me> only
101 ESDescr (me; name : CString; anylevel : Boolean = Standard_True)
103 ---Purpose : Idem as Descr but cast to simple description
105 ECDescr (me; names : SequenceOfAsciiString from TColStd;
106 anylevel : Boolean = Standard_True) returns ECDescr;
107 ---Purpose : Returns a complex description according to list of names
108 -- <anylevel> True (D) : for <me> and its resources
109 -- <anylevel> False : for <me> only
112 AddPDescr (me : mutable; pdescr : PDescr);
113 ---Purpose : Records an PDescr
115 PDescr (me; name : CString; anylevel : Boolean = Standard_True)
117 ---Purpose : Returns a parameter description according to its name
118 -- <anylevel> True (D) : for <me> and its resources
119 -- <anylevel> False : for <me> only
121 AddBasicDescr (me : mutable; esdescr : ESDescr);
122 ---Purpose : Records an ESDescr, intended to build complex descriptions
124 BasicDescr (me; name : CString; anylevel : Boolean = Standard_True)
126 ---Purpose : Returns a basic description according to its name
127 -- <anylevel> True (D) : for <me> and its resources
128 -- <anylevel> False : for <me> only
132 thedscnum : DataMapOfTransientInteger from Interface;
133 thedscnam : DictionaryOfTransient from Dico;
134 thepdescr : DictionaryOfTransient from Dico;
135 thedscbas : DictionaryOfTransient from Dico;