~ubuntu-branches/ubuntu/karmic/gnustep-base/karmic

« back to all changes in this revision

Viewing changes to Headers/Foundation/NSPortMessage.h

  • Committer: Bazaar Package Importer
  • Author(s): Eric Heintzmann
  • Date: 2005-04-17 00:14:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050417001438-enf0y07c9tku85z1
Tags: 1.10.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* NSPortMessage interface for GNUstep
 
2
   Copyright (C) 1998 Free Software Foundation, Inc.
 
3
   
 
4
   Written by:  Richard frith-Macdonald <richard@brainstorm.co.Ik>
 
5
   Created: October 1998
 
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 __NSPortMessage_h_GNUSTEP_BASE_INCLUDE
 
25
#define __NSPortMessage_h_GNUSTEP_BASE_INCLUDE
 
26
 
 
27
#include <Foundation/NSArray.h>
 
28
#include <Foundation/NSPort.h>
 
29
 
 
30
/**
 
31
 * <p>The data transported for distributed objects communications is sent over
 
32
 * the network encapsulated by NSPortMessage objects, which consist of two
 
33
 * [NSPort]s (sender and receiver, not sent over the network) and a body
 
34
 * consisting of one or more [NSData] or [NSPort] objects. (Data in the
 
35
 * [NSData] must be in network byte order.)</p>
 
36
 *
 
37
 * <p>See the [NSConnection] and [NSPortCoder] classes.</p>
 
38
 */
 
39
@interface      NSPortMessage : NSObject
 
40
{
 
41
  unsigned              _msgid;
 
42
  NSPort                *_recv;
 
43
  NSPort                *_send;
 
44
  NSMutableArray        *_components;
 
45
}
 
46
/**
 
47
 * OpenStep compatibility.
 
48
 */
 
49
- (id) initWithMachMessage: (void*)buffer;
 
50
 
 
51
/** <init/> Initializes to send message described by items (which should
 
52
 * contain only [NSPort] and/or [NSData] objects, with contents in network
 
53
 * byte order) over aPort.  If/when a reply to the message is sent, it will
 
54
 * arrive on anotherPort.
 
55
 */
 
56
- (id) initWithSendPort: (NSPort*)aPort
 
57
            receivePort: (NSPort*)anotherPort
 
58
             components: (NSArray*)items;
 
59
 
 
60
/**
 
61
 * Request that the message be sent before when.  Will block until either
 
62
 * sends it (returns YES) or when expires (returns NO).  The latter may occur
 
63
 * if many messages are queued up (by multiple threads) faster than they can
 
64
 * be sent over the network.
 
65
 */
 
66
- (BOOL) sendBeforeDate: (NSDate*)when;
 
67
 
 
68
/**
 
69
 * Returns the message components originally used to constitute this message.
 
70
 */
 
71
- (NSArray*) components;
 
72
 
 
73
/**
 
74
 * For an outgoing message, returns the port the receiver will send itself
 
75
 * through.  For an incoming message, returns the port replies to the receiver
 
76
 * should be sent through.
 
77
 */
 
78
- (NSPort*) sendPort;
 
79
 
 
80
/**
 
81
 * For an outgoing message, returns the port on which a reply to this message
 
82
 * will arrive.  For an incoming message, returns the port this message
 
83
 * arrived on.
 
84
 */
 
85
- (NSPort*) receivePort;
 
86
 
 
87
/**
 
88
 * Sets ID for message.  This is not used by the distributed objects system,
 
89
 * but may be used in custom ways by cooperating applications to sort or
 
90
 * otherwise organize messages.
 
91
 */
 
92
- (void) setMsgid: (unsigned)anId;
 
93
 
 
94
/**
 
95
 * Returns ID for message.  This is not used by the distributed objects
 
96
 * system, but may be used in custom ways by cooperating applications to sort
 
97
 * or otherwise organize messages.  Set to 0 initially.
 
98
 */
 
99
- (unsigned) msgid;
 
100
@end
 
101
 
 
102
#ifndef NO_GNUSTEP
 
103
@interface      NSPortMessage (private)
 
104
- (NSMutableArray*) _components;
 
105
@end
 
106
#endif
 
107
#endif
 
108