|
|
1.1 root 1: /*
2: * Stores the serial number used during the lifetime of the store.
3: *
4: * Author: Kris Younger, NeXT Systems Engineering
5: * You may freely copy, distribute and reuse the code in this example.
6: * NeXT disclaims any warranty of any kind, expressed or implied, as to
7: * its fitness for any particular use.
8: */
9: #import "GlobalThings.h"
10:
11: @implementation GlobalThings
12: - init
13: {
14: currentSerial = 1;
15: return self;
16: }
17: - (const char *)identification
18: {
19: return GLOBALVARIDENT;
20: }
21: /* implement IXRecordTranscription protocol for faster serialization. */
22: - (unsigned int)handle { return runTimeHandle; }
23:
24: - source: aSource didReadRecord:(unsigned)record
25: {
26: return self;
27: }
28:
29: - source:aSource willWriteRecord:(unsigned)record
30: {
31: if (runTimeHandle == 0) runTimeHandle = record;
32: return self;
33: }
34:
35: - (int)currentSerial
36: {
37: return currentSerial;
38: }
39:
40: - (int)consumeSerial
41: {
42: currentSerial += 1;
43: return currentSerial;
44: }
45:
46: @end
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.