|
|
Sample Programs from NeXSTEP 3.3
// FullCopyList by sam
// a normal list, when passed by copy, passes a copy of the
// List containing proxies of its items
// This class delivers a copy of the List containing copies of the items.
#import "FullCopyList.h"
@implementation FullCopyList
- encodeRemotelyFor:(NXConnection *)connection freeAfterEncoding:(BOOL *)flagp isBycopy:(BOOL)isBycopy
{
if (isBycopy) return self;
return [super encodeRemotelyFor:connection
freeAfterEncoding:flagp isBycopy:isBycopy];
}
- encodeUsing:(id <NXEncoding>)portal
{
int n = [self count];
int counter;
[portal encodeData:&n ofType:"i"];
for (counter = 0; counter < n; ++counter) {
id anObject = [self objectAt:counter];
[portal encodeObjectBycopy:anObject];
}
return self;
}
- decodeUsing:(id <NXDecoding>)portal
{
int counter, n;
[portal decodeData:&n ofType:"i"];
[self initCount:n];
for (counter = 0; counter < n; ++counter) {
id anObject = [portal decodeObject];
[self addObject:anObject];
}
return self;
}
@end
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.