0029151: GCC 7.1 warnings "this statement may fall through" [-Wimplicit-fallthrough=]
[occt.git] / src / NCollection / NCollection_HeapAllocator.hxx
1 // Created on: 2009-12-30
2 // Created by: Alexander GRIGORIEV
3 // Copyright (c) 2009-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #ifndef NCollection_HeapAllocator_HeaderFile
17 #define NCollection_HeapAllocator_HeaderFile
18
19 #include <NCollection_BaseAllocator.hxx>
20
21
22 /**
23  * Allocator that uses the global dynamic heap (malloc / free). 
24  */
25
26 class NCollection_HeapAllocator : public NCollection_BaseAllocator
27 {
28  public:
29   // ---------- PUBLIC METHODS ----------
30   Standard_EXPORT virtual void* Allocate (const Standard_Size theSize) Standard_OVERRIDE;
31   Standard_EXPORT virtual void  Free     (void * anAddress) Standard_OVERRIDE;
32
33   Standard_EXPORT static const Handle(NCollection_HeapAllocator)&
34                                 GlobalHeapAllocator();
35
36  protected:
37   //! Constructor - prohibited
38   NCollection_HeapAllocator(void) {}
39
40  private:
41   //! Copy constructor - prohibited
42   NCollection_HeapAllocator(const NCollection_HeapAllocator&);
43
44  public:
45 // Declaration of CASCADE RTTI
46 DEFINE_STANDARD_RTTIEXT(NCollection_HeapAllocator,NCollection_BaseAllocator)
47 };
48
49 // Definition of HANDLE object using Standard_DefineHandle.hxx
50 DEFINE_STANDARD_HANDLE (NCollection_HeapAllocator, NCollection_BaseAllocator)
51
52 #endif