7fd59977 |
1 | -- File: IGESData_ReadWriteModule.cdl |
2 | -- Created: Mon Sep 6 19:22:12 1993 |
3 | -- Author: Christian CAILLET |
4 | -- <cky@bravox> |
5 | ---Copyright: Matra Datavision 1993 |
6 | |
7 | |
8 | |
9 | deferred class ReadWriteModule from IGESData |
10 | inherits ReaderModule from Interface |
11 | |
12 | ---Purpose : Defines basic File Access Module, under the control of |
13 | -- IGESReaderTool for Reading and IGESWriter for Writing : |
14 | -- Specific actions concern : Read and Write Own Parameters of |
15 | -- an IGESEntity. |
16 | -- The common parts (Directory Entry, Lists of Associativities |
17 | -- and Properties) are processed by IGESReaderTool & IGESWriter |
18 | -- |
19 | -- Each sub-class of ReadWriteModule is used in conjunction with |
20 | -- a sub-class of Protocol from IGESData and processes several |
21 | -- types of IGESEntity (typically, them of a package) : |
22 | -- The Protocol gives a unique positive integer Case Number for |
23 | -- each type of IGESEntity it recognizes, the corresponding |
24 | -- ReadWriteModule processes an Entity by using the Case Number |
25 | -- to known what is to do |
26 | -- On Reading, the general service NewVoid is used to create an |
27 | -- IGES Entity the first time |
28 | -- |
29 | -- Warning : Works with an IGESReaderData which stores "DE parts" of Items |
30 | |
31 | uses Transient, FileReaderData, Check, |
32 | IGESEntity, DirPart, IGESReaderData, ParamReader, IGESWriter |
33 | |
34 | raises DomainError |
35 | |
36 | is |
37 | |
38 | CaseNum (me; data : FileReaderData; num : Integer) returns Integer; |
39 | ---Purpose : Translates the Type of record <num> in <data> to a positive |
40 | -- Case Number, or 0 if failed. |
41 | -- Works with IGESReaderData which provides Type & Form Numbers, |
42 | -- and calls CaseIGES (see below) |
43 | |
44 | CaseIGES (me; typenum, formnum : Integer) returns Integer is deferred; |
45 | ---Purpose : Defines Case Numbers corresponding to the Entity Types taken |
46 | -- into account by a sub-class of ReadWriteModule (hence, each |
47 | -- sub-class of ReadWriteModule has to redefine this method) |
48 | -- Called by CaseNum. Its result will then be used to call |
49 | -- Read, etc ... |
50 | |
51 | Read (me; CN : Integer; data : FileReaderData; num : Integer; |
52 | ach : in out Check; ent : mutable Transient) |
53 | raises DomainError; |
54 | ---Purpose : General Read Function. See IGESReaderTool for more info |
55 | |
56 | ReadOwnParams (me; CN : Integer; ent : mutable IGESEntity; |
57 | IR : IGESReaderData; PR : in out ParamReader) |
58 | raises DomainError is deferred; |
59 | ---Purpose : Reads own parameters from file for an Entity; <PR> gives |
60 | -- access to them, <IR> detains parameter types and values |
61 | -- For each class, there must be a specific action provided |
62 | -- Note that Properties and Associativities Lists are Read by |
63 | -- specific methods (see below), they are called under control |
64 | -- of reading process (only one call) according Stage recorded |
65 | -- in ParamReader |
66 | |
67 | |
68 | WriteOwnParams (me; CN : Integer; ent : IGESEntity; |
69 | IW : in out IGESWriter) |
70 | is deferred; |
71 | ---Purpose : Writes own parameters to IGESWriter; defined for each class |
72 | -- (to be redefined for other IGES ReadWriteModules) |
73 | -- Warning : Properties and Associativities are directly managed by |
74 | -- WriteIGES, must not be sent by this method |
75 | |
76 | end ReadWriteModule; |