home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Examples / DistributedObjects / remoteSpot / FullCopyList.m < prev    next >
Text File  |  1992-07-24  |  997b  |  45 lines

  1. //  FullCopyList by sam
  2. //    a normal list, when passed by copy, passes a copy of the
  3. //    List containing proxies of its items
  4. //    This class delivers a copy of the List containing copies of the items.
  5.  
  6. #import "FullCopyList.h"
  7.  
  8.  
  9. @implementation FullCopyList
  10.  
  11. - encodeRemotelyFor:(NXConnection *)connection freeAfterEncoding:(BOOL *)flagp isBycopy:(BOOL)isBycopy
  12. {
  13.     if (isBycopy) return self;
  14.     return [super encodeRemotelyFor:connection 
  15.         freeAfterEncoding:flagp isBycopy:isBycopy];
  16. }
  17.  
  18. - encodeUsing:(id <NXEncoding>)portal
  19. {
  20.     int    n = [self count];
  21.     int counter;
  22.     
  23.     [portal encodeData:&n ofType:"i"];
  24.     for (counter = 0; counter < n; ++counter) {
  25.         id    anObject = [self objectAt:counter];
  26.         [portal encodeObjectBycopy:anObject];
  27.     }
  28.     return self;
  29. }
  30.  
  31. - decodeUsing:(id <NXDecoding>)portal
  32. {
  33.     int counter, n;
  34.     [portal decodeData:&n ofType:"i"];
  35.     [self initCount:n];
  36.     for (counter = 0; counter < n; ++counter) {
  37.         id anObject = [portal decodeObject];
  38.         [self addObject:anObject];
  39.     }
  40.     return self;
  41. }
  42. @end
  43.  
  44.  
  45.