7fd59977 |
1 | -- File: ParamSet.cdl |
2 | -- Created: Thu Oct 29 19:03:55 1992 |
3 | -- Author: Christian CAILLET |
4 | -- <cky@topsn2> |
5 | ---Copyright: Matra Datavision 1992 |
6 | |
7 | |
8 | class ParamSet from Interface inherits TShared |
9 | |
10 | ---Purpose : Defines an ordered set of FileParameters, in a way to be |
11 | -- efficient as in memory requirement or in speed |
12 | |
13 | uses CString, ParamList, FileParameter, ParamType |
14 | |
15 | raises OutOfRange |
16 | |
17 | is |
18 | |
19 | Create (nres : Integer; nst : Integer = 1) returns mutable ParamSet; |
20 | ---Purpose : Creates an empty ParamSet, beginning at number "nst" and of |
21 | -- initial reservation "nres" : the "nres" first parameters |
22 | -- which follow "ndeb" (included) will be put in an Array |
23 | -- (a ParamList). The remainders are set in Next(s) ParamSet(s) |
24 | |
25 | Append (me : mutable; val : CString; lnval : Integer; typ : ParamType; |
26 | nument : Integer) |
27 | returns Integer is static; |
28 | ---Purpose : Adds a parameter defined as its Value (CString and length) and |
29 | -- Type. Optionnal EntityNumber (for FileReaderData) can be given |
30 | -- Allows a better memory management than Appending a |
31 | -- complete FileParameter |
32 | -- If <lnval> < 0, <val> is assumed to be managed elsewhere : its |
33 | -- adress is stored as such. Else, <val> is copied in a locally |
34 | -- (quickly) managed Page of Characters |
35 | -- Returns new count of recorded Parameters |
36 | |
37 | Append (me : mutable; FP : FileParameter) returns Integer is static; |
38 | ---Purpose : Adds a parameter at the end of the ParamSet (transparent |
39 | -- about reservation and "Next") |
40 | -- Returns new count of recorded Parameters |
41 | |
42 | NbParams (me) returns Integer is static; |
43 | ---Purpose : Returns the total count of parameters (including nexts) |
44 | |
45 | Param (me; num : Integer) returns FileParameter |
46 | ---Purpose : Returns a parameter identified by its number |
47 | raises OutOfRange is static; |
48 | -- Error if num < 1 or num > NbParams |
49 | ---C++ : return const & |
50 | |
51 | ChangeParam (me : mutable; num : Integer) returns FileParameter |
52 | ---Purpose : Same as above, but in order to be modified on place |
53 | raises OutOfRange is static; |
54 | -- Error if num < 1 or num > NbParams |
55 | ---C++ : return & |
56 | |
57 | SetParam (me : mutable; num : Integer; FP : FileParameter) |
58 | raises OutOfRange is static; |
59 | ---Purpose : Changes a parameter identified by its number |
60 | |
61 | Params (me; num,nb : Integer) returns ParamList |
62 | raises OutOfRange is static; |
63 | ---Purpose : Builds and returns the sub-list correspinding to parameters, |
64 | -- from "num" included, with count "nb" |
65 | -- If <num> and <nb> are zero, returns the whole list |
66 | |
67 | Destroy (me : mutable) is static; |
68 | ---Purpose : Destructor (waiting for transparent memory management) |
69 | ---C++ : alias ~ |
70 | |
71 | fields |
72 | |
73 | theval : PCharacter; |
74 | thelnval : Integer; |
75 | thelnres : Integer; |
76 | thenbpar : Integer; |
77 | themxpar : Integer; |
78 | thelist : ParamList; |
79 | thenext : ParamSet; |
80 | |
81 | end ParamSet; |