root/juggler/branches/1.0/SharedMem/vjMemPool.h
| Revision 8789, 2.8 kB (checked in by patrickh, 7 years ago) | |
|---|---|
| |
| Line | |
|---|---|
| 1 | /*************** <auto-copyright.pl BEGIN do not edit this line> ************** |
| 2 | * |
| 3 | * VR Juggler is (C) Copyright 1998, 1999, 2000, 2001, 2002 |
| 4 | * by Iowa State University |
| 5 | * |
| 6 | * Original Authors: |
| 7 | * Allen Bierbaum, Christopher Just, |
| 8 | * Patrick Hartling, Kevin Meinert, |
| 9 | * Carolina Cruz-Neira, Albert Baker |
| 10 | * |
| 11 | * This library is free software; you can redistribute it and/or |
| 12 | * modify it under the terms of the GNU Library General Public |
| 13 | * License as published by the Free Software Foundation; either |
| 14 | * version 2 of the License, or (at your option) any later version. |
| 15 | * |
| 16 | * This library is distributed in the hope that it will be useful, |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 19 | * Library General Public License for more details. |
| 20 | * |
| 21 | * You should have received a copy of the GNU Library General Public |
| 22 | * License along with this library; if not, write to the |
| 23 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 24 | * Boston, MA 02111-1307, USA. |
| 25 | * |
| 26 | * ----------------------------------------------------------------- |
| 27 | * File: $RCSfile$ |
| 28 | * Date modified: $Date$ |
| 29 | * Version: $Revision$ |
| 30 | * ----------------------------------------------------------------- |
| 31 | * |
| 32 | *************** <auto-copyright.pl END do not edit this line> ***************/ |
| 33 | |
| 34 | |
| 35 | #ifndef _MemPool_h_ |
| 36 | #define _MemPool_h_ |
| 37 | //#pragma once |
| 38 | |
| 39 | #include <vjConfig.h> |
| 40 | #include <stdlib.h> |
| 41 | |
| 42 | //: Shared memory pool. |
| 43 | // |
| 44 | // Base class that defines how all memory pools |
| 45 | // should behave. |
| 46 | // |
| 47 | // Author: |
| 48 | // Allen Bierbaum |
| 49 | // |
| 50 | // Date: 1-9-97 |
| 51 | // |
| 52 | class vjMemPool { |
| 53 | |
| 54 | public: |
| 55 | // ---> This is a prototype for what all derived constructors should take as params |
| 56 | // vjMemPool(size_t initialSize, int numProcs, char* staticTempName) { |
| 57 | virtual ~vjMemPool() {;} |
| 58 | |
| 59 | public: |
| 60 | virtual void* allocate(size_t size) = 0; |
| 61 | virtual void deallocate(void* ptr) = 0; |
| 62 | virtual void* reallocate(void *ptr, size_t new_sz) = 0; |
| 63 | |
| 64 | }; |
| 65 | |
| 66 | #if defined(VJ_IRIX_SPROC) |
| 67 | # include <SharedMem/vjMemPoolSGI.h> |
| 68 | # include <SharedMem/vjMemPoolHeap.h> |
| 69 | |
| 70 | typedef vjMemPoolSGI vjSharedPool; |
| 71 | typedef vjMemPoolHeap vjHeapPool; |
| 72 | typedef vjMemPoolSGI vjSyncPool; |
| 73 | #elif defined(VJ_OS_Win32) |
| 74 | # include <SharedMem/vjMemPoolWin32.h> |
| 75 | # include <SharedMem/vjMemPoolHeap.h> |
| 76 | // Everything is heap!!! |
| 77 | typedef vjMemPoolHeap vjSharedPool; |
| 78 | typedef vjMemPoolHeap vjHeapPool; |
| 79 | typedef vjMemPoolHeap vjSyncPool; |
| 80 | #elif defined(VJ_OS_HPUX) || defined(VJ_USE_PTHREADS) |
| 81 | # include <SharedMem/vjMemPool_malloc.h> |
| 82 | # include <SharedMem/vjMemPoolHeap.h> |
| 83 | |
| 84 | typedef vjMemPool_malloc vjSharedPool; |
| 85 | typedef vjMemPoolHeap vjHeapPool; |
| 86 | typedef vjMemPool_malloc vjSyncPool; |
| 87 | #endif /* VJ_IRIX_SPROC */ |
| 88 | |
| 89 | #endif // ifdef vjMemPool_h |
Note: See TracBrowser for help on using the browser.
