7fd59977 |
1 | -- File: StepData_ReadWriteModule.cdl |
2 | -- Created: Mon Jan 25 18:44:05 1993 |
3 | -- Author: Christian CAILLET |
4 | -- <cky@sdsun2> |
5 | ---Copyright: Matra Datavision 1993 |
6 | |
7 | |
8 | deferred class ReadWriteModule from StepData inherits |
9 | ReaderModule from Interface |
10 | |
11 | ---Purpose : Defines basic File Access Module (Recognize, Read, Write) |
12 | -- That is : ReaderModule (Recognize & Read) + Write for |
13 | -- StepWriter (for a more centralized description) |
14 | -- Warning : A sub-class of ReadWriteModule, which belongs to a particular |
15 | -- Protocol, must use the same definition for Case Numbers (give |
16 | -- the same Value for a StepType defined as a String from a File |
17 | -- as the Protocol does for the corresponding Entity) |
18 | |
19 | uses Transient, AsciiString from TCollection, |
20 | SequenceOfAsciiString from TColStd, |
21 | Check, FileReaderData, StepReaderData, StepWriter |
22 | |
23 | raises DomainError |
24 | |
25 | is |
26 | |
27 | CaseNum (me; data : FileReaderData; num : Integer) returns Integer; |
28 | ---Purpose : Translate the Type of record <num> in <data> to a positive |
29 | -- Case Number, or 0 if failed. |
30 | -- Works with a StepReaderData, in which the Type of an Entity |
31 | -- is defined as a String : Reads the RecordType <num> then calls |
32 | -- CaseNum (this type) |
33 | -- Warning : The methods CaseStep, StepType and Recognize, |
34 | -- must be in phase (triplets CaseNum-StepType-Type of Object) |
35 | |
36 | CaseStep (me; atype : AsciiString from TCollection) returns Integer |
37 | is deferred; |
38 | ---Purpose : Defines Case Numbers corresponding to the recognized Types |
39 | -- Called by CaseNum (data,num) above for a Simple Type Entity |
40 | -- Warning : CaseStep must give the same Value as Protocol does for the |
41 | -- Entity type which corresponds to this Type given as a String |
42 | |
43 | CaseStep (me; types : SequenceOfAsciiString from TColStd) returns Integer |
44 | is virtual; |
45 | ---Purpose : Same a above but for a Complex Type Entity ("Plex") |
46 | -- The provided Default recognizes nothing |
47 | |
48 | |
49 | IsComplex (me; CN : Integer) returns Boolean is virtual; |
50 | ---Purpose : Returns True if the Case Number corresponds to a Complex Type |
51 | -- ("Plex"). Remember that all possible combinations must be |
52 | -- aknowledged to be processed |
53 | -- Default is False for all cases. For a Protocol which defines |
54 | -- possible Plexes, this method must be redefined. |
55 | |
56 | StepType (me; CN : Integer) returns AsciiString from TCollection |
57 | is deferred; |
58 | ---Purpose : Function specific to STEP, which delivers the StepType as it |
59 | -- is recorded in and read from a File compliant with STEP. |
60 | -- This method is symmetric to the method CaseStep. |
61 | -- StepType can be different from Dynamic Type's name, but |
62 | -- belongs to the same class of Object. |
63 | -- Returns an empty String if <CN> is zero. |
64 | -- Warning : For a Complex Type Entity, returns an Empty String |
65 | -- (Complex Type must be managed by users) |
66 | ---C++ : return const & |
67 | |
68 | ShortType (me; CN : Integer) returns AsciiString from TCollection |
69 | is virtual; |
70 | ---Purpose : Function specific to STEP. Some STEP Types have a short form |
71 | -- This method can be redefined to fill it |
72 | -- By default, returns an empty string, which is then interpreted |
73 | -- to take normal form from StepType |
74 | |
75 | ComplexType (me; CN : Integer; |
76 | types : in out SequenceOfAsciiString from TColStd) |
77 | returns Boolean is virtual; |
78 | ---Purpose : Function specific to STEP, which delivers the list of types |
79 | -- which corresponds to a complex type. If <CN> is not for a |
80 | -- complex type, this method returns False. Else it returns True |
81 | -- and fills the list in alphabetic order. |
82 | -- The default returns False. To be redefined as required. |
83 | |
84 | Read (me; CN : Integer; data : FileReaderData; num : Integer; |
85 | ach : in out Check; ent : mutable Transient) |
86 | raises DomainError; |
87 | ---Purpose : General Read Function, calls ReadStep |
88 | |
89 | ReadStep (me; CN : Integer; data : StepReaderData; num : Integer; |
90 | ach : in out Check; ent : mutable Transient) |
91 | raises DomainError is deferred; |
92 | ---Purpose : Specific Read Function. Works with StepReaderData |
93 | |
94 | WriteStep (me; CN : Integer; SW : in out StepWriter; ent : Transient) |
95 | is deferred; |
96 | ---Purpose : Write Function, switched by CaseNum |
97 | |
98 | end ReadWriteModule; |