~ubuntu-branches/ubuntu/edgy/gnustep-base/edgy

« back to all changes in this revision

Viewing changes to Headers/Foundation/NSPortCoder.h

  • Committer: Bazaar Package Importer
  • Author(s): Eric Heintzmann
  • Date: 2004-04-06 15:21:11 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040406152111-95pwmfi50qp1s594
Tags: 1.9.1-2
* debian/rules: Update CC.
* Source/NSUserDefaults: apply patch from CVS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Interface for NSPortCoder object for distributed objects
 
2
   Copyright (C) 2000 Free Software Foundation, Inc.
 
3
 
 
4
   Written by:  Richard Frith-Macdonald <richard@brainstorm.co.uk>
 
5
   Date: June 2000
 
6
 
 
7
   This file is part of the GNUstep Base Library.
 
8
 
 
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.
 
13
 
 
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.
 
18
 
 
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.
 
22
   */
 
23
 
 
24
#ifndef __NSPortCoder_h
 
25
#define __NSPortCoder_h
 
26
 
 
27
#include <Foundation/NSCoder.h>
 
28
 
 
29
@class NSMutableArray;
 
30
@class NSMutableDictionary;
 
31
@class NSConnection;
 
32
@class NSPort;
 
33
 
 
34
@interface NSPortCoder : NSCoder
 
35
{
 
36
@private
 
37
  NSMutableArray        *_comp;
 
38
  NSConnection          *_conn;
 
39
  BOOL                  _is_by_copy;
 
40
  BOOL                  _is_by_ref;
 
41
// Encoding
 
42
  BOOL                  _encodingRoot;
 
43
  BOOL                  _initialPass;
 
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*
 
49
#endif
 
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
 
55
#undef  GSIMapTable
 
56
#endif
 
57
  unsigned              _xRefC;         /* Counter for cross-reference. */
 
58
  unsigned              _xRefO;         /* Counter for cross-reference. */
 
59
  unsigned              _xRefP;         /* Counter for cross-reference. */
 
60
// Decoding
 
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*
 
67
#endif
 
68
  GSIArray              _clsAry;        /* Class crossreference map.    */
 
69
  GSIArray              _objAry;        /* Object crossreference map.   */
 
70
  GSIArray              _ptrAry;        /* Pointer crossreference map.  */
 
71
#ifndef _IN_PORT_CODER_M
 
72
#undef  GSIArray
 
73
#endif
 
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.    */
 
78
}
 
79
 
 
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;
 
86
 
 
87
- (NSConnection*) connection;
 
88
- (NSPort*) decodePortObject;
 
89
- (void) dispatch;
 
90
- (void) encodePortObject: (NSPort*)aPort;
 
91
- (BOOL) isBycopy;
 
92
- (BOOL) isByref;
 
93
 
 
94
@end
 
95
 
 
96
@interface      NSPortCoder (Private)
 
97
- (NSMutableArray*) _components;
 
98
@end
 
99
 
 
100
 
 
101
#endif /* __NSPortCoder_h */