1 // Created on: 1993-06-10
2 // Created by: Christian CAILLET
3 // Copyright (c) 1993-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 _Transfer_SimpleBinderOfTransient_HeaderFile
18 #define _Transfer_SimpleBinderOfTransient_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Transfer_Binder.hxx>
24 #include <Standard_Type.hxx>
25 #include <Standard_CString.hxx>
26 #include <Standard_Boolean.hxx>
27 class Standard_Transient;
28 class Transfer_TransferFailure;
29 class Transfer_Binder;
32 class Transfer_SimpleBinderOfTransient;
33 DEFINE_STANDARD_HANDLE(Transfer_SimpleBinderOfTransient, Transfer_Binder)
35 //! An adapted instantiation of SimpleBinder for Transient Result,
36 //! i.e. ResultType can be computed from the Result itself,
37 //! instead of being static
38 class Transfer_SimpleBinderOfTransient : public Transfer_Binder
44 //! Creates an empty SimpleBinderOfTransient
45 //! Returns True if a starting object is bound with SEVERAL
46 //! results : Here, returns allways False
48 Standard_EXPORT Transfer_SimpleBinderOfTransient();
50 //! Returns the Effective (Dynamic) Type of the Result
51 //! (Standard_Transient if no Result is defined)
52 Standard_EXPORT Handle(Standard_Type) ResultType() const Standard_OVERRIDE;
54 //! Returns the Effective Name of (Dynamic) Type of the Result
55 //! (void) if no result is defined
56 Standard_EXPORT Standard_CString ResultTypeName() const Standard_OVERRIDE;
58 //! Defines the Result
59 Standard_EXPORT void SetResult (const Handle(Standard_Transient)& res);
61 //! Returns the defined Result, if there is one
62 Standard_EXPORT const Handle(Standard_Transient)& Result() const;
64 //! Returns a transient result according to its type (IsKind)
65 //! i.e. the result itself if IsKind(atype), else searches in
66 //! NextResult, until first found, then returns True
67 //! If not found, returns False (res is NOT touched)
69 //! This syntactic form avoids to do DownCast : if a result is
70 //! found with the good type, it is loaded in <res> and can be
71 //! immediately used, well initialised
72 Standard_EXPORT static Standard_Boolean GetTypedResult (const Handle(Transfer_Binder)& bnd, const Handle(Standard_Type)& atype, Handle(Standard_Transient)& res);
77 DEFINE_STANDARD_RTTIEXT(Transfer_SimpleBinderOfTransient,Transfer_Binder)
87 Handle(Standard_Transient) theres;
98 #endif // _Transfer_SimpleBinderOfTransient_HeaderFile