home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / store / IXStore.h next >
Text File  |  1992-06-02  |  2KB  |  69 lines

  1. /*
  2. IXStore.h
  3. Copyright 1991, NeXT Computer, Inc.
  4. */
  5.  
  6. #import    "protocols.h"
  7. #ifndef    RELEASE_2
  8. #import <mach/mach.h>
  9. #else    RELEASE_2
  10. #import    <mach.h>
  11. #endif    RELEASE_2
  12. #import    <objc/hashtable.h>
  13. #import    <objc/Object.h>
  14.  
  15. extern NXAtom    IXStorePboardType;
  16.  
  17. @interface IXStore: Object
  18. {
  19. @public
  20.     unsigned            changeCount;
  21. @protected
  22.     unsigned            nestingLevel;
  23.     unsigned            queueForward;
  24.     unsigned            queueReverse;
  25.     struct StoreBroker    *storeBroker;
  26. }
  27.  
  28. - copy; // creates independent concurrent context
  29. - free; // reference counted; last call destroys receiver
  30. - init; // creates memory based store
  31.  
  32. // the effects of the following methods are delayed until transaction commit, and reversed by transaction abort, even if transactions are not enabled
  33.  
  34. - (unsigned)copyBlock:(unsigned)handle // copy- on- write primitive
  35.     atOffset:(unsigned)offset forLength:(unsigned)length;
  36. - createBlock:(unsigned *)handle ofSize:(unsigned)size;
  37. - freeBlock:(unsigned)handle; // if IX_ALLBLOCKS, frees all blocks
  38.  
  39. // opening, copying or resizing locks block against access by other contexts; closing clears lock; lock cleared automatically at end of locking transaction
  40.  
  41. - closeBlock:(unsigned)handle;
  42. - (void *)openBlock:(unsigned)handle // opens for writing and shadows
  43.     atOffset:(unsigned)offset forLength:(unsigned)length;
  44. - (void *)readBlock:(unsigned)handle // opens for read) no shadowing
  45.     atOffset:(unsigned)offset forLength:(unsigned)length;
  46.  
  47. - resizeBlock:(unsigned)handle toSize:(unsigned)size;
  48. - (unsigned)sizeOfBlock:(unsigned)handle;
  49.  
  50. // by default, transactions are disabled.  start of first transaction permanently enables transactions.
  51.  
  52. - (unsigned)startTransaction; // transaction nests within previous
  53. - abortTransaction; // discards changes when transactions enabled
  54. - commitTransaction; // flushes changes when transactions disabled
  55.  
  56. - (unsigned)nestingLevel; // returns the current transaction nesting level
  57. - (BOOL)areTransactionsEnabled; // true if transactions enabled for receiver
  58. - (int)changeCount; // increases by one for every commit or abort
  59.  
  60. - compact; // removes free space by relocating blocks, may be slow
  61.  
  62. // these methods dump and load virtual memory images of stores; this is the most efficient way to copy stores.
  63.  
  64. - getContents:(vm_address_t *)data andLength:(vm_size_t *)length;
  65. - setContents:(vm_address_t)data andLength:(vm_size_t)length;
  66.  
  67. @end
  68.  
  69.