1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
15 #include <Standard_Transient.hxx>
16 #include <Standard_Type.hxx>
17 #include <Transfer_Binder.hxx>
18 #include <Transfer_SimpleBinderOfTransient.hxx>
19 #include <Transfer_TransferFailure.hxx>
21 IMPLEMENT_STANDARD_RTTIEXT(Transfer_SimpleBinderOfTransient,Transfer_Binder)
23 // "Handle(Standard_Transient)" : la classe de base pour le Resultat
24 Transfer_SimpleBinderOfTransient::Transfer_SimpleBinderOfTransient () { }
27 // Standard_Boolean Transfer_SimpleBinderOfTransient::IsMultiple() const
28 // { return Standard_False; }
31 Handle(Standard_Type) Transfer_SimpleBinderOfTransient::ResultType () const
33 if (!HasResult() || theres.IsNull()) return STANDARD_TYPE(Standard_Transient);
34 return Result()->DynamicType();
37 Standard_CString Transfer_SimpleBinderOfTransient::ResultTypeName () const
39 if (!HasResult() || theres.IsNull()) return "(void)";
40 return Result()->DynamicType()->Name();
44 void Transfer_SimpleBinderOfTransient::SetResult
45 (const Handle(Standard_Transient)& res)
52 const Handle(Standard_Transient)& Transfer_SimpleBinderOfTransient::Result () const
55 Standard_Boolean Transfer_SimpleBinderOfTransient::GetTypedResult
56 (const Handle(Transfer_Binder)& bnd, const Handle(Standard_Type)& atype,
57 Handle(Standard_Transient)& res)
59 if (atype.IsNull()) return Standard_False;
60 Handle(Transfer_Binder) bn = bnd;
61 while (!bn.IsNull()) {
62 Handle(Transfer_SimpleBinderOfTransient) trb =
63 Handle(Transfer_SimpleBinderOfTransient)::DownCast(bn);
64 bn = bn->NextResult();
65 if (trb.IsNull()) continue;
66 const Handle(Standard_Transient)& rs = trb->Result();
67 if (rs.IsNull()) continue;
68 if (!rs->IsKind(atype)) continue;
72 return Standard_False;