~ubuntu-branches/ubuntu/edgy/sope/edgy

« back to all changes in this revision

Viewing changes to libFoundation/Foundation/NSPortMessage.m

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Ley
  • Date: 2005-08-19 16:53:31 UTC
  • Revision ID: james.westby@ubuntu.com-20050819165331-hs683wz1osm708pw
Tags: upstream-4.4rc.2
ImportĀ upstreamĀ versionĀ 4.4rc.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
   NSPortMessage.m
 
3
 
 
4
   Copyright (C) 1999 Helge Hess.
 
5
   All rights reserved.
 
6
 
 
7
   Author: Helge Hess <hh@mdlink.de>
 
8
 
 
9
   This file is part of libFoundation.
 
10
 
 
11
   Permission to use, copy, modify, and distribute this software and its
 
12
   documentation for any purpose and without fee is hereby granted, provided
 
13
   that the above copyright notice appear in all copies and that both that
 
14
   copyright notice and this permission notice appear in supporting
 
15
   documentation.
 
16
 
 
17
   We disclaim all warranties with regard to this software, including all
 
18
   implied warranties of merchantability and fitness, in no event shall
 
19
   we be liable for any special, indirect or consequential damages or any
 
20
   damages whatsoever resulting from loss of use, data or profits, whether in
 
21
   an action of contract, negligence or other tortious action, arising out of
 
22
   or in connection with the use or performance of this software.
 
23
*/
 
24
 
 
25
#include <Foundation/NSPortMessage.h>
 
26
#include <Foundation/NSPort.h>
 
27
#include <Foundation/NSArray.h>
 
28
 
 
29
@implementation NSPortMessage
 
30
 
 
31
/* message creation */
 
32
 
 
33
- (id)initWithMachMessage:(void *)aMsg
 
34
{
 
35
    return [self notImplemented:_cmd];
 
36
}
 
37
 
 
38
- (id)initWithSendPort:(NSPort *)aSendPort
 
39
  receivePort:(NSPort *)aReceivePort
 
40
  components:(NSArray *)_components
 
41
{
 
42
    self->components  = RETAIN(_components);
 
43
    self->sendPort    = RETAIN(aSendPort);
 
44
    self->receivePort = RETAIN(aReceivePort);
 
45
    return self;
 
46
}
 
47
 
 
48
- (void)dealloc
 
49
{
 
50
    RELEASE(self->components);
 
51
    RELEASE(self->sendPort);
 
52
    RELEASE(self->receivePort);
 
53
    [super dealloc];
 
54
}
 
55
 
 
56
/* getting message components (NSData's or NSPort's) */
 
57
 
 
58
- (NSArray *)components
 
59
{
 
60
    return self->components;
 
61
}
 
62
 
 
63
/* identification */
 
64
 
 
65
- (void)setMsgid:(unsigned int)aMsgId
 
66
{
 
67
    self->msgId = aMsgId;
 
68
}
 
69
- (unsigned int)msgid
 
70
{
 
71
    return self->msgId;
 
72
}
 
73
 
 
74
/* ports */
 
75
 
 
76
- (NSPort *)sendPort
 
77
{
 
78
    return self->sendPort;
 
79
}
 
80
- (NSPort *)receivePort
 
81
{
 
82
    return self->receivePort;
 
83
}
 
84
 
 
85
/* send message */
 
86
 
 
87
- (BOOL)sendBeforeDate:(NSDate *)limitDate
 
88
{
 
89
    return [self->receivePort sendBeforeDate:limitDate
 
90
                              components:
 
91
                                AUTORELEASE([self->components mutableCopy])
 
92
                              from:self->sendPort
 
93
                              reserved:0];
 
94
}
 
95
 
 
96
@end
 
97
 
 
98
/*
 
99
  Local Variables:
 
100
  c-basic-offset: 4
 
101
  tab-width: 8
 
102
  End:
 
103
*/