1 -- Created on: 1992-10-29
2 -- Created by: Christian CAILLET
3 -- Copyright (c) 1992-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 under
9 -- the terms of the GNU Lesser General Public License 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 ParamSet from Interface inherits TShared
19 ---Purpose : Defines an ordered set of FileParameters, in a way to be
20 -- efficient as in memory requirement or in speed
22 uses CString, ParamList, FileParameter, ParamType
28 Create (nres : Integer; nst : Integer = 1) returns ParamSet;
29 ---Purpose : Creates an empty ParamSet, beginning at number "nst" and of
30 -- initial reservation "nres" : the "nres" first parameters
31 -- which follow "ndeb" (included) will be put in an Array
32 -- (a ParamList). The remainders are set in Next(s) ParamSet(s)
34 Append (me : mutable; val : CString; lnval : Integer; typ : ParamType;
36 returns Integer is static;
37 ---Purpose : Adds a parameter defined as its Value (CString and length) and
38 -- Type. Optionnal EntityNumber (for FileReaderData) can be given
39 -- Allows a better memory management than Appending a
40 -- complete FileParameter
41 -- If <lnval> < 0, <val> is assumed to be managed elsewhere : its
42 -- adress is stored as such. Else, <val> is copied in a locally
43 -- (quickly) managed Page of Characters
44 -- Returns new count of recorded Parameters
46 Append (me : mutable; FP : FileParameter) returns Integer is static;
47 ---Purpose : Adds a parameter at the end of the ParamSet (transparent
48 -- about reservation and "Next")
49 -- Returns new count of recorded Parameters
51 NbParams (me) returns Integer is static;
52 ---Purpose : Returns the total count of parameters (including nexts)
54 Param (me; num : Integer) returns FileParameter
55 ---Purpose : Returns a parameter identified by its number
56 raises OutOfRange is static;
57 -- Error if num < 1 or num > NbParams
58 ---C++ : return const &
60 ChangeParam (me : mutable; num : Integer) returns FileParameter
61 ---Purpose : Same as above, but in order to be modified on place
62 raises OutOfRange is static;
63 -- Error if num < 1 or num > NbParams
66 SetParam (me : mutable; num : Integer; FP : FileParameter)
67 raises OutOfRange is static;
68 ---Purpose : Changes a parameter identified by its number
70 Params (me; num,nb : Integer) returns ParamList
71 raises OutOfRange is static;
72 ---Purpose : Builds and returns the sub-list correspinding to parameters,
73 -- from "num" included, with count "nb"
74 -- If <num> and <nb> are zero, returns the whole list
76 Destroy (me : mutable) is static;
77 ---Purpose : Destructor (waiting for transparent memory management)