home *** CD-ROM | disk | FTP | other *** search
/ Computer Panoráma / computer_panorama_1997-12-hibas.iso / SHARE / GRAPH / PTC051.ZIP / SRC / BLOCK.H next >
C/C++ Source or Header  |  1997-07-24  |  863b  |  60 lines

  1. //////////////////
  2. // Memory block //
  3. //////////////////
  4.  
  5. #ifndef __BLOCK_H
  6. #define __BLOCK_H
  7.  
  8. #include "manager.h"
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16. class MemoryBlock
  17. {
  18.     // friends
  19.     friend MemoryManager;
  20.  
  21.     public:
  22.  
  23.         // setup
  24.         MemoryBlock();
  25.         MemoryBlock(MemoryManager &manager,uint size,int managed=1);
  26.         ~MemoryBlock();
  27.  
  28.         // management
  29.         int alloc(uint size,int managed);
  30.         void free();
  31.  
  32.         // memory access
  33.         void* lock();
  34.         void unlock();
  35.         int count();
  36.  
  37.         // interface
  38.         int resize(uint size);
  39.  
  40.         // object status
  41.         int ok();
  42.  
  43.     private:
  44.  
  45.         // memory manager
  46.         MemoryManager *LocalManager;
  47.  
  48.         // manager block
  49.         MemoryManager::BLOCK *Block;
  50.  
  51.         // dummy manager + dummy block?
  52. };
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60. #endif