1 // Created on: 1993-04-07
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_MultipleBinder_HeaderFile
18 #define _Transfer_MultipleBinder_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <TColStd_HSequenceOfTransient.hxx>
24 #include <Transfer_Binder.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_Type.hxx>
27 #include <Standard_CString.hxx>
28 #include <Standard_Integer.hxx>
29 class Transfer_TransferFailure;
30 class Standard_OutOfRange;
31 class Standard_Transient;
34 class Transfer_MultipleBinder;
35 DEFINE_STANDARD_HANDLE(Transfer_MultipleBinder, Transfer_Binder)
37 //! Allows direct binding between a starting Object and the Result
38 //! of its transfer, when it can be made of several Transient
39 //! Objects. Compared to a Transcriptor, it has no Transfer Action
41 //! Result is a list of Transient Results. Unique Result is not
42 //! available : SetResult is redefined to start the list on the
43 //! first call, and refuse the other times.
47 //! Remark : MultipleBinder itself is intended to be created and
48 //! filled by TransferProcess itself (method Bind). In particular,
49 //! conflicts between Unique (Standard) result and Multiple result
50 //! are avoided through management made by TransferProcess.
52 //! Also, a Transcriptor (with an effective Transfer Method) which
53 //! can produce a Multiple Result, may be defined as a sub-class
54 //! of MultipleBinder by redefining method Transfer.
55 class Transfer_MultipleBinder : public Transfer_Binder
61 //! normal standard constructor, creates an empty MultipleBinder
62 Standard_EXPORT Transfer_MultipleBinder();
64 //! Returns True if a starting object is bound with SEVERAL
65 //! results : Here, returns allways True
66 Standard_EXPORT virtual Standard_Boolean IsMultiple() const Standard_OVERRIDE;
68 //! Returns the Type permitted for Results, i.e. here Transient
69 Standard_EXPORT Handle(Standard_Type) ResultType() const Standard_OVERRIDE;
71 //! Returns the Name of the Type which characterizes the Result
72 //! Here, returns "(list)"
73 Standard_EXPORT Standard_CString ResultTypeName() const Standard_OVERRIDE;
75 //! Adds a new Item to the Multiple Result
76 Standard_EXPORT void AddResult (const Handle(Standard_Transient)& res);
78 //! Returns the actual count of recorded (Transient) results
79 Standard_EXPORT Standard_Integer NbResults() const;
81 //! Returns the value of the recorded result n0 <num>
82 Standard_EXPORT Handle(Standard_Transient) ResultValue (const Standard_Integer num) const;
84 //! Returns the Multiple Result, if it is defined (at least one
85 //! Item). Else, returns a Null Handle
86 Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MultipleResult() const;
88 //! Defines a Binding with a Multiple Result, given as a Sequence
89 //! Error if a Unique Result has yet been defined
90 Standard_EXPORT void SetMultipleResult (const Handle(TColStd_HSequenceOfTransient)& mulres);
95 DEFINE_STANDARD_RTTIEXT(Transfer_MultipleBinder,Transfer_Binder)
105 Handle(TColStd_HSequenceOfTransient) themulres;
116 #endif // _Transfer_MultipleBinder_HeaderFile