File:  [NeXTSTEP 3.3 examples] / Examples / DistributedObjects / remoteSpot / FullCopyList.m
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:49:03 2018 UTC (8 years, 1 month ago) by root
Branches: NeXT, MAIN
CVS tags: NeXTSTEP33, HEAD
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



unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.