]> err.no Git - sope/blob - sope-core/NGStreams/NGActiveSocket+serialization.m
fixed an id string
[sope] / sope-core / NGStreams / NGActiveSocket+serialization.m
1 /*
2   Copyright (C) 2000-2003 SKYRIX Software AG
3
4   This file is part of OGo
5
6   OGo is free software; you can redistribute it and/or modify it under
7   the terms of the GNU Lesser General Public License as published by the
8   Free Software Foundation; either version 2, or (at your option) any
9   later version.
10
11   OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12   WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14   License for more details.
15
16   You should have received a copy of the GNU Lesser General Public
17   License along with OGo; see the file COPYING.  If not, write to the
18   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19   02111-1307, USA.
20 */
21 // $Id$
22
23 #include "NGActiveSocket+serialization.h"
24 #include "common.h"
25
26 @implementation NGActiveSocket(serialization)
27
28 // serialization
29
30 - (void)serializeChar:(char)_value {
31   NGStreamSerializeObjC(self, &_value, @encode(char), nil);
32 }
33 - (void)serializeShort:(short)_value {
34   NGStreamSerializeObjC(self, &_value, @encode(short), nil);
35 }
36 - (void)serializeInt:(int)_value {
37   NGStreamSerializeObjC(self, &_value, @encode(int), nil);
38 }
39 - (void)serializeLong:(long)_value {
40   NGStreamSerializeObjC(self, &_value, @encode(long), nil);
41 }
42
43 - (void)serializeFloat:(float)_value {
44   NGStreamSerializeObjC(self, &_value, @encode(float), nil);
45 }
46 - (void)serializeDouble:(double)_value {
47   NGStreamSerializeObjC(self, &_value, @encode(double), nil);
48 }
49 - (void)serializeLongLong:(long long)_value {
50   NGStreamSerializeObjC(self, &_value, @encode(long long), nil);
51 }
52
53 - (void)serializeCString:(const char *)_value {
54   NGStreamSerializeObjC(self, &_value, @encode(char *), nil);
55 }
56
57 #if USE_SERIALIZER
58 - (void)serializeDataAt:(const void*)_value ofObjCType:(const char*)_type
59   context:(id<NSObjCTypeSerializationCallBack>)_callback {
60
61   NGStreamSerializeObjC(self, _value, _type, _callback);
62 }
63 #endif
64
65 // deserialization
66
67 - (char)deserializeChar {
68   char c;
69   NGStreamDeserializeObjC(self, &c, @encode(char), nil);
70   return c;
71 }
72 - (short)deserializeShort {
73   short s;
74   NGStreamDeserializeObjC(self, &s, @encode(short), nil);
75   return s;
76 }
77 - (int)deserializeInt {
78   int i;
79   NGStreamDeserializeObjC(self, &i, @encode(int), nil);
80   return i;
81 }
82 - (long)deserializeLong {
83   long l;
84   NGStreamDeserializeObjC(self, &l, @encode(long), nil);
85   return l;
86 }
87 - (float)deserializeFloat {
88   float f;
89   NGStreamDeserializeObjC(self, &f, @encode(float), nil);
90   return f;
91 }
92
93 - (double)deserializeDouble {
94   double d;
95   NGStreamDeserializeObjC(self, &d, @encode(double), nil);
96   return d;
97 }
98 - (long long)deserializeLongLong {
99   long long l;
100   NGStreamDeserializeObjC(self, &l, @encode(long long), nil);
101   return l;
102 }
103
104 - (char *)deserializeCString {
105   char *result = NULL;
106   NGStreamDeserializeObjC(self, &result, @encode(char *), nil);
107   return result;
108 }
109
110 #if USE_SERIALIZER
111 - (void)deserializeDataAt:(void *)_value ofObjCType:(const char *)_type
112   context:(id<NSObjCTypeSerializationCallBack>)_callback 
113 {
114   NGStreamDeserializeObjC(self, _value, _type, _callback);
115 }
116 #endif
117
118 @end /* NGActiveSocket(serialization) */
119
120 void __link_NGActiveSocket_serialization(void) {
121   __link_NGActiveSocket_serialization();
122 }