Salome HOME
Porting to 64bit platform
[modules/geom.git] / src / NMTTools / NMTTools_CommonBlockPool.hxx
1 // File generated by CPPExt (Value)
2 //                     Copyright (C) 1991,1995 by
3 //  
4 //                      MATRA DATAVISION, FRANCE
5 //  
6 // This software is furnished in accordance with the terms and conditions
7 // of the contract and with the inclusion of the above copyright notice.
8 // This software or any other copy thereof may not be provided or otherwise
9 // be made available to any other person. No title to an ownership of the
10 // software is hereby transferred.
11 //  
12 // At the termination of the contract, the software and all copies of this
13 // software must be deleted.
14
15 #ifndef _NMTTools_CommonBlockPool_HeaderFile
16 #define _NMTTools_CommonBlockPool_HeaderFile
17
18 #ifndef _Standard_Address_HeaderFile
19 #include <Standard_Address.hxx>
20 #endif
21 #ifndef _Standard_Integer_HeaderFile
22 #include <Standard_Integer.hxx>
23 #endif
24 #ifndef _Standard_Boolean_HeaderFile
25 #include <Standard_Boolean.hxx>
26 #endif
27 class Standard_OutOfRange;
28 class Standard_OutOfMemory;
29 class NMTTools_ListOfCommonBlock;
30
31
32 #ifndef _Standard_HeaderFile
33 #include <Standard.hxx>
34 #endif
35 #ifndef _Standard_Macro_HeaderFile
36 #include <Standard_Macro.hxx>
37 #endif
38
39 class NMTTools_CommonBlockPool  {
40
41 public:
42
43     void* operator new(size_t,void* anAddress) 
44       {
45         return anAddress;
46       }
47     void* operator new(size_t size) 
48       { 
49         return Standard::Allocate(size); 
50       }
51     void  operator delete(void *anAddress) 
52       { 
53         if (anAddress) Standard::Free((Standard_Address&)anAddress); 
54       }
55  // Methods PUBLIC
56  // 
57 Standard_EXPORT NMTTools_CommonBlockPool(const Standard_Integer Length = 0,const Standard_Integer BlockLength = 5);
58 Standard_EXPORT   void Resize(const Standard_Integer theNewLength) ;
59 Standard_EXPORT   void Destroy() ;
60 ~NMTTools_CommonBlockPool()
61 {
62   Destroy();
63 }
64
65 Standard_EXPORT   Standard_Integer Length() const;
66 Standard_EXPORT   Standard_Integer Extent() const;
67 Standard_EXPORT   Standard_Integer FactLength() const;
68 Standard_EXPORT   Standard_Integer Append(const NMTTools_ListOfCommonBlock& Value) ;
69 Standard_EXPORT   void Remove(const Standard_Integer Index) ;
70 Standard_EXPORT  const NMTTools_ListOfCommonBlock& Value(const Standard_Integer Index) const;
71  const NMTTools_ListOfCommonBlock& operator ()(const Standard_Integer Index) const
72 {
73   return Value(Index);
74 }
75
76 Standard_EXPORT   NMTTools_ListOfCommonBlock& ChangeValue(const Standard_Integer Index) ;
77   NMTTools_ListOfCommonBlock& operator ()(const Standard_Integer Index) 
78 {
79   return ChangeValue(Index);
80 }
81
82 Standard_EXPORT   void SetBlockLength(const Standard_Integer aBL) ;
83 Standard_EXPORT   Standard_Integer BlockLength() const;
84
85
86
87
88
89 protected:
90
91  // Methods PROTECTED
92  // 
93
94
95  // Fields PROTECTED
96  //
97
98
99 private: 
100
101  // Methods PRIVATE
102  // 
103 Standard_EXPORT NMTTools_CommonBlockPool(const NMTTools_CommonBlockPool& AnArray);
104 Standard_EXPORT   NMTTools_CommonBlockPool& Assign(const NMTTools_CommonBlockPool& Other) ;
105   NMTTools_CommonBlockPool& operator =(const NMTTools_CommonBlockPool& Other) 
106 {
107   return Assign(Other);
108 }
109
110 Standard_EXPORT   Standard_Boolean IsInvalidIndex(const Standard_Integer Index) const;
111
112
113  // Fields PRIVATE
114  //
115 Standard_Address myStart;
116 Standard_Integer myLength;
117 Standard_Integer myFactLength;
118 Standard_Integer myBlockLength;
119 Standard_Boolean myIsAllocated;
120
121
122 };
123
124
125
126
127
128 // other Inline functions and methods (like "C++: function call" methods)
129 //
130
131
132 #endif