Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-15 09:17:35

0001 // Created on: 1993-06-10
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1993-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 _Transfer_SimpleBinderOfTransient_HeaderFile
0018 #define _Transfer_SimpleBinderOfTransient_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Transfer_Binder.hxx>
0024 
0025 //! An adapted instantiation of SimpleBinder for Transient Result,
0026 //! i.e. ResultType can be computed from the Result itself,
0027 //! instead of being static
0028 class Transfer_SimpleBinderOfTransient : public Transfer_Binder
0029 {
0030 
0031 public:
0032   //! Creates an empty SimpleBinderOfTransient
0033   //! Returns True if a starting object is bound with SEVERAL
0034   //! results : Here, returns always False
0035   //! See Binder itself
0036   Standard_EXPORT Transfer_SimpleBinderOfTransient();
0037 
0038   //! Returns the Effective (Dynamic) Type of the Result
0039   //! (Standard_Transient if no Result is defined)
0040   Standard_EXPORT occ::handle<Standard_Type> ResultType() const override;
0041 
0042   //! Returns the Effective Name of (Dynamic) Type of the Result
0043   //! (void) if no result is defined
0044   Standard_EXPORT const char* ResultTypeName() const override;
0045 
0046   //! Defines the Result
0047   Standard_EXPORT void SetResult(const occ::handle<Standard_Transient>& res);
0048 
0049   //! Returns the defined Result, if there is one
0050   Standard_EXPORT const occ::handle<Standard_Transient>& Result() const;
0051 
0052   //! Returns a transient result according to its type (IsKind)
0053   //! i.e. the result itself if IsKind(atype), else searches in
0054   //! NextResult, until first found, then returns True
0055   //! If not found, returns False (res is NOT touched)
0056   //!
0057   //! This syntactic form avoids to do DownCast : if a result is
0058   //! found with the good type, it is loaded in <res> and can be
0059   //! immediately used, well initialised
0060   Standard_EXPORT static bool GetTypedResult(const occ::handle<Transfer_Binder>& bnd,
0061                                              const occ::handle<Standard_Type>&   atype,
0062                                              occ::handle<Standard_Transient>&    res);
0063 
0064   DEFINE_STANDARD_RTTIEXT(Transfer_SimpleBinderOfTransient, Transfer_Binder)
0065 
0066 private:
0067   occ::handle<Standard_Transient> theres;
0068 };
0069 
0070 #endif // _Transfer_SimpleBinderOfTransient_HeaderFile