1 // Created on: 1992-10-28
2 // Created by: Christian CAILLET
3 // Copyright (c) 1992-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_TransferIterator_HeaderFile
18 #define _Transfer_TransferIterator_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Transfer_HSequenceOfBinder.hxx>
25 #include <TColStd_HSequenceOfInteger.hxx>
26 #include <Standard_Integer.hxx>
27 #include <Standard_Type.hxx>
28 #include <Standard_Boolean.hxx>
29 #include <Transfer_StatusExec.hxx>
30 class Standard_NoSuchObject;
31 class Transfer_Binder;
32 class Standard_Transient;
33 class Interface_Check;
35 // resolve name collisions with X11 headers
40 //! Defines an Iterator on the result of a Transfer
41 //! Available for Normal Results or not (Erroneous Transfer)
42 //! It gives several kinds of Informations, and allows to consider
43 //! various criteria (criteria are cumulative)
44 class Transfer_TransferIterator
51 //! Creates an empty Iterator
52 Standard_EXPORT Transfer_TransferIterator();
54 //! Adds a Binder to the iteration list (construction)
55 Standard_EXPORT void AddItem (const Handle(Transfer_Binder)& atr);
57 //! Selects Items on the Type of Binder : keep only
58 //! Binders which are of a given Type (if keep is True) or
59 //! reject only them (if keep is False)
60 Standard_EXPORT void SelectBinder (const Handle(Standard_Type)& atype, const Standard_Boolean keep);
62 //! Selects Items on the Type of Result. Considers only Unique
63 //! Results. Considers Dynamic Type for Transient Result,
64 //! Static Type (the one given to define the Binder) else.
66 //! Results which are of a given Type (if keep is True) or reject
67 //! only them (if keep is False)
68 Standard_EXPORT void SelectResult (const Handle(Standard_Type)& atype, const Standard_Boolean keep);
70 //! Select Items according Unicity : keep only Unique Results (if
71 //! keep is True) or keep only Multiple Results (if keep is False)
72 Standard_EXPORT void SelectUnique (const Standard_Boolean keep);
74 //! Selects/Unselect (according to <keep> an item designated by
75 //! its rank <num> in the list
76 //! Used by sub-classes which have specific criteria
77 Standard_EXPORT void SelectItem (const Standard_Integer num, const Standard_Boolean keep);
79 //! Returns count of Binders to be iterated
80 Standard_EXPORT Standard_Integer Number() const;
82 //! Clears Iteration in progress, to allow it to be restarted
83 Standard_EXPORT void Start();
85 //! Returns True if there are other Items to iterate
86 Standard_EXPORT Standard_Boolean More();
88 //! Sets Iteration to the next Item
89 Standard_EXPORT void Next();
91 //! Returns the current Binder
92 Standard_EXPORT const Handle(Transfer_Binder)& Value() const;
94 //! Returns True if current Item brings a Result, Transient
95 //! (Handle) or not or Multiple. That is to say, if it corresponds
96 //! to a normally acheived Transfer, Transient Result is read by
97 //! specific TransientResult below.
98 //! Other kind of Result must be read specifically from its Binder
99 Standard_EXPORT Standard_Boolean HasResult() const;
101 //! Returns True if Current Item has a Unique Result
102 Standard_EXPORT Standard_Boolean HasUniqueResult() const;
104 //! Returns the Type of the Result of the current Item, if Unique.
105 //! If No Unique Result (Error Transfert or Multiple Result),
106 //! returns a Null Handle
107 //! The Type is : the Dynamic Type for a Transient Result,
108 //! the Type defined by the Binder Class else
109 Standard_EXPORT Handle(Standard_Type) ResultType() const;
111 //! Returns True if the current Item has a Transient Unique
112 //! Result (if yes, use TransientResult to get it)
113 Standard_EXPORT Standard_Boolean HasTransientResult() const;
115 //! Returns the Transient Result of the current Item if there is
116 //! (else, returns a null Handle)
117 //! Supposes that Binding is done by a SimpleBinderOfTransient
118 Standard_EXPORT const Handle(Standard_Transient)& TransientResult() const;
120 //! Returns Execution Status of current Binder
121 //! Normal transfer corresponds to StatusDone
122 Standard_EXPORT Transfer_StatusExec Status() const;
124 //! Returns True if Fail Messages are recorded with the current
125 //! Binder. They can then be read through Check (see below)
126 Standard_EXPORT Standard_Boolean HasFails() const;
128 //! Returns True if Warning Messages are recorded with the current
129 //! Binder. They can then be read through Check (see below)
130 Standard_EXPORT Standard_Boolean HasWarnings() const;
132 //! Returns Check associated to current Binder
133 //! (in case of error, it brings Fail messages)
134 //! (in case of warnings, it brings Warning messages)
135 Standard_EXPORT const Handle(Interface_Check) Check() const;
144 Standard_Integer thecurr;
151 Handle(Transfer_HSequenceOfBinder) theitems;
152 Handle(TColStd_HSequenceOfInteger) theselect;
153 Standard_Integer themaxi;
164 #endif // _Transfer_TransferIterator_HeaderFile