r2corba 1.6.2 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +5 -5
  3. data/ext/libr2tao/orb.cpp +4 -4
  4. data/ext/libr2tao/values.cpp +14 -14
  5. data/ext/libr2tao/values.h +21 -57
  6. data/lib/corba/cbase/ORB.rb +9 -8
  7. data/lib/corba/cbase/Request.rb +10 -12
  8. data/lib/corba/cbase/Streams.rb +20 -20
  9. data/lib/corba/cbase/Typecode.rb +12 -41
  10. data/lib/corba/cbase/Values.rb +1 -4
  11. data/lib/corba/cbase/exception.rb +0 -2
  12. data/lib/corba/cbase/poa.rb +2 -2
  13. data/lib/corba/cbase/policies.rb +9 -8
  14. data/lib/corba/cbase/require.rb +1 -1
  15. data/lib/corba/cmds/base.rb +1 -2
  16. data/lib/corba/common/Any.rb +2 -3
  17. data/lib/corba/common/IDL.rb +3 -7
  18. data/lib/corba/common/ORB.rb +19 -19
  19. data/lib/corba/common/Object.rb +32 -22
  20. data/lib/corba/common/Request.rb +0 -2
  21. data/lib/corba/common/Servant.rb +4 -9
  22. data/lib/corba/common/Stub.rb +9 -7
  23. data/lib/corba/common/Typecode.rb +44 -27
  24. data/lib/corba/common/Values.rb +4 -5
  25. data/lib/corba/common/require.rb +1 -3
  26. data/lib/corba/common/version.rb +2 -4
  27. data/lib/corba/idl/IDL.rb +0 -2
  28. data/lib/corba/idl/require.rb +2 -2
  29. data/lib/corba/jbase/Any.rb +34 -35
  30. data/lib/corba/jbase/ORB.rb +5 -6
  31. data/lib/corba/jbase/Object.rb +10 -10
  32. data/lib/corba/jbase/Request.rb +8 -9
  33. data/lib/corba/jbase/Servant.rb +32 -36
  34. data/lib/corba/jbase/ServerRequest.rb +10 -8
  35. data/lib/corba/jbase/Streams.rb +80 -78
  36. data/lib/corba/jbase/Stub.rb +1 -1
  37. data/lib/corba/jbase/Typecode.rb +18 -46
  38. data/lib/corba/jbase/Values.rb +0 -1
  39. data/lib/corba/jbase/exception.rb +2 -1
  40. data/lib/corba/jbase/poa.rb +18 -17
  41. data/lib/corba/jbase/policies.rb +42 -45
  42. data/lib/corba/jbase/require.rb +3 -3
  43. data/lib/corba/naming_service.rb +1 -1
  44. data/lib/corba/poa.rb +1 -1
  45. data/lib/corba/policies.rb +2 -2
  46. data/lib/corba/svcs/ins/cos_naming.rb +29 -18
  47. data/lib/corba/svcs/ins/ins.rb +38 -38
  48. data/lib/corba/svcs/ins/naming_service.rb +6 -6
  49. data/lib/corba.rb +1 -1
  50. data/lib/ridlbe/ruby/config.rb +2 -8
  51. data/lib/ridlbe/ruby/walker.rb +94 -108
  52. data/rakelib/config.rb +9 -6
  53. data/rakelib/ext.rake +1 -1
  54. data/rakelib/ext_r2tao.rb +1 -1
  55. data/rakelib/gem.rake +0 -30
  56. data/test/BiDirectional/client.rb +7 -7
  57. data/test/BiDirectional/run_test.rb +2 -2
  58. data/test/BiDirectional/server.rb +13 -13
  59. data/test/CORBA_Services/Naming/BindingIterator/client.rb +9 -9
  60. data/test/CORBA_Services/Naming/BindingIterator/run_test.rb +2 -2
  61. data/test/CORBA_Services/Naming/BindingIterator/server.rb +6 -6
  62. data/test/CORBA_Services/Naming/Corbaname/client.rb +6 -6
  63. data/test/CORBA_Services/Naming/Corbaname/run_test.rb +2 -2
  64. data/test/CORBA_Services/Naming/Corbaname/server.rb +8 -8
  65. data/test/CORBA_Services/Naming/Simple/client.rb +6 -6
  66. data/test/CORBA_Services/Naming/Simple/run_test.rb +2 -2
  67. data/test/CORBA_Services/Naming/Simple/server.rb +6 -6
  68. data/test/Collocation/run_test.rb +2 -2
  69. data/test/Collocation/test.rb +1 -1
  70. data/test/Connect_Timeout/client.rb +7 -7
  71. data/test/Connect_Timeout/run_test.rb +2 -2
  72. data/test/DII/client.rb +10 -10
  73. data/test/DII/run_test.rb +2 -2
  74. data/test/DII/server.rb +7 -7
  75. data/test/DSI/client.rb +6 -6
  76. data/test/DSI/run_test.rb +2 -2
  77. data/test/DSI/server.rb +9 -9
  78. data/test/Exceptions/client.rb +6 -6
  79. data/test/Exceptions/run_test.rb +2 -2
  80. data/test/Exceptions/server.rb +7 -7
  81. data/test/Hello/client.rb +7 -7
  82. data/test/Hello/run_test.rb +2 -2
  83. data/test/Hello/server.rb +7 -7
  84. data/test/IDL_Test/client.rb +9 -9
  85. data/test/IDL_Test/run_test.rb +2 -2
  86. data/test/IDL_Test/server.rb +7 -7
  87. data/test/IORMap/client.rb +7 -7
  88. data/test/IORMap/run_test.rb +2 -2
  89. data/test/IORMap/server.rb +9 -9
  90. data/test/IORTable/client.rb +7 -7
  91. data/test/IORTable/run_test.rb +2 -2
  92. data/test/IORTable/server.rb +10 -10
  93. data/test/Implicit_Conversion/client.rb +5 -5
  94. data/test/Implicit_Conversion/run_test.rb +2 -2
  95. data/test/Implicit_Conversion/server.rb +7 -7
  96. data/test/Multi_Threading/Multiple_ORB/client.rb +6 -6
  97. data/test/Multi_Threading/Multiple_ORB/run_test.rb +2 -2
  98. data/test/Multi_Threading/Multiple_ORB/server.rb +5 -5
  99. data/test/Multi_Threading/Simple/client.rb +6 -6
  100. data/test/Multi_Threading/Simple/run_test.rb +2 -2
  101. data/test/Multi_Threading/Simple/server.rb +8 -8
  102. data/test/Multi_Threading/Threads/client.rb +6 -6
  103. data/test/Multi_Threading/Threads/run_test.rb +2 -2
  104. data/test/Multi_Threading/Threads/server.rb +9 -9
  105. data/test/Multi_Threading/Threads/watchdog.rb +7 -7
  106. data/test/Multiple_Servant_Interfaces/client.rb +7 -7
  107. data/test/Multiple_Servant_Interfaces/run_test.rb +2 -2
  108. data/test/Multiple_Servant_Interfaces/server.rb +7 -7
  109. data/test/Nil/run_test.rb +2 -2
  110. data/test/Nil/test.rb +4 -4
  111. data/test/OBV/AbstractInterface/client.rb +9 -9
  112. data/test/OBV/AbstractInterface/run_test.rb +2 -2
  113. data/test/OBV/AbstractInterface/server.rb +7 -7
  114. data/test/OBV/Custom/client.rb +5 -5
  115. data/test/OBV/Custom/run_test.rb +2 -2
  116. data/test/OBV/Custom/server.rb +7 -7
  117. data/test/OBV/Simple/client.rb +5 -5
  118. data/test/OBV/Simple/run_test.rb +2 -2
  119. data/test/OBV/Simple/server.rb +7 -7
  120. data/test/OBV/Simple_Event/client.rb +5 -5
  121. data/test/OBV/Simple_Event/run_test.rb +2 -2
  122. data/test/OBV/Simple_Event/server.rb +7 -7
  123. data/test/OBV/Supports/client.rb +17 -17
  124. data/test/OBV/Supports/run_test.rb +2 -2
  125. data/test/OBV/Supports/server.rb +7 -7
  126. data/test/OBV/Tree/client.rb +6 -6
  127. data/test/OBV/Tree/run_test.rb +2 -2
  128. data/test/OBV/Tree/server.rb +7 -7
  129. data/test/OBV/Truncatable/client.rb +5 -5
  130. data/test/OBV/Truncatable/run_test.rb +2 -2
  131. data/test/OBV/Truncatable/server.rb +6 -6
  132. data/test/OBV/ValueBox/client.rb +20 -20
  133. data/test/OBV/ValueBox/run_test.rb +2 -2
  134. data/test/OBV/ValueBox/server.rb +8 -8
  135. data/test/Object/client.rb +6 -6
  136. data/test/Object/run_test.rb +2 -2
  137. data/test/Object/server.rb +9 -9
  138. data/test/POA/run_test.rb +2 -2
  139. data/test/POA/test.rb +4 -4
  140. data/test/Param_Test/client.rb +6 -6
  141. data/test/Param_Test/run_test.rb +2 -2
  142. data/test/Param_Test/server.rb +6 -6
  143. data/test/Performance/Simple/client.rb +6 -6
  144. data/test/Performance/Simple/run_test.rb +2 -2
  145. data/test/Performance/Simple/server.rb +7 -7
  146. data/test/Policies/run_test.rb +2 -2
  147. data/test/Policies/test.rb +4 -4
  148. data/test/Timeout/client.rb +11 -11
  149. data/test/Timeout/run_test.rb +2 -2
  150. data/test/Timeout/server.rb +9 -9
  151. data/test/lib/test.rb +5 -5
  152. data/test/test_runner.rb +8 -7
  153. metadata +2 -2
@@ -11,13 +11,13 @@
11
11
  #--------------------------------------------------------------------
12
12
  module R2CORBA
13
13
  module CORBA
14
-
15
14
  def CORBA.is_nil(obj)
16
15
  if obj.nil?
17
16
  return true
18
17
  elsif obj.is_a?(R2CORBA::CORBA::Object) || obj.respond_to?(:_is_nil?)
19
- return obj._is_nil?()
18
+ return obj._is_nil?
20
19
  end
20
+
21
21
  false
22
22
  end
23
23
 
@@ -39,11 +39,13 @@ module R2CORBA
39
39
 
40
40
  def self._wrap_native(nobj)
41
41
  raise ArgumentError, 'Expected org.omg.CORBA.Object' unless nobj.nil? || nobj.is_a?(Native::Object)
42
+
42
43
  (nobj.nil? || (nobj.respond_to?(:_is_nil) && nobj._is_nil)) ? nil : @@wrapper_klass.new(nobj)
43
44
  end
44
45
 
45
46
  def self._narrow(obj)
46
47
  raise CORBA::BAD_PARAM.new('not an object reference', 0, CORBA::COMPLETED_NO) unless obj.nil? || obj.is_a?(CORBA::Object) || obj.is_a?(Native::Object)
48
+
47
49
  obj = self._wrap_native(obj) if obj.is_a?(Native::Object)
48
50
  obj
49
51
  end
@@ -71,18 +73,19 @@ module R2CORBA
71
73
  end
72
74
 
73
75
  # ret InterfaceDef
74
- def _get_interface()
76
+ def _get_interface
75
77
  raise ::CORBA::NO_IMPLEMENT
76
78
  end
77
79
 
78
80
  # ret boolean
79
- def _is_nil?()
81
+ def _is_nil?
80
82
  self.objref_.nil? || (self.objref_.respond_to?(:_is_nil) && self.objref_._is_nil)
81
83
  end
82
84
 
83
85
  # ret ::CORBA::Object
84
- def _duplicate()
85
- return nil if self._is_nil?()
86
+ def _duplicate
87
+ return nil if self._is_nil?
88
+
86
89
  begin
87
90
  self._wrap_native(self.objref_._duplicate)
88
91
  rescue ::NativeException
@@ -91,7 +94,7 @@ module R2CORBA
91
94
  end
92
95
 
93
96
  # ret void
94
- def _release()
97
+ def _release
95
98
  self.objref_._release unless self.objref_.nil?
96
99
  @objref_ = nil
97
100
  end
@@ -99,7 +102,8 @@ module R2CORBA
99
102
  # ::String logical_type_id
100
103
  # ret boolean
101
104
  def _is_a?(logical_type_id)
102
- return false if self._is_nil?()
105
+ return false if self._is_nil?
106
+
103
107
  begin
104
108
  self.objref_._is_a(logical_type_id)
105
109
  rescue ::NativeException
@@ -108,8 +112,9 @@ module R2CORBA
108
112
  end
109
113
 
110
114
  # ret boolean
111
- def _non_existent?()
112
- raise CORBA::INV_OBJREF.new if self._is_nil?()
115
+ def _non_existent?
116
+ raise CORBA::INV_OBJREF.new if self._is_nil?
117
+
113
118
  begin
114
119
  self.objref_._non_existent
115
120
  rescue ::NativeException
@@ -120,7 +125,8 @@ module R2CORBA
120
125
  # ::CORBA::Object other_object
121
126
  # ret boolean
122
127
  def _is_equivalent?(other_object)
123
- raise CORBA::INV_OBJREF.new if self._is_nil?()
128
+ raise CORBA::INV_OBJREF.new if self._is_nil?
129
+
124
130
  begin
125
131
  self.objref_._is_equivalent(other_object)
126
132
  rescue ::NativeException
@@ -131,7 +137,8 @@ module R2CORBA
131
137
  # Integer(ulong) maximum
132
138
  # ret unsigned long
133
139
  def _hash(maximum)
134
- raise CORBA::INV_OBJREF.new if self._is_nil?()
140
+ raise CORBA::INV_OBJREF.new if self._is_nil?
141
+
135
142
  begin
136
143
  self.objref_._hash(maximum)
137
144
  rescue ::NativeException
@@ -140,13 +147,14 @@ module R2CORBA
140
147
  end
141
148
 
142
149
  # ret ::String
143
- def _repository_id()
144
- raise CORBA::INV_OBJREF.new if self._is_nil?()
150
+ def _repository_id
151
+ raise CORBA::INV_OBJREF.new if self._is_nil?
145
152
  ## if this object ref has already been narrowed
146
153
  return self._interface_repository_id if self.respond_to?(:_interface_repository_id)
154
+
147
155
  ## ask the remote side
148
156
  begin
149
- self.objref_._repository_id()
157
+ self.objref_._repository_id
150
158
  rescue ::NativeException
151
159
  CORBA::Exception.native2r($!)
152
160
  end
@@ -178,18 +186,20 @@ module R2CORBA
178
186
  end
179
187
 
180
188
  # ret ::CORBA::Object
181
- def _get_component()
182
- raise CORBA::INV_OBJREF.new if self._is_nil?()
189
+ def _get_component
190
+ raise CORBA::INV_OBJREF.new if self._is_nil?
191
+
183
192
  begin
184
- CORBA::Object._wrap_native(self.objref_._get_component())
193
+ CORBA::Object._wrap_native(self.objref_._get_component)
185
194
  rescue ::NativeException
186
195
  CORBA::Exception.native2r($!)
187
196
  end
188
197
  end
189
198
 
190
199
  # ret CORBA::ORB
191
- def _get_orb()
192
- raise CORBA::INV_OBJREF.new if self._is_nil?()
200
+ def _get_orb
201
+ raise CORBA::INV_OBJREF.new if self._is_nil?
202
+
193
203
  begin
194
204
  CORBA::ORB._wrap_native(self.objref_._get_orb)
195
205
  rescue ::NativeException
@@ -198,14 +208,14 @@ module R2CORBA
198
208
  end
199
209
 
200
210
  def _request(operation)
201
- raise CORBA::INV_OBJREF.new if self._is_nil?()
211
+ raise CORBA::INV_OBJREF.new if self._is_nil?
212
+
202
213
  begin
203
214
  self.objref_._request(operation.to_s)
204
215
  rescue ::NativeException
205
216
  CORBA::Exception.native2r($!)
206
217
  end
207
218
  end
208
-
209
219
  end # Object
210
220
  end # CORBA
211
221
  end # R2CORBA
@@ -11,9 +11,7 @@
11
11
  #--------------------------------------------------------------------
12
12
  module R2CORBA
13
13
  module CORBA
14
-
15
14
  module Request
16
15
  end
17
-
18
16
  end # CORBA
19
17
  end # R2CORBA
@@ -11,14 +11,11 @@
11
11
  #--------------------------------------------------------------------
12
12
 
13
13
  module R2CORBA
14
-
15
14
  module PortableServer
16
-
17
15
  class Servant
18
-
19
16
  module Intf
20
17
  Id = 'IDL:omg.org/CORBA/Object:1.0'.freeze
21
- Ids = [ Id ].freeze
18
+ Ids = [Id].freeze
22
19
  Operations = {}.freeze
23
20
  end
24
21
 
@@ -46,21 +43,21 @@ module R2CORBA
46
43
  end
47
44
 
48
45
  def Servant.include_srv(srv)
49
- if !self.const_defined?('Id')
46
+ unless self.const_defined?('Id')
50
47
  if self.superclass == R2CORBA::PortableServer::Servant || !self.constants.include?('Id')
51
48
  self.const_set('Id', srv::Id.dup.freeze)
52
49
  else
53
50
  self.const_set('Id', self::Id.dup.freeze)
54
51
  end
55
52
  end
56
- if !self.const_defined?('Ids')
53
+ unless self.const_defined?('Ids')
57
54
  if self.superclass == R2CORBA::PortableServer::Servant || !self.constants.include?('Ids')
58
55
  self.const_set('Ids', [])
59
56
  else
60
57
  self.const_set('Ids', self::Ids.dup)
61
58
  end
62
59
  end
63
- if !self.const_defined?('Operations')
60
+ unless self.const_defined?('Operations')
64
61
  if self.superclass == R2CORBA::PortableServer::Servant || !self.constants.include?('Operations')
65
62
  self.const_set('Operations', {})
66
63
  else
@@ -101,7 +98,5 @@ module R2CORBA
101
98
  end
102
99
  end
103
100
  end
104
-
105
101
  end
106
-
107
102
  end
@@ -13,18 +13,18 @@ module R2CORBA
13
13
  module CORBA
14
14
  module Portable
15
15
  module Stub
16
-
17
16
  def self.included(klass)
18
17
  klass.class_eval do
19
18
 
20
- def init()
21
- init_corba_portable_stub()
19
+ def init
20
+ init_corba_portable_stub
22
21
  end
23
22
 
24
23
  def self.create_stub(obj)
25
24
  raise CORBA::INV_OBJREF.new unless obj.is_a?(CORBA::Object)
25
+
26
26
  obj.extend(self) unless obj.is_a?(self)
27
- obj.init()
27
+ obj.init
28
28
  return obj
29
29
  end
30
30
 
@@ -32,10 +32,10 @@ module R2CORBA
32
32
  end
33
33
 
34
34
  Id = 'IDL:omg.org/CORBA/Object:1.0'.freeze
35
- Ids = [ Id ].freeze
35
+ Ids = [Id].freeze
36
36
 
37
37
  protected
38
- def init_corba_portable_stub()
38
+ def init_corba_portable_stub
39
39
  @ids ||= ['IDL:omg.org/CORBA/Object:1.0']
40
40
  end
41
41
 
@@ -49,6 +49,7 @@ module R2CORBA
49
49
  def _narrow!(klass)
50
50
  raise CORBA::OBJECT_NOT_EXIST.new('Nil object narrowed!') if self._is_nil?
51
51
  raise(TypeError, "invalid object narrowed: #{self.class}") unless self.is_a?(CORBA::Stub) && self._is_a?(klass::Id)
52
+
52
53
  self.extend klass
53
54
  _append_ids(*klass::Ids)
54
55
  return self
@@ -57,6 +58,7 @@ module R2CORBA
57
58
  def _unchecked_narrow!(klass)
58
59
  raise CORBA::OBJECT_NOT_EXIST.new('Nil object narrowed!') if self._is_nil?
59
60
  raise(TypeError, "invalid object narrowed: #{self.class}") unless self.is_a?(CORBA::Stub)
61
+
60
62
  self.extend klass
61
63
  _append_ids(*klass::Ids)
62
64
  return self
@@ -66,7 +68,7 @@ module R2CORBA
66
68
  _ids.include?(str) || super(str)
67
69
  end
68
70
 
69
- def inspect()
71
+ def inspect
70
72
  s = ''
71
73
  s << self.class.name.to_s << "\n" <<
72
74
  "type_id: \n" <<
@@ -28,7 +28,8 @@ module R2CORBA
28
28
 
29
29
  def self._wrap_native(ntc)
30
30
  raise ArgumentError, 'Expected org.omg.CORBA.TypeCode' unless ntc.nil? || ntc.is_a?(Native::TypeCode)
31
- ntc.nil?() ? ntc : @@wrapper_klass.new(ntc)
31
+
32
+ ntc.nil? ? ntc : @@wrapper_klass.new(ntc)
32
33
  end
33
34
 
34
35
  def TypeCode._tc
@@ -188,6 +189,7 @@ module R2CORBA
188
189
 
189
190
  def equal?(tc)
190
191
  raise ArgumentError, 'expected CORBA::TypeCode' unless tc.is_a?(CORBA::TypeCode)
192
+
191
193
  begin
192
194
  self.tc_.equal(tc.tc_)
193
195
  rescue ::NativeException
@@ -197,6 +199,7 @@ module R2CORBA
197
199
 
198
200
  def equivalent?(tc)
199
201
  raise ArgumentError, 'expected CORBA::TypeCode' unless tc.is_a?(CORBA::TypeCode)
202
+
200
203
  begin
201
204
  self.tc_.equivalent(tc.tc_)
202
205
  rescue ::NativeException
@@ -206,7 +209,7 @@ module R2CORBA
206
209
 
207
210
  def id
208
211
  begin
209
- self.tc_.id()
212
+ self.tc_.id
210
213
  rescue ::NativeException
211
214
  CORBA::Exception.native2r($!)
212
215
  end
@@ -214,7 +217,7 @@ module R2CORBA
214
217
 
215
218
  def name
216
219
  begin
217
- self.tc_.name()
220
+ self.tc_.name
218
221
  rescue ::NativeException
219
222
  CORBA::Exception.native2r($!)
220
223
  end
@@ -222,7 +225,7 @@ module R2CORBA
222
225
 
223
226
  def member_count
224
227
  begin
225
- self.tc_.member_count()
228
+ self.tc_.member_count
226
229
  rescue ::NativeException
227
230
  CORBA::Exception.native2r($!)
228
231
  end
@@ -254,7 +257,7 @@ module R2CORBA
254
257
 
255
258
  def default_index
256
259
  begin
257
- self.tc_.default_index()
260
+ self.tc_.default_index
258
261
  rescue ::NativeException
259
262
  CORBA::Exception.native2r($!)
260
263
  end
@@ -262,7 +265,7 @@ module R2CORBA
262
265
 
263
266
  def length
264
267
  begin
265
- self.tc_.length()
268
+ self.tc_.length
266
269
  rescue ::NativeException
267
270
  CORBA::Exception.native2r($!)
268
271
  end
@@ -274,7 +277,7 @@ module R2CORBA
274
277
 
275
278
  def fixed_digits
276
279
  begin
277
- self.tc_.fixed_digits()
280
+ self.tc_.fixed_digits
278
281
  rescue ::NativeException
279
282
  CORBA::Exception.native2r($!)
280
283
  end
@@ -282,7 +285,7 @@ module R2CORBA
282
285
 
283
286
  def fixed_scale
284
287
  begin
285
- self.tc_.fixed_scale()
288
+ self.tc_.fixed_scale
286
289
  rescue ::NativeException
287
290
  CORBA::Exception.native2r($!)
288
291
  end
@@ -298,7 +301,7 @@ module R2CORBA
298
301
 
299
302
  def type_modifier
300
303
  begin
301
- self.tc_.type_modifier()
304
+ self.tc_.type_modifier
302
305
  rescue ::NativeException
303
306
  CORBA::Exception.native2r($!)
304
307
  end
@@ -391,7 +394,6 @@ module R2CORBA
391
394
  end
392
395
 
393
396
  class Recursive < CORBA::TypeCode
394
-
395
397
  def initialize(id)
396
398
  raise 'overload required'
397
399
  end
@@ -424,7 +426,6 @@ module R2CORBA
424
426
  end # Recursive
425
427
 
426
428
  class String < CORBA::TypeCode
427
-
428
429
  def initialize(*args)
429
430
  raise 'overload required'
430
431
  end
@@ -435,6 +436,7 @@ module R2CORBA
435
436
 
436
437
  def validate(val)
437
438
  return val if val.nil?
439
+
438
440
  super(val) unless ::String === val || val.respond_to?(:to_str)
439
441
  val = ::String === val ? val : val.to_str
440
442
  raise ::CORBA::MARSHAL.new(
@@ -449,7 +451,6 @@ module R2CORBA
449
451
  end # String
450
452
 
451
453
  class WString < CORBA::TypeCode
452
-
453
454
  def initialize(*args)
454
455
  raise 'overload required'
455
456
  end
@@ -460,6 +461,7 @@ module R2CORBA
460
461
 
461
462
  def validate(val)
462
463
  return val if val.nil?
464
+
463
465
  super(val) unless ::Array === val || val.respond_to?(:to_str) || val.respond_to?(:to_ary)
464
466
  val = if ::Array === val
465
467
  val
@@ -495,7 +497,6 @@ module R2CORBA
495
497
  end # WString
496
498
 
497
499
  class Fixed < CORBA::TypeCode
498
-
499
500
  def initialize(*args)
500
501
  raise 'overload required'
501
502
  end
@@ -506,6 +507,7 @@ module R2CORBA
506
507
 
507
508
  def validate(val)
508
509
  return val if val.nil?
510
+
509
511
  super(val) unless ::BigDecimal === val || val.respond_to?(:to_str)
510
512
  val = ::BigDecimal === val ? val : BigDecimal(val.to_str)
511
513
  val
@@ -517,7 +519,6 @@ module R2CORBA
517
519
  end # Fixed
518
520
 
519
521
  class Sequence < CORBA::TypeCode
520
-
521
522
  def initialize(*args)
522
523
  raise 'overload required'
523
524
  end
@@ -528,6 +529,7 @@ module R2CORBA
528
529
 
529
530
  def validate(val)
530
531
  return val if val.nil?
532
+
531
533
  super(val) unless val.respond_to?(:to_str) || val.respond_to?(:to_ary)
532
534
  val = if self.content_type.kind == TK_OCTET || self.content_type.kind == TK_CHAR
533
535
  if val.respond_to?(:to_str)
@@ -574,7 +576,6 @@ module R2CORBA
574
576
  end
575
577
 
576
578
  class Array < CORBA::TypeCode
577
-
578
579
  def initialize(*args)
579
580
  raise 'overload required'
580
581
  end
@@ -585,6 +586,7 @@ module R2CORBA
585
586
 
586
587
  def validate(val)
587
588
  return val if val.nil?
589
+
588
590
  super(val)
589
591
  raise ::CORBA::MARSHAL.new(
590
592
  "array size exceeds bound: #{self.length.to_s}",
@@ -601,7 +603,6 @@ module R2CORBA
601
603
  end # Array
602
604
 
603
605
  class IdentifiedTypeCode < CORBA::TypeCode
604
-
605
606
  def initialize(id)
606
607
  CORBA::TypeCode.register_id_type(id.to_s, self)
607
608
  end
@@ -637,6 +638,7 @@ module R2CORBA
637
638
 
638
639
  def add_member(name, tc, access)
639
640
  raise ArgumentError, 'expected CORBA::TypeCode' unless tc.is_a?(CORBA::TypeCode)
641
+
640
642
  @members << [name, tc, access]
641
643
  end
642
644
 
@@ -674,6 +676,7 @@ module R2CORBA
674
676
 
675
677
  def validate(val)
676
678
  return val if val.nil?
679
+
677
680
  super(val)
678
681
  if needs_conversion(val)
679
682
  vorg = val
@@ -687,6 +690,7 @@ module R2CORBA
687
690
 
688
691
  def needs_conversion(val)
689
692
  return false if val.nil?
693
+
690
694
  @members.any? { |name, tc| tc.needs_conversion(val.__send__(name.intern)) }
691
695
  end
692
696
 
@@ -696,11 +700,13 @@ module R2CORBA
696
700
 
697
701
  def member_name(index)
698
702
  raise ::CORBA::TypeCode::Bounds.new if (index < 0) || (index >= @members.size)
703
+
699
704
  @members[index][0]
700
705
  end
701
706
 
702
707
  def member_type(index)
703
708
  raise ::CORBA::TypeCode::Bounds.new if (index < 0) || (index >= @members.size)
709
+
704
710
  @members[index][1]
705
711
  end
706
712
 
@@ -741,6 +747,7 @@ module R2CORBA
741
747
 
742
748
  def validate(val)
743
749
  return val if val.nil?
750
+
744
751
  if CORBA::Portable::BoxedValueBase === val
745
752
  super(val)
746
753
  val.value = self.content_type.validate(val.value)
@@ -752,6 +759,7 @@ module R2CORBA
752
759
 
753
760
  def needs_conversion(val)
754
761
  return false if val.nil?
762
+
755
763
  if CORBA::Portable::BoxedValueBase === val
756
764
  self.content_type.needs_conversion(val.value)
757
765
  else
@@ -788,6 +796,7 @@ module R2CORBA
788
796
 
789
797
  def add_member(name, tc)
790
798
  raise ArgumentError, 'expected CORBA::TypeCode' unless tc.is_a?(CORBA::TypeCode)
799
+
791
800
  @members << [name, tc]
792
801
  end
793
802
 
@@ -798,7 +807,7 @@ module R2CORBA
798
807
  @@tc_#{tc.name} ||= TypeCode.typecode_for_id('#{tc.id}')
799
808
  end
800
809
  def initialize(*param_)
801
- #{tc.members.collect {|n, t| "@#{n}"}.join(', ')} = param_
810
+ #{tc.members.collect { |n, t| "@#{n}" }.join(', ')} = param_
802
811
  end
803
812
  end
804
813
  #{tc.name}
@@ -816,6 +825,7 @@ module R2CORBA
816
825
 
817
826
  def validate(val)
818
827
  return val if val.nil?
828
+
819
829
  super(val)
820
830
  if needs_conversion(val)
821
831
  vorg = val
@@ -837,11 +847,13 @@ module R2CORBA
837
847
 
838
848
  def member_name(index)
839
849
  raise ::CORBA::TypeCode::Bounds.new if (index < 0) || (index >= @members.size)
850
+
840
851
  @members[index][0]
841
852
  end
842
853
 
843
854
  def member_type(index)
844
855
  raise ::CORBA::TypeCode::Bounds.new if (index < 0) || (index >= @members.size)
856
+
845
857
  @members[index][1]
846
858
  end
847
859
 
@@ -875,7 +887,7 @@ module R2CORBA
875
887
  @@tc_#{tc.name} ||= TypeCode.typecode_for_id('#{tc.id}')
876
888
  end
877
889
  def initialize(*param_)
878
- #{tc.members.collect {|n, t| "@#{n}"}.join(',')} = param_
890
+ #{tc.members.collect { |n, t| "@#{n}" }.join(',')} = param_
879
891
  end
880
892
  end
881
893
  #{tc.name}
@@ -914,6 +926,7 @@ module R2CORBA
914
926
 
915
927
  def add_member(label, name, tc)
916
928
  raise ArgumentError, 'expected CORBA::TypeCode' unless tc.is_a?(CORBA::TypeCode)
929
+
917
930
  @switchtype.validate(label) unless label == :default
918
931
  @labels[label] = @members.size
919
932
  @members << [label, name.to_s, tc]
@@ -952,12 +965,13 @@ module R2CORBA
952
965
 
953
966
  def validate(val)
954
967
  return val if val.nil?
968
+
955
969
  super(val)
956
970
  @switchtype.validate(val._disc) unless val._disc == :default
957
971
  # raise CORBA::MARSHAL.new(
958
972
  # "invalid discriminator value (#{val._disc.to_s}) for union #{name}",
959
973
  # 1, CORBA::COMPLETED_NO) unless @labels.has_key?(val._disc)
960
- if @labels.has_key?(val._disc) # no need to check for implicit defaults
974
+ if @labels.has_key?(val._disc) # no need to check for implicit defaults
961
975
  if needs_conversion(val)
962
976
  vorg = val
963
977
  val = vorg.class.new
@@ -980,16 +994,19 @@ module R2CORBA
980
994
 
981
995
  def member_name(index)
982
996
  raise CORBA::TypeCode::Bounds.new if (index < 0) || (index >= @members.size)
997
+
983
998
  @members[index][1]
984
999
  end
985
1000
 
986
1001
  def member_type(index)
987
1002
  raise CORBA::TypeCode::Bounds.new if (index < 0) || (index >= @members.size)
1003
+
988
1004
  @members[index][2]
989
1005
  end
990
1006
 
991
1007
  def member_label(index)
992
1008
  raise CORBA::TypeCode::Bounds.new if (index < 0) || (index >= @members.size)
1009
+
993
1010
  @members[index][0]
994
1011
  end
995
1012
 
@@ -1011,6 +1028,7 @@ module R2CORBA
1011
1028
 
1012
1029
  def label_member(val)
1013
1030
  return nil unless (lbl_ix = label_index(val))
1031
+
1014
1032
  member_name(lbl_ix)
1015
1033
  end
1016
1034
 
@@ -1032,7 +1050,7 @@ module R2CORBA
1032
1050
  end
1033
1051
 
1034
1052
  def validate(val)
1035
- super(val) if !val.respond_to?(:to_int)
1053
+ super(val) unless val.respond_to?(:to_int)
1036
1054
  raise CORBA::MARSHAL.new(
1037
1055
  "value (#{val}) out of range (#{@range}) for enum: #{name}",
1038
1056
  1, CORBA::COMPLETED_NO) unless @range === (::Integer === val ? val : val.to_int)
@@ -1049,6 +1067,7 @@ module R2CORBA
1049
1067
 
1050
1068
  def member_name(index)
1051
1069
  raise CORBA::TypeCode::Bounds.new if (index < 0) || (index >= @members.size)
1070
+
1052
1071
  @members[index]
1053
1072
  end
1054
1073
  end # Enum
@@ -1077,18 +1096,17 @@ module R2CORBA
1077
1096
 
1078
1097
  BadKind._tc
1079
1098
  end
1080
-
1081
1099
  end # TypeCode
1082
1100
 
1083
1101
  # define typecode constants for primitive types
1084
- [ 'null', 'void',
1102
+ ['null', 'void',
1085
1103
  'short', 'long', 'ushort', 'ulong', 'longlong', 'ulonglong',
1086
1104
  'float', 'double', 'longdouble',
1087
1105
  'boolean',
1088
1106
  'char', 'octet',
1089
1107
  'wchar',
1090
1108
  'any',
1091
- ].each do |tck|
1109
+ ].each do |tck|
1092
1110
  CORBA.module_eval %Q{
1093
1111
  def CORBA._tc_#{tck}
1094
1112
  @@tc_#{tck} ||= TypeCode.get_primitive_tc(CORBA::TK_#{tck.upcase})
@@ -1097,11 +1115,11 @@ module R2CORBA
1097
1115
  end
1098
1116
 
1099
1117
  def CORBA._tc_string
1100
- @@tc_string ||= TypeCode::String.new()
1118
+ @@tc_string ||= TypeCode::String.new
1101
1119
  end
1102
1120
 
1103
1121
  def CORBA._tc_wstring
1104
- @@tc_wstring ||= TypeCode::WString.new()
1122
+ @@tc_wstring ||= TypeCode::WString.new
1105
1123
  end
1106
1124
 
1107
1125
  # define special typecode constants
@@ -1130,7 +1148,7 @@ module R2CORBA
1130
1148
 
1131
1149
  def CORBA._tc_CompletionStatus
1132
1150
  @@tc_CompletionStatus ||= TypeCode::Enum.new('IDL:omg.org/CORBA/CompletionStatus:1.0', 'CompletionStatus',
1133
- CORBA::COMPLETED_TXT.collect {|t| "COMPLETED_#{t}"})
1151
+ CORBA::COMPLETED_TXT.collect { |t| "COMPLETED_#{t}" })
1134
1152
  end
1135
1153
 
1136
1154
  class LongDouble
@@ -1142,6 +1160,5 @@ module R2CORBA
1142
1160
  CORBA._tc_longdouble
1143
1161
  end
1144
1162
  end
1145
-
1146
1163
  end ## module CORBA
1147
1164
  end ## module R2CORBA
@@ -79,14 +79,13 @@ module R2CORBA
79
79
  VM_TRUNCATABLE = 3
80
80
 
81
81
  VT_MODIFIERS = {
82
- :none => VM_NONE,
83
- :abstract => VM_ABSTRACT,
84
- :truncatable => VM_TRUNCATABLE,
85
- :custom => VM_CUSTOM
82
+ none: VM_NONE,
83
+ abstract: VM_ABSTRACT,
84
+ truncatable: VM_TRUNCATABLE,
85
+ custom: VM_CUSTOM
86
86
  }.freeze
87
87
 
88
88
  PRIVATE_MEMBER = 0
89
89
  PUBLIC_MEMBER = 1
90
-
91
90
  end # CORBA
92
91
  end # R2CORBA