0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / Transfer / Transfer_SimpleBinderOfTransient.hxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _Transfer_SimpleBinderOfTransient_HeaderFile
18 #define _Transfer_SimpleBinderOfTransient_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <Transfer_Binder.hxx>
24
25
26 class Transfer_SimpleBinderOfTransient;
27 DEFINE_STANDARD_HANDLE(Transfer_SimpleBinderOfTransient, Transfer_Binder)
28
29 //! An adapted instantiation of SimpleBinder for Transient Result,
30 //! i.e. ResultType can be computed from the Result itself,
31 //! instead of being static
32 class Transfer_SimpleBinderOfTransient : public Transfer_Binder
33 {
34
35 public:
36
37   
38   //! Creates an empty SimpleBinderOfTransient
39   //! Returns True if a starting object is bound with SEVERAL
40   //! results : Here, returns always False
41   //! See Binder itself
42   Standard_EXPORT Transfer_SimpleBinderOfTransient();
43   
44   //! Returns the Effective (Dynamic) Type of the Result
45   //! (Standard_Transient if no Result is defined)
46   Standard_EXPORT Handle(Standard_Type) ResultType() const Standard_OVERRIDE;
47   
48   //! Returns the Effective Name of (Dynamic) Type of the Result
49   //! (void) if no result is defined
50   Standard_EXPORT Standard_CString ResultTypeName() const Standard_OVERRIDE;
51   
52   //! Defines the Result
53   Standard_EXPORT void SetResult (const Handle(Standard_Transient)& res);
54   
55   //! Returns the defined Result, if there is one
56   Standard_EXPORT const Handle(Standard_Transient)& Result() const;
57   
58   //! Returns a transient result according to its type (IsKind)
59   //! i.e. the result itself if IsKind(atype), else searches in
60   //! NextResult, until first found, then returns True
61   //! If not found, returns False (res is NOT touched)
62   //!
63   //! This syntactic form avoids to do DownCast : if a result is
64   //! found with the good type, it is loaded in <res> and can be
65   //! immediately used, well initialised
66   Standard_EXPORT static Standard_Boolean GetTypedResult (const Handle(Transfer_Binder)& bnd, const Handle(Standard_Type)& atype, Handle(Standard_Transient)& res);
67
68
69
70
71   DEFINE_STANDARD_RTTIEXT(Transfer_SimpleBinderOfTransient,Transfer_Binder)
72
73 protected:
74
75
76
77
78 private:
79
80
81   Handle(Standard_Transient) theres;
82
83
84 };
85
86
87
88
89
90
91
92 #endif // _Transfer_SimpleBinderOfTransient_HeaderFile