1 // Created on: 1993-03-16
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 _Interface_CopyMap_HeaderFile
18 #define _Interface_CopyMap_HeaderFile
19 
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22 
23 #include <TColStd_Array1OfTransient.hxx>
24 #include <Interface_CopyControl.hxx>
25 #include <Standard_Boolean.hxx>
26 class Interface_InterfaceModel;
27 class Interface_InterfaceError;
28 class Standard_Transient;
29 
30 
31 class Interface_CopyMap;
32 DEFINE_STANDARD_HANDLE(Interface_CopyMap, Interface_CopyControl)
33 
34 //! Manages a Map for the need of single Transfers, such as Copies
35 //! In such transfer, Starting Entities are read from a unique
36 //! Starting Model, and each transferred Entity is bound to one
37 //! and only one Result, which cannot be changed later.
38 class Interface_CopyMap : public Interface_CopyControl
39 {
40 
41 public:
42 
43 
44   //! Creates a CopyMap adapted to work from a Model
45   Standard_EXPORT Interface_CopyMap(const Handle(Interface_InterfaceModel)& amodel);
46 
47   //! Clears Transfer List. Gets Ready to begin another Transfer
48   Standard_EXPORT void Clear() Standard_OVERRIDE;
49 
50   //! Returns the InterfaceModel used at Creation time
51   Standard_EXPORT Handle(Interface_InterfaceModel) Model() const;
52 
53   //! Binds a Starting Entity identified by its Number <num> in the
54   //! Starting Model, to a Result of Transfer <res>
55   Standard_EXPORT void Bind (const Handle(Standard_Transient)& ent, const Handle(Standard_Transient)& res) Standard_OVERRIDE;
56 
57   //! Search for the result of a Starting Object (i.e. an Entity,
58   //! identified by its Number <num> in the Starting Model)
59   //! Returns True  if a  Result is Bound (and fills <res>)
60   //! Returns False if no result is Bound (and nullifies <res>)
61   Standard_EXPORT Standard_Boolean Search (const Handle(Standard_Transient)& ent, Handle(Standard_Transient)& res) const Standard_OVERRIDE;
62 
63 
64 
65 
66   DEFINE_STANDARD_RTTIEXT(Interface_CopyMap,Interface_CopyControl)
67 
68 protected:
69 
70 
71 
72 
73 private:
74 
75 
76   Handle(Interface_InterfaceModel) themod;
77   TColStd_Array1OfTransient theres;
78 
79 
80 };
81 
82 
83 
84 
85 
86 
87 
88 #endif // _Interface_CopyMap_HeaderFile
89