00001 /* ======================================================================== 00002 * PROJECT: ARToolKitPlus 00003 * ======================================================================== 00004 * This work is based on the original ARToolKit developed by 00005 * Hirokazu Kato 00006 * Mark Billinghurst 00007 * HITLab, University of Washington, Seattle 00008 * http://www.hitl.washington.edu/artoolkit/ 00009 * 00010 * Copyright of the derived and new portions of this work 00011 * (C) 2006 Graz University of Technology 00012 * 00013 * This framework is free software; you can redistribute it and/or modify 00014 * it under the terms of the GNU General Public License as published by 00015 * the Free Software Foundation; either version 2 of the License, or 00016 * (at your option) any later version. 00017 * 00018 * This framework is distributed in the hope that it will be useful, 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 * GNU General Public License for more details. 00022 * 00023 * You should have received a copy of the GNU General Public License 00024 * along with this framework; if not, write to the Free Software 00025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00026 * 00027 * For further information please contact 00028 * Dieter Schmalstieg 00029 * <schmalstieg@icg.tu-graz.ac.at> 00030 * Graz University of Technology, 00031 * Institut for Computer Graphics and Vision, 00032 * Inffeldgasse 16a, 8010 Graz, Austria. 00033 * ======================================================================== 00034 ** @author Daniel Wagner 00035 * 00036 * $Id: MemoryManagerMemMap.h 162 2006-04-19 21:28:10Z grabner $ 00037 * @file 00038 * ======================================================================== */ 00039 00040 #ifndef __ARTOOLKITPLUS_MEMORYMANAGERMEMMAP_HEADERFILE__ 00041 #define __ARTOOLKITPLUS_MEMORYMANAGERMEMMAP_HEADERFILE__ 00042 00043 #if defined(_MSC_VER) || defined(_WIN32_WCE) 00044 00045 #include "MemoryManager.h" 00046 #include <windows.h> 00047 00048 00049 namespace ARToolKitPlus 00050 { 00051 00052 00054 00062 class ARTOOLKITPLUS_API MemoryManagerMemMap : public MemoryManager 00063 { 00064 public: 00065 MemoryManagerMemMap(); 00066 ~MemoryManagerMemMap(); 00067 00068 bool init(size_t nNumInitialBytes, size_t nNumGrowBytes=0); 00069 bool deinit(); 00070 bool didInit(); 00071 00072 unsigned int getBytesAllocated() { return (int)fullSize; } 00073 00074 void* getMemory(size_t nNumBytes); 00075 void releaseMemory(void* nMemoryBlock); 00076 00077 protected: 00078 bool _didInit; 00079 00080 LPVOID lpvMem; // pointer to shared memory 00081 HANDLE hMapObject; // handle to file mapping 00082 00083 size_t fullSize, 00084 reservedSize; 00085 }; 00086 00087 00088 } // namespace ARToolKitPlus 00089 00090 00091 #endif 00092 00093 #endif //__ARTOOLKITPLUS_MEMORYMANAGERMEMMAP_HEADERFILE__