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 <MMgt_TShared.hxx>
26 #include <Standard_CString.hxx>
27 #include <Interface_ParamType.hxx>
28 class Interface_ParamList;
29 class Standard_OutOfRange;
30 class Interface_FileParameter;
33 class Interface_ParamSet;
34 DEFINE_STANDARD_HANDLE(Interface_ParamSet, MMgt_TShared)
36 //! Defines an ordered set of FileParameters, in a way to be
37 //! efficient as in memory requirement or in speed
38 class Interface_ParamSet : public MMgt_TShared
44 //! Creates an empty ParamSet, beginning at number "nst" and of
45 //! initial reservation "nres" : the "nres" first parameters
46 //! which follow "ndeb" (included) will be put in an Array
47 //! (a ParamList). The remainders are set in Next(s) ParamSet(s)
48 Standard_EXPORT Interface_ParamSet(const Standard_Integer nres, const Standard_Integer nst = 1);
50 //! Adds a parameter defined as its Value (CString and length) and
51 //! Type. Optionnal EntityNumber (for FileReaderData) can be given
52 //! Allows a better memory management than Appending a
53 //! complete FileParameter
54 //! If <lnval> < 0, <val> is assumed to be managed elsewhere : its
55 //! adress is stored as such. Else, <val> is copied in a locally
56 //! (quickly) managed Page of Characters
57 //! Returns new count of recorded Parameters
58 Standard_EXPORT Standard_Integer Append (const Standard_CString val, const Standard_Integer lnval, const Interface_ParamType typ, const Standard_Integer nument);
60 //! Adds a parameter at the end of the ParamSet (transparent
61 //! about reservation and "Next")
62 //! Returns new count of recorded Parameters
63 Standard_EXPORT Standard_Integer Append (const Interface_FileParameter& FP);
65 //! Returns the total count of parameters (including nexts)
66 Standard_EXPORT Standard_Integer NbParams() const;
68 //! Returns a parameter identified by its number
69 Standard_EXPORT const Interface_FileParameter& Param (const Standard_Integer num) const;
71 //! Same as above, but in order to be modified on place
72 Standard_EXPORT Interface_FileParameter& ChangeParam (const Standard_Integer num);
74 //! Changes a parameter identified by its number
75 Standard_EXPORT void SetParam (const Standard_Integer num, const Interface_FileParameter& FP);
77 //! Builds and returns the sub-list correspinding to parameters,
78 //! from "num" included, with count "nb"
79 //! If <num> and <nb> are zero, returns the whole list
80 Standard_EXPORT Handle(Interface_ParamList) Params (const Standard_Integer num, const Standard_Integer nb) const;
82 //! Destructor (waiting for transparent memory management)
83 Standard_EXPORT void Destroy();
91 DEFINE_STANDARD_RTTIEXT(Interface_ParamSet,MMgt_TShared)
101 Standard_PCharacter theval;
102 Standard_Integer thelnval;
103 Standard_Integer thelnres;
104 Standard_Integer thenbpar;
105 Standard_Integer themxpar;
106 Handle(Interface_ParamList) thelist;
107 Handle(Interface_ParamSet) thenext;
118 #endif // _Interface_ParamSet_HeaderFile