0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / Transfer / Transfer_MultipleBinder.hxx
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
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_MultipleBinder_HeaderFile
18 #define _Transfer_MultipleBinder_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
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;
32
33
34 class Transfer_MultipleBinder;
35 DEFINE_STANDARD_HANDLE(Transfer_MultipleBinder, Transfer_Binder)
36
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
40 //!
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.
44 //!
45 //! rr
46 //!
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.
51 //!
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
56 {
57
58 public:
59
60   
61   //! normal standard constructor, creates an empty MultipleBinder
62   Standard_EXPORT Transfer_MultipleBinder();
63   
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;
67   
68   //! Returns the Type permitted for Results, i.e. here Transient
69   Standard_EXPORT Handle(Standard_Type) ResultType() const Standard_OVERRIDE;
70   
71   //! Returns the Name of the Type which characterizes the Result
72   //! Here, returns "(list)"
73   Standard_EXPORT Standard_CString ResultTypeName() const Standard_OVERRIDE;
74   
75   //! Adds a new Item to the Multiple Result
76   Standard_EXPORT void AddResult (const Handle(Standard_Transient)& res);
77   
78   //! Returns the actual count of recorded (Transient) results
79   Standard_EXPORT Standard_Integer NbResults() const;
80   
81   //! Returns the value of the recorded result n0 <num>
82   Standard_EXPORT Handle(Standard_Transient) ResultValue (const Standard_Integer num) const;
83   
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;
87   
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);
91
92
93
94
95   DEFINE_STANDARD_RTTIEXT(Transfer_MultipleBinder,Transfer_Binder)
96
97 protected:
98
99
100
101
102 private:
103
104
105   Handle(TColStd_HSequenceOfTransient) themulres;
106
107
108 };
109
110
111
112
113
114
115
116 #endif // _Transfer_MultipleBinder_HeaderFile