/* 
 * FullCopyList - watch it sizzle!  A highly transportable List subclass!
 *
 * You may freely copy, distribute and reuse the code in this example.
 * This code is provided AS IS without warranty of any kind, expressed 
 * or implied, as to its fitness for any particular use.
 *
 * Copyright 1995 Ralph Zazula (rzazula@next.com).  All Rights Reserved.
 *
 */

#import "FullCopyList.h"

@implementation FullCopyList

- encodeUsing:(id <NXEncoding>)portal 
{
    int i, n = [self count];	
    [portal encodeData:&n ofType:"i"];
    for (i = 0; i < n; i++)
        [portal encodeObjectBycopy:[self objectAt:i]];
    return self;
}

- decodeUsing:(id <NXDecoding>)portal 
{
    int i, n;
    [portal decodeData:&n ofType:"i"];
    [self initCount:n];
    for (i = 0; i < n; i++)
        [self addObject:[portal decodeObject]];
    return self;
}

- encodeRemotelyFor:(NXConnection *)connection
    freeAfterEncoding:(BOOL *)flagp
    isBycopy:(BOOL)isBycopy
{
	/* always jump across the wire */
	*flagp = YES;
	return self;
}

@end
