50299d927f7cf46eb06a5b30b0714872b4cdf57a
[occt.git] / src / Transfer / Transfer_ActorOfProcessForFinder.hxx
1 // Created on: 1992-02-03
2 // Created by: Christian CAILLET
3 // Copyright (c) 1992-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_ActorOfProcessForFinder_HeaderFile
18 #define _Transfer_ActorOfProcessForFinder_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <Standard_Boolean.hxx>
24 #include <Standard_Transient.hxx>
25 #include <Transfer_HSequenceOfFinder.hxx>
26 #include <Transfer_TransferMapOfProcessForFinder.hxx>
27 #include <Message_ProgressRange.hxx>
28
29 class Standard_DomainError;
30 class Transfer_Finder;
31 class Transfer_FindHasher;
32 class Transfer_ProcessForFinder;
33 class Transfer_IteratorOfProcessForFinder;
34 class Transfer_Binder;
35 class Transfer_SimpleBinderOfTransient;
36 class Standard_Transient;
37
38 class Transfer_ActorOfProcessForFinder;
39 DEFINE_STANDARD_HANDLE(Transfer_ActorOfProcessForFinder, Standard_Transient)
40
41
42 class Transfer_ActorOfProcessForFinder : public Standard_Transient
43 {
44
45 public:
46
47   
48   Standard_EXPORT Transfer_ActorOfProcessForFinder();
49   
50   //! Prerequesite for Transfer : the method Transfer is
51   //! called on a starting object only if Recognize has
52   //! returned True on it
53   //! This allows to define a list of Actors, each one
54   //! processing a definite kind of data
55   //! TransferProcess calls Recognize on each one before
56   //! calling Transfer. But even if Recognize has returned
57   //! True, Transfer can reject by returning a Null Binder
58   //! (afterwards rejection), the next actor is then invoked
59   //!
60   //! The provided default returns True, can be redefined
61   Standard_EXPORT virtual Standard_Boolean Recognize (const Handle(Transfer_Finder)& start);
62   
63   //! Specific action of Transfer. The Result is stored in
64   //! the returned Binder, or a Null Handle for "No result"
65   //! (Default defined as doing nothing; should be deffered)
66   //! "mutable" allows the Actor to record intermediate
67   //! information, in addition to those of TransferProcess
68   Standard_EXPORT virtual Handle(Transfer_Binder) Transferring
69                    (const Handle(Transfer_Finder)& start,
70                     const Handle(Transfer_ProcessForFinder)& TP,
71                     const Message_ProgressRange& theProgress = Message_ProgressRange());
72   
73   //! Prepares and Returns a Binder for a Transient Result
74   //! Returns a Null Handle if <res> is itself Null
75   Standard_EXPORT Handle(Transfer_SimpleBinderOfTransient) TransientResult (const Handle(Standard_Transient)& res) const;
76   
77   //! Returns a Binder for No Result, i.e. a Null Handle
78   Standard_EXPORT Handle(Transfer_Binder) NullResult() const;
79   
80   //! If <mode> is True, commands an Actor to be set at the
81   //! end of the list of Actors (see SetNext)
82   //! If it is False (creation default), each add Actor is
83   //! set at the beginning of the list
84   //! This allows to define default Actors (which are Last)
85   Standard_EXPORT void SetLast (const Standard_Boolean mode = Standard_True);
86   
87   //! Returns the Last status (see SetLast).
88   Standard_EXPORT Standard_Boolean IsLast() const;
89   
90   //! Defines a Next Actor : it can then be asked to work if
91   //! <me> produces no result for a given type of Object.
92   //! If Next is already set and is not "Last", calls
93   //! SetNext on it. If Next defined and "Last", the new
94   //! actor is added before it in the list
95   Standard_EXPORT void SetNext (const Handle(Transfer_ActorOfProcessForFinder)& next);
96   
97   //! Returns the Actor defined as Next, or a Null Handle
98   Standard_EXPORT Handle(Transfer_ActorOfProcessForFinder) Next() const;
99
100
101
102
103   DEFINE_STANDARD_RTTI_INLINE(Transfer_ActorOfProcessForFinder,Standard_Transient)
104
105 protected:
106
107
108
109
110 private:
111
112
113   Handle(Transfer_ActorOfProcessForFinder) thenext;
114   Standard_Boolean thelast;
115
116
117 };
118
119
120
121
122
123
124
125 #endif // _Transfer_ActorOfProcessForFinder_HeaderFile