1 -- File: StepData_ReadWriteModule.cdl
2 -- Created: Mon Jan 25 18:44:05 1993
3 -- Author: Christian CAILLET
5 ---Copyright: Matra Datavision 1993
8 deferred class ReadWriteModule from StepData inherits
9 ReaderModule from Interface
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)
19 uses Transient, AsciiString from TCollection,
20 SequenceOfAsciiString from TColStd,
21 Check, FileReaderData, StepReaderData, StepWriter
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)
36 CaseStep (me; atype : AsciiString from TCollection) returns Integer
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
43 CaseStep (me; types : SequenceOfAsciiString from TColStd) returns Integer
45 ---Purpose : Same a above but for a Complex Type Entity ("Plex")
46 -- The provided Default recognizes nothing
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.
56 StepType (me; CN : Integer) returns AsciiString from TCollection
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 &
68 ShortType (me; CN : Integer) returns AsciiString from TCollection
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
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.
84 Read (me; CN : Integer; data : FileReaderData; num : Integer;
85 ach : in out Check; ent : mutable Transient)
87 ---Purpose : General Read Function, calls ReadStep
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
94 WriteStep (me; CN : Integer; SW : in out StepWriter; ent : Transient)
96 ---Purpose : Write Function, switched by CaseNum