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