MemoryManagerMemMap.h
Go to the documentation of this file.
1 /* ========================================================================
2 * PROJECT: ARToolKitPlus
3 * ========================================================================
4 * This work is based on the original ARToolKit developed by
5 * Hirokazu Kato
6 * Mark Billinghurst
7 * HITLab, University of Washington, Seattle
8 * http://www.hitl.washington.edu/artoolkit/
9 *
10 * Copyright of the derived and new portions of this work
11 * (C) 2006 Graz University of Technology
12 *
13 * This framework is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This framework is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this framework; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 *
27 * For further information please contact
28 * Dieter Schmalstieg
29 * <schmalstieg@icg.tu-graz.ac.at>
30 * Graz University of Technology,
31 * Institut for Computer Graphics and Vision,
32 * Inffeldgasse 16a, 8010 Graz, Austria.
33 * ========================================================================
34 ** @author Daniel Wagner
35 *
36 * $Id: MemoryManagerMemMap.h 162 2006-04-19 21:28:10Z grabner $
37 * @file
38 * ======================================================================== */
39 
40 #ifndef __ARTOOLKITPLUS_MEMORYMANAGERMEMMAP_HEADERFILE__
41 #define __ARTOOLKITPLUS_MEMORYMANAGERMEMMAP_HEADERFILE__
42 
43 #if defined(_MSC_VER) || defined(_WIN32_WCE)
44 
45 #include "MemoryManager.h"
46 #include <windows.h>
47 
48 
49 namespace ARToolKitPlus
50 {
51 
52 
54 
62 class ARTOOLKITPLUS_API MemoryManagerMemMap : public MemoryManager
63 {
64 public:
65  MemoryManagerMemMap();
66  ~MemoryManagerMemMap();
67 
68  bool init(size_t nNumInitialBytes, size_t nNumGrowBytes=0);
69  bool deinit();
70  bool didInit();
71 
72  unsigned int getBytesAllocated() { return (int)fullSize; }
73 
74  void* getMemory(size_t nNumBytes);
75  void releaseMemory(void* nMemoryBlock);
76 
77 protected:
78  bool _didInit;
79 
80  LPVOID lpvMem; // pointer to shared memory
81  HANDLE hMapObject; // handle to file mapping
82 
83  size_t fullSize,
84  reservedSize;
85 };
86 
87 
88 } // namespace ARToolKitPlus
89 
90 
91 #endif
92 
93 #endif //__ARTOOLKITPLUS_MEMORYMANAGERMEMMAP_HEADERFILE__
This file should only be compiled when using ARToolKitPlus as a DLL.
Definition: ar.h:60
static void init(void)
#define ARTOOLKITPLUS_API
Definition: ARToolKitPlus.h:55


tuw_artoolkitplus
Author(s): Markus Bader
autogenerated on Sun Sep 4 2016 03:24:33