Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

gmemmgr.hpp

Go to the documentation of this file.
00001 //************************************************************************************//
00002 // Module       : gmemmgr.hpp
00003 // Date         : 10/11/04 (DLR)
00004 // Copyright    : 2004-2006 Copyright University Corporation for Atmospheric
00005 //                Research
00006 // Description  : Encapsulates the methods and data associated with
00007 //                a GASpAR element-based memory manager. This class provides
00008 //                access to temp space allocated to be the size of the element member
00009 //                data's data segment size by default. A new vector memory space when
00010 //                allocated, is wrapped by a semaphore so that it cannot be accessed
00011 //                again, until the memory space is made available again. This is
00012 //                accomplished by a call to the method Unlock.
00013 // Derived From : none.
00014 // Modifications:
00015 //************************************************************************************//
00016 #if !defined(GMEMMGR_HPP)
00017 #define GMEMMGR_HPP
00018 
00019 #include "gttlist.hpp"
00020 
00021 
00022 class GMemMgr 
00023 {
00024 public:
00025                   GMemMgr(GINT numvecs=1);
00026                  ~GMemMgr();
00027                   GMemMgr(const GMemMgr &a);
00028 
00029 GBOOL             Lock(GVector *v);                                // lock a vector
00030 GBOOL             Unlock(GVector *v);                              // unlock a vector
00031 void              Delete(GVector *v);                              // delete memory area
00032 void              Delete(GINT i);                                  // delete memory area
00033 GBOOL             GetGVec(GVector *&vec);                          // get a vector
00034 GVector           *GetGVec(GINT i);                                // get a specific vector from list
00035 GINT              GetFirstAvail();                                 // get 1st available specific index
00036 GINT              GetIndex(GVector *&vec);                         // get index of specified temp vector
00037 GBOOL             AddBlocks(GINT n);                               // add n new blocks to mgr
00038 void              SetSize(GINT n);                                 // set memory block sizes
00039 GINT              GetNumBlocks();                                  // get current num of mem. blocks (vectors)
00040 
00041 
00042 
00043 private:
00044 // Private methods:
00045  
00046 
00047 // Private data:
00048 GINT              NN_;                             // size of data blocks (vectors)
00049 GVecList          vlocked_;                        // locked vector indices
00050 GVecList          gveclist_ ;                      // list of available vectors
00051 
00052 };
00053 #endif
00054 

Generated on Wed Dec 21 16:00:48 2005 for Geophysics & Astrophysics Spectral Element Adaptive Refinement (GASpAR) 2D Code by  doxygen 1.4.4