home *** CD-ROM | disk | FTP | other *** search
Wrap
/* IXStore.h Copyright 1991, NeXT Computer, Inc. */ #import "protocols.h" #ifndef RELEASE_2 #import <mach/mach.h> #else RELEASE_2 #import <mach.h> #endif RELEASE_2 #import <objc/hashtable.h> #import <objc/Object.h> extern NXAtom IXStorePboardType; @interface IXStore: Object { @public unsigned changeCount; @protected unsigned nestingLevel; unsigned queueForward; unsigned queueReverse; struct StoreBroker *storeBroker; } - copy; // creates independent concurrent context - free; // reference counted; last call destroys receiver - init; // creates memory based store // the effects of the following methods are delayed until transaction commit, and reversed by transaction abort, even if transactions are not enabled - (unsigned)copyBlock:(unsigned)handle // copy- on- write primitive atOffset:(unsigned)offset forLength:(unsigned)length; - createBlock:(unsigned *)handle ofSize:(unsigned)size; - freeBlock:(unsigned)handle; // if IX_ALLBLOCKS, frees all blocks // opening, copying or resizing locks block against access by other contexts; closing clears lock; lock cleared automatically at end of locking transaction - closeBlock:(unsigned)handle; - (void *)openBlock:(unsigned)handle // opens for writing and shadows atOffset:(unsigned)offset forLength:(unsigned)length; - (void *)readBlock:(unsigned)handle // opens for read) no shadowing atOffset:(unsigned)offset forLength:(unsigned)length; - resizeBlock:(unsigned)handle toSize:(unsigned)size; - (unsigned)sizeOfBlock:(unsigned)handle; // by default, transactions are disabled. start of first transaction permanently enables transactions. - (unsigned)startTransaction; // transaction nests within previous - abortTransaction; // discards changes when transactions enabled - commitTransaction; // flushes changes when transactions disabled - (unsigned)nestingLevel; // returns the current transaction nesting level - (BOOL)areTransactionsEnabled; // true if transactions enabled for receiver - (int)changeCount; // increases by one for every commit or abort - compact; // removes free space by relocating blocks, may be slow // these methods dump and load virtual memory images of stores; this is the most efficient way to copy stores. - getContents:(vm_address_t *)data andLength:(vm_size_t *)length; - setContents:(vm_address_t)data andLength:(vm_size_t)length; @end