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 #ifndef _Interface_ParamSet_HeaderFile
18 #define _Interface_ParamSet_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_PCharacter.hxx>
24 #include <Standard_Integer.hxx>
25 #include <Standard_Transient.hxx>
26 #include <Interface_ParamType.hxx>
27 class Interface_ParamList;
28 class Interface_FileParameter;
31 class Interface_ParamSet;
32 DEFINE_STANDARD_HANDLE(Interface_ParamSet, Standard_Transient)
34 //! Defines an ordered set of FileParameters, in a way to be
35 //! efficient as in memory requirement or in speed
36 class Interface_ParamSet : public Standard_Transient
42 //! Creates an empty ParamSet, beginning at number "nst" and of
43 //! initial reservation "nres" : the "nres" first parameters
44 //! which follow "ndeb" (included) will be put in an Array
45 //! (a ParamList). The remainders are set in Next(s) ParamSet(s)
46 Standard_EXPORT Interface_ParamSet(const Standard_Integer nres, const Standard_Integer nst = 1);
48 //! Adds a parameter defined as its Value (CString and length) and
49 //! Type. Optional EntityNumber (for FileReaderData) can be given
50 //! Allows a better memory management than Appending a
51 //! complete FileParameter
52 //! If <lnval> < 0, <val> is assumed to be managed elsewhere : its
53 //! address is stored as such. Else, <val> is copied in a locally
54 //! (quickly) managed Page of Characters
55 //! Returns new count of recorded Parameters
56 Standard_EXPORT Standard_Integer Append (const Standard_CString val, const Standard_Integer lnval, const Interface_ParamType typ, const Standard_Integer nument);
58 //! Adds a parameter at the end of the ParamSet (transparent
59 //! about reservation and "Next")
60 //! Returns new count of recorded Parameters
61 Standard_EXPORT Standard_Integer Append (const Interface_FileParameter& FP);
63 //! Returns the total count of parameters (including nexts)
64 Standard_EXPORT Standard_Integer NbParams() const;
66 //! Returns a parameter identified by its number
67 Standard_EXPORT const Interface_FileParameter& Param (const Standard_Integer num) const;
69 //! Same as above, but in order to be modified on place
70 Standard_EXPORT Interface_FileParameter& ChangeParam (const Standard_Integer num);
72 //! Changes a parameter identified by its number
73 Standard_EXPORT void SetParam (const Standard_Integer num, const Interface_FileParameter& FP);
75 //! Builds and returns the sub-list corresponding to parameters,
76 //! from "num" included, with count "nb"
77 //! If <num> and <nb> are zero, returns the whole list
78 Standard_EXPORT Handle(Interface_ParamList) Params (const Standard_Integer num, const Standard_Integer nb) const;
80 //! Destructor (waiting for transparent memory management)
81 Standard_EXPORT void Destroy();
89 DEFINE_STANDARD_RTTIEXT(Interface_ParamSet,Standard_Transient)
99 Standard_PCharacter theval;
100 Standard_Integer thelnval;
101 Standard_Integer thelnres;
102 Standard_Integer thenbpar;
103 Standard_Integer themxpar;
104 Handle(Interface_ParamList) thelist;
105 Handle(Interface_ParamSet) thenext;
116 #endif // _Interface_ParamSet_HeaderFile