/
RTypes.ice
216 lines (190 loc) · 4.91 KB
/
RTypes.ice
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
/*
* $Id$
*
* Copyright 2007 Glencoe Software, Inc. All rights reserved.
* Use is subject to license terms supplied in LICENSE.txt
*
*/
#ifndef OMERO_RTYPES_ICE
#define OMERO_RTYPES_ICE
//
// Simple type definitions used for remoting purposes.
// See README.ice for a description of the omero module.
//
module omero {
/**
* Simple base ""protected"" class. Essentially abstract.
**/
["protected"] class RType
{
/**
* Equals-like functionality for all RTypes. A return value
* of 0 means they are equivalent and were almost certainly
* created by the same constructor call, e.g.
*
* <pre>
* rbool(true).compare(rbool(true)) == 0
* </pre>
*
* This method was originally added (Oct 2008) to force the
* base RType class to be abstract in all languages.
**/
int compare(RType rhs);
};
/**
* Boolean wrapper.
**/
["protected"] class RBool extends RType
{
bool val;
bool getValue();
};
/**
* Double wrapper.
**/
["protected"] class RDouble extends RType
{
double val;
double getValue();
};
/**
* Float wrapper.
**/
["protected"] class RFloat extends RType
{
float val;
float getValue();
};
/**
* Integer wrapper.
**/
["protected"] class RInt extends RType
{
int val;
int getValue();
};
/**
* Long Wrapper.
**/
["protected"] class RLong extends RType
{
long val;
long getValue();
};
/**
* String wrapper.
**/
["protected"] class RString extends RType
{
string val;
string getValue();
};
/**
* Extends RString and simply provides runtime
* information to the server that this string
* is intended as a ""protected"" class parameter. Used especially
* by {@link omero.system.ParamMap} (omero/System.ice)
*
* Usage:
* <pre>
* omero::RClass c = ...; // from service
* if (!c.null && c.val.equals("Image")) { ... }
* </pre>
**/
["protected"] class RClass extends RString
{
};
/**
* A simple Time implementation. The long value is the number
* of milliseconds since the epoch (January 1, 1970).
**/
["protected"] class RTime extends RType
{
long val;
long getValue();
};
// Collections
/**
* Simple sequence of {@link RType} instances. Note: when passing
* an {@link RTypeSeq} over the wire, null sequence is maintained and
* will be turned into an empty sequence. If nullability is
* required, see the {@link RCollection} types.
*
* @see RCollection
* @see RTypeDict
*/
["java:type:java.util.ArrayList<omero.RType>:java.util.List<omero.RType>"]
sequence<RType> RTypeSeq;
/**
*
**/
["java:type:java.util.ArrayList<java.util.List<omero.RType>>:java.util.List<java.util.List<omero.RType>>"]
sequence<RTypeSeq> RTypeSeqSeq;
/**
* The collection ""protected"" classes permit the passing of sequences of all
* other RTypes (including other collections) and it is itself nullable. The
* allows for similar arguments to collections in languages with a unified
* inheritance hierarchy (e.g., Java in which all ""protected"" classes extend
* from java.lang.Object).
*
* Unlike the other rtypes which are used internally within the
* {@link omero.model} classes, these types are mutable since they solely
* pass through the
*
* This flexible mechanism is not used in all API calls because
* the flexibility brings a performance penalty.
**/
["protected"] class RCollection extends RType
{
RTypeSeq val;
RTypeSeq getValue();
int size();
RType get(int index);
void add(RType value);
void addAll(RTypeSeq value);
};
/**
* {@link RCollection} mapped to an array on the server of a type given
* by a random member of the RTypeSeq. Only pass consistent arrays!
* homogeneous lists.
**/
["protected"] class RArray extends RCollection
{
};
/**
* {@link RCollection} mapped to a java.util.List on the server
**/
["protected"] class RList extends RCollection
{
};
/**
* {@link RCollection} mapped to a java.util.HashSet on the server
**/
["protected"] class RSet extends RCollection
{
};
/**
* Simple dictionary of {@link RType} instances. Note: when passing
* an RTypeDict over the wire, a null map will not be maintained and
* will be turned into an empty map. If nullability is
* required, see the {@link RMap} type.
**/
["java:type:java.util.HashMap<String,omero.RType>"]
dictionary<string,omero::RType> RTypeDict;
/**
* Similar to {@link RCollection}, the {@link RMap} class permits the passing
* of a possible null {@link RTypeDict} where any other {@link RType} is
* expected.
*
* @see RTypeDict
* @see RCollection
**/
["protected"] class RMap extends RType {
RTypeDict val;
RTypeDict getValue();
int size();
RType get(string key);
void put(string key, RType value);
};
};
#endif // OMERO_RTYPES_ICE