Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-15 09:17:34

0001 // Created on: 1993-04-07
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Transfer_MultipleBinder_HeaderFile
0018 #define _Transfer_MultipleBinder_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Transient.hxx>
0024 #include <NCollection_Sequence.hxx>
0025 #include <NCollection_HSequence.hxx>
0026 #include <Transfer_Binder.hxx>
0027 #include <Standard_Integer.hxx>
0028 class Standard_Transient;
0029 
0030 //! Allows direct binding between a starting Object and the Result
0031 //! of its transfer, when it can be made of several Transient
0032 //! Objects. Compared to a Transcriptor, it has no Transfer Action
0033 //!
0034 //! Result is a list of Transient Results. Unique Result is not
0035 //! available : SetResult is redefined to start the list on the
0036 //! first call, and refuse the other times.
0037 //!
0038 //! rr
0039 //!
0040 //! Remark : MultipleBinder itself is intended to be created and
0041 //! filled by TransferProcess itself (method Bind). In particular,
0042 //! conflicts between Unique (Standard) result and Multiple result
0043 //! are avoided through management made by TransferProcess.
0044 //!
0045 //! Also, a Transcriptor (with an effective Transfer Method) which
0046 //! can produce a Multiple Result, may be defined as a sub-class
0047 //! of MultipleBinder by redefining method Transfer.
0048 class Transfer_MultipleBinder : public Transfer_Binder
0049 {
0050 
0051 public:
0052   //! normal standard constructor, creates an empty MultipleBinder
0053   Standard_EXPORT Transfer_MultipleBinder();
0054 
0055   //! Returns True if a starting object is bound with SEVERAL
0056   //! results : Here, returns always True
0057   Standard_EXPORT bool IsMultiple() const override;
0058 
0059   //! Returns the Type permitted for Results, i.e. here Transient
0060   Standard_EXPORT occ::handle<Standard_Type> ResultType() const override;
0061 
0062   //! Returns the Name of the Type which characterizes the Result
0063   //! Here, returns "(list)"
0064   Standard_EXPORT const char* ResultTypeName() const override;
0065 
0066   //! Adds a new Item to the Multiple Result
0067   Standard_EXPORT void AddResult(const occ::handle<Standard_Transient>& res);
0068 
0069   //! Returns the actual count of recorded (Transient) results
0070   Standard_EXPORT int NbResults() const;
0071 
0072   //! Returns the value of the recorded result n0 <num>
0073   Standard_EXPORT occ::handle<Standard_Transient> ResultValue(const int num) const;
0074 
0075   //! Returns the Multiple Result, if it is defined (at least one
0076   //! Item). Else, returns a Null Handle
0077   Standard_EXPORT occ::handle<NCollection_HSequence<occ::handle<Standard_Transient>>>
0078                   MultipleResult() const;
0079 
0080   //! Defines a Binding with a Multiple Result, given as a Sequence
0081   //! Error if a Unique Result has yet been defined
0082   Standard_EXPORT void SetMultipleResult(
0083     const occ::handle<NCollection_HSequence<occ::handle<Standard_Transient>>>& mulres);
0084 
0085   DEFINE_STANDARD_RTTIEXT(Transfer_MultipleBinder, Transfer_Binder)
0086 
0087 private:
0088   occ::handle<NCollection_HSequence<occ::handle<Standard_Transient>>> themulres;
0089 };
0090 
0091 #endif // _Transfer_MultipleBinder_HeaderFile