|
|
Sample Programs from NeXSTEP 3.3
/*
* Stores the serial number used during the lifetime of the store.
*
* Author: Kris Younger, NeXT Systems Engineering
* You may freely copy, distribute and reuse the code in this example.
* NeXT disclaims any warranty of any kind, expressed or implied, as to
* its fitness for any particular use.
*/
#import "GlobalThings.h"
@implementation GlobalThings
- init
{
currentSerial = 1;
return self;
}
- (const char *)identification
{
return GLOBALVARIDENT;
}
/* implement IXRecordTranscription protocol for faster serialization. */
- (unsigned int)handle { return runTimeHandle; }
- source: aSource didReadRecord:(unsigned)record
{
return self;
}
- source:aSource willWriteRecord:(unsigned)record
{
if (runTimeHandle == 0) runTimeHandle = record;
return self;
}
- (int)currentSerial
{
return currentSerial;
}
- (int)consumeSerial
{
currentSerial += 1;
return currentSerial;
}
@end
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.