Salome HOME
yfr : Merge with v1.2
[modules/smesh.git] / src / SMDS / Handle_SMDS_HSequenceOfMesh.hxx
1 //  SMESH SMDS : implementaion of Salome mesh data structure
2 //
3 //  Copyright (C) 2003  OPEN CASCADE
4 // 
5 //  This library is free software; you can redistribute it and/or 
6 //  modify it under the terms of the GNU Lesser General Public 
7 //  License as published by the Free Software Foundation; either 
8 //  version 2.1 of the License. 
9 // 
10 //  This library is distributed in the hope that it will be useful, 
11 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
12 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
13 //  Lesser General Public License for more details. 
14 // 
15 //  You should have received a copy of the GNU Lesser General Public 
16 //  License along with this library; if not, write to the Free Software 
17 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
18 // 
19 //  See http://www.opencascade.org or email : webmaster@opencascade.org 
20 //
21 //
22 //
23 //  File   : Handle_SMDS_HSequenceOfMesh.hxx
24 //  Module : SMESH
25
26 #ifndef _Handle_SMDS_HSequenceOfMesh_HeaderFile
27 #define _Handle_SMDS_HSequenceOfMesh_HeaderFile
28
29 #ifndef _Standard_Macro_HeaderFile
30 #include <Standard_Macro.hxx>
31 #endif
32 #ifndef _Standard_HeaderFile
33 #include <Standard.hxx>
34 #endif
35
36 #ifndef _Handle_MMgt_TShared_HeaderFile
37 #include <Handle_MMgt_TShared.hxx>
38 #endif
39
40 class Standard_Transient;
41 class Handle_Standard_Type;
42 class Handle(MMgt_TShared);
43 class SMDS_HSequenceOfMesh;
44 Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(SMDS_HSequenceOfMesh);
45
46 class Handle(SMDS_HSequenceOfMesh) : public Handle(MMgt_TShared) {
47   public:
48     inline void* operator new(size_t,void* anAddress) 
49       {
50         return anAddress;
51       }
52     inline void* operator new(size_t size) 
53       { 
54         return Standard::Allocate(size); 
55       }
56     inline void  operator delete(void *anAddress) 
57       { 
58         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
59       }
60 //    inline void  operator delete(void *anAddress, size_t size) 
61 //      { 
62 //        if (anAddress) Standard::Free((Standard_Address&)anAddress,size); 
63 //      }
64     Handle(SMDS_HSequenceOfMesh)():Handle(MMgt_TShared)() {} 
65     Handle(SMDS_HSequenceOfMesh)(const Handle(SMDS_HSequenceOfMesh)& aHandle) : Handle(MMgt_TShared)(aHandle) 
66      {
67      }
68
69     Handle(SMDS_HSequenceOfMesh)(const SMDS_HSequenceOfMesh* anItem) : Handle(MMgt_TShared)((MMgt_TShared *)anItem) 
70      {
71      }
72
73     Handle(SMDS_HSequenceOfMesh)& operator=(const Handle(SMDS_HSequenceOfMesh)& aHandle)
74      {
75       Assign(aHandle.Access());
76       return *this;
77      }
78
79     Handle(SMDS_HSequenceOfMesh)& operator=(const SMDS_HSequenceOfMesh* anItem)
80      {
81       Assign((Standard_Transient *)anItem);
82       return *this;
83      }
84
85     SMDS_HSequenceOfMesh* operator->() 
86      {
87       return (SMDS_HSequenceOfMesh *)ControlAccess();
88      }
89
90     SMDS_HSequenceOfMesh* operator->() const 
91      {
92       return (SMDS_HSequenceOfMesh *)ControlAccess();
93      }
94
95    Standard_EXPORT ~Handle(SMDS_HSequenceOfMesh)();
96  
97    Standard_EXPORT static const Handle(SMDS_HSequenceOfMesh) DownCast(const Handle(Standard_Transient)& AnObject);
98 };
99 #endif