1
/* Interface for NSPortCoder object for distributed objects
2
Copyright (C) 2000 Free Software Foundation, Inc.
4
Written by: Richard Frith-Macdonald <richard@brainstorm.co.uk>
7
This file is part of the GNUstep Base Library.
9
This library is free software; you can redistribute it and/or
10
modify it under the terms of the GNU Library General Public
11
License as published by the Free Software Foundation; either
12
version 2 of the License, or (at your option) any later version.
14
This library is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
Library General Public License for more details.
19
You should have received a copy of the GNU Library General Public
20
License along with this library; if not, write to the Free
21
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
24
#ifndef __NSPortCoder_h
25
#define __NSPortCoder_h
27
#include <Foundation/NSCoder.h>
29
@class NSMutableArray;
30
@class NSMutableDictionary;
34
@interface NSPortCoder : NSCoder
37
NSMutableArray *_comp;
44
id _dst; /* Serialization destination. */
45
IMP _eObjImp; /* Method to encode an id. */
46
IMP _eValImp; /* Method to encode others. */
47
#ifndef _IN_PORT_CODER_M
48
#define GSIMapTable void*
50
GSIMapTable _clsMap; /* Class cross references. */
51
GSIMapTable _cIdMap; /* Conditionally coded. */
52
GSIMapTable _uIdMap; /* Unconditionally coded. */
53
GSIMapTable _ptrMap; /* Constant pointers. */
54
#ifndef _IN_PORT_CODER_M
57
unsigned _xRefC; /* Counter for cross-reference. */
58
unsigned _xRefO; /* Counter for cross-reference. */
59
unsigned _xRefP; /* Counter for cross-reference. */
61
id _src; /* Deserialization source. */
62
IMP _dDesImp; /* Method to deserialize with. */
63
void (*_dTagImp)(id,SEL,unsigned char*,unsigned*,unsigned*);
64
IMP _dValImp; /* Method to decode data with. */
65
#ifndef _IN_PORT_CODER_M
66
#define GSIArray void*
68
GSIArray _clsAry; /* Class crossreference map. */
69
GSIArray _objAry; /* Object crossreference map. */
70
GSIArray _ptrAry; /* Pointer crossreference map. */
71
#ifndef _IN_PORT_CODER_M
74
NSMutableDictionary *_cInfo; /* Class version information. */
75
unsigned _cursor; /* Position in data buffer. */
76
unsigned _version; /* Version of archiver used. */
77
NSZone *_zone; /* Zone for allocating objs. */
80
+ (NSPortCoder*) portCoderWithReceivePort: (NSPort*)recv
81
sendPort: (NSPort*)send
82
components: (NSArray*)comp;
83
- (id) initWithReceivePort: (NSPort*)recv
84
sendPort: (NSPort*)send
85
components: (NSArray*)comp;
87
- (NSConnection*) connection;
88
- (NSPort*) decodePortObject;
90
- (void) encodePortObject: (NSPort*)aPort;
96
@interface NSPortCoder (Private)
97
- (NSMutableArray*) _components;
101
#endif /* __NSPortCoder_h */