Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-12-02 10:11:17

0001 // Created on: 1992-11-30
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1992-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _IFSelect_IntParam_HeaderFile
0018 #define _IFSelect_IntParam_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <Standard_Integer.hxx>
0023 #include <TCollection_AsciiString.hxx>
0024 #include <NCollection_DefineAlloc.hxx>
0025 #include <Standard_Transient.hxx>
0026 
0027 //! This class simply allows to access an Integer value through a
0028 //! Handle, as a String can be (by using HString).
0029 //! Hence, this value can be accessed : read and modified, without
0030 //! passing through the specific object which detains it. Thus,
0031 //! parameters of a Selection or a Dispatch (according its type)
0032 //! can be controlled directly from the ShareOut which contains them
0033 //!
0034 //! Additionally, an IntParam can be bound to a Static.
0035 //! Remember that for a String, binding is immediate, because the
0036 //! string value of a Static is a HAsciiString, it then suffices
0037 //! to get its Handle.
0038 //! For an Integer, an IntParam can designate (by its name) a
0039 //! Static : each time its value is required or set, the Static
0040 //! is acknowledged
0041 class IFSelect_IntParam : public Standard_Transient
0042 {
0043 
0044 public:
0045   //! Creates an IntParam. Initial value is set to zer
0046   Standard_EXPORT IFSelect_IntParam();
0047 
0048   //! Commands this IntParam to be bound to a Static
0049   //! Hence, Value will return the value if this Static if it is set
0050   //! Else, Value works on the locally stored value
0051   //! SetValue also will set the value of the Static
0052   //! This works only for a present static of type integer or enum
0053   //! Else, it is ignored
0054   //!
0055   //! If <statname> is empty, disconnects the IntParam from Static
0056   Standard_EXPORT void SetStaticName(const char* const statname);
0057 
0058   //! Returns the name of static parameter to which this IntParam
0059   //! is bound, empty if none
0060   Standard_EXPORT const char* StaticName() const;
0061 
0062   //! Reads Integer Value of the IntParam. If a StaticName is
0063   //! defined and the Static is set, looks in priority the value
0064   //! of the static
0065   Standard_EXPORT int Value() const;
0066 
0067   //! Sets a new Integer Value for the IntParam. If a StaticName is
0068   //! defined and the Static is set, also sets the value of the static
0069   Standard_EXPORT void SetValue(const int val);
0070 
0071   DEFINE_STANDARD_RTTIEXT(IFSelect_IntParam, Standard_Transient)
0072 
0073 private:
0074   int                     theval;
0075   TCollection_AsciiString thestn;
0076 };
0077 
0078 #endif // _IFSelect_IntParam_HeaderFile