r2corba 1.6.2-x64-mingw32 → 1.7.1-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (151) hide show
  1. checksums.yaml +5 -5
  2. data/README.rdoc +5 -5
  3. data/lib/corba/cbase/ORB.rb +9 -8
  4. data/lib/corba/cbase/Request.rb +10 -12
  5. data/lib/corba/cbase/Streams.rb +20 -20
  6. data/lib/corba/cbase/Typecode.rb +12 -41
  7. data/lib/corba/cbase/Values.rb +1 -4
  8. data/lib/corba/cbase/exception.rb +0 -2
  9. data/lib/corba/cbase/poa.rb +2 -2
  10. data/lib/corba/cbase/policies.rb +9 -8
  11. data/lib/corba/cbase/require.rb +1 -1
  12. data/lib/corba/cmds/base.rb +1 -2
  13. data/lib/corba/common/Any.rb +2 -3
  14. data/lib/corba/common/IDL.rb +3 -7
  15. data/lib/corba/common/ORB.rb +19 -19
  16. data/lib/corba/common/Object.rb +32 -22
  17. data/lib/corba/common/Request.rb +0 -2
  18. data/lib/corba/common/Servant.rb +4 -9
  19. data/lib/corba/common/Stub.rb +9 -7
  20. data/lib/corba/common/Typecode.rb +44 -27
  21. data/lib/corba/common/Values.rb +4 -5
  22. data/lib/corba/common/require.rb +1 -3
  23. data/lib/corba/common/version.rb +2 -4
  24. data/lib/corba/idl/IDL.rb +0 -2
  25. data/lib/corba/idl/require.rb +2 -2
  26. data/lib/corba/jbase/Any.rb +34 -35
  27. data/lib/corba/jbase/ORB.rb +5 -6
  28. data/lib/corba/jbase/Object.rb +10 -10
  29. data/lib/corba/jbase/Request.rb +8 -9
  30. data/lib/corba/jbase/Servant.rb +32 -36
  31. data/lib/corba/jbase/ServerRequest.rb +10 -8
  32. data/lib/corba/jbase/Streams.rb +80 -78
  33. data/lib/corba/jbase/Stub.rb +1 -1
  34. data/lib/corba/jbase/Typecode.rb +18 -46
  35. data/lib/corba/jbase/Values.rb +0 -1
  36. data/lib/corba/jbase/exception.rb +2 -1
  37. data/lib/corba/jbase/poa.rb +18 -17
  38. data/lib/corba/jbase/policies.rb +42 -45
  39. data/lib/corba/jbase/require.rb +3 -3
  40. data/lib/corba/naming_service.rb +1 -1
  41. data/lib/corba/poa.rb +1 -1
  42. data/lib/corba/policies.rb +2 -2
  43. data/lib/corba/svcs/ins/cos_naming.rb +29 -18
  44. data/lib/corba/svcs/ins/ins.rb +38 -38
  45. data/lib/corba/svcs/ins/naming_service.rb +6 -6
  46. data/lib/corba.rb +1 -1
  47. data/lib/ridlbe/ruby/config.rb +2 -8
  48. data/lib/ridlbe/ruby/orb.pidlc +0 -0
  49. data/lib/ridlbe/ruby/walker.rb +94 -108
  50. data/rakelib/config.rb +9 -6
  51. data/rakelib/ext.rake +1 -1
  52. data/rakelib/ext_r2tao.rb +1 -1
  53. data/rakelib/gem.rake +0 -30
  54. data/test/BiDirectional/client.rb +7 -7
  55. data/test/BiDirectional/run_test.rb +2 -2
  56. data/test/BiDirectional/server.rb +13 -13
  57. data/test/CORBA_Services/Naming/BindingIterator/client.rb +9 -9
  58. data/test/CORBA_Services/Naming/BindingIterator/run_test.rb +2 -2
  59. data/test/CORBA_Services/Naming/BindingIterator/server.rb +6 -6
  60. data/test/CORBA_Services/Naming/Corbaname/client.rb +6 -6
  61. data/test/CORBA_Services/Naming/Corbaname/run_test.rb +2 -2
  62. data/test/CORBA_Services/Naming/Corbaname/server.rb +8 -8
  63. data/test/CORBA_Services/Naming/Simple/client.rb +6 -6
  64. data/test/CORBA_Services/Naming/Simple/run_test.rb +2 -2
  65. data/test/CORBA_Services/Naming/Simple/server.rb +6 -6
  66. data/test/Collocation/run_test.rb +2 -2
  67. data/test/Collocation/test.rb +1 -1
  68. data/test/Connect_Timeout/client.rb +7 -7
  69. data/test/Connect_Timeout/run_test.rb +2 -2
  70. data/test/DII/client.rb +10 -10
  71. data/test/DII/run_test.rb +2 -2
  72. data/test/DII/server.rb +7 -7
  73. data/test/DSI/client.rb +6 -6
  74. data/test/DSI/run_test.rb +2 -2
  75. data/test/DSI/server.rb +9 -9
  76. data/test/Exceptions/client.rb +6 -6
  77. data/test/Exceptions/run_test.rb +2 -2
  78. data/test/Exceptions/server.rb +7 -7
  79. data/test/Hello/client.rb +7 -7
  80. data/test/Hello/run_test.rb +2 -2
  81. data/test/Hello/server.rb +7 -7
  82. data/test/IDL_Test/client.rb +9 -9
  83. data/test/IDL_Test/run_test.rb +2 -2
  84. data/test/IDL_Test/server.rb +7 -7
  85. data/test/IORMap/client.rb +7 -7
  86. data/test/IORMap/run_test.rb +2 -2
  87. data/test/IORMap/server.rb +9 -9
  88. data/test/IORTable/client.rb +7 -7
  89. data/test/IORTable/run_test.rb +2 -2
  90. data/test/IORTable/server.rb +10 -10
  91. data/test/Implicit_Conversion/client.rb +5 -5
  92. data/test/Implicit_Conversion/run_test.rb +2 -2
  93. data/test/Implicit_Conversion/server.rb +7 -7
  94. data/test/Multi_Threading/Multiple_ORB/client.rb +6 -6
  95. data/test/Multi_Threading/Multiple_ORB/run_test.rb +2 -2
  96. data/test/Multi_Threading/Multiple_ORB/server.rb +5 -5
  97. data/test/Multi_Threading/Simple/client.rb +6 -6
  98. data/test/Multi_Threading/Simple/run_test.rb +2 -2
  99. data/test/Multi_Threading/Simple/server.rb +8 -8
  100. data/test/Multi_Threading/Threads/client.rb +6 -6
  101. data/test/Multi_Threading/Threads/run_test.rb +2 -2
  102. data/test/Multi_Threading/Threads/server.rb +9 -9
  103. data/test/Multi_Threading/Threads/watchdog.rb +7 -7
  104. data/test/Multiple_Servant_Interfaces/client.rb +7 -7
  105. data/test/Multiple_Servant_Interfaces/run_test.rb +2 -2
  106. data/test/Multiple_Servant_Interfaces/server.rb +7 -7
  107. data/test/Nil/run_test.rb +2 -2
  108. data/test/Nil/test.rb +4 -4
  109. data/test/OBV/AbstractInterface/client.rb +9 -9
  110. data/test/OBV/AbstractInterface/run_test.rb +2 -2
  111. data/test/OBV/AbstractInterface/server.rb +7 -7
  112. data/test/OBV/Custom/client.rb +5 -5
  113. data/test/OBV/Custom/run_test.rb +2 -2
  114. data/test/OBV/Custom/server.rb +7 -7
  115. data/test/OBV/Simple/client.rb +5 -5
  116. data/test/OBV/Simple/run_test.rb +2 -2
  117. data/test/OBV/Simple/server.rb +7 -7
  118. data/test/OBV/Simple_Event/client.rb +5 -5
  119. data/test/OBV/Simple_Event/run_test.rb +2 -2
  120. data/test/OBV/Simple_Event/server.rb +7 -7
  121. data/test/OBV/Supports/client.rb +17 -17
  122. data/test/OBV/Supports/run_test.rb +2 -2
  123. data/test/OBV/Supports/server.rb +7 -7
  124. data/test/OBV/Tree/client.rb +6 -6
  125. data/test/OBV/Tree/run_test.rb +2 -2
  126. data/test/OBV/Tree/server.rb +7 -7
  127. data/test/OBV/Truncatable/client.rb +5 -5
  128. data/test/OBV/Truncatable/run_test.rb +2 -2
  129. data/test/OBV/Truncatable/server.rb +6 -6
  130. data/test/OBV/ValueBox/client.rb +20 -20
  131. data/test/OBV/ValueBox/run_test.rb +2 -2
  132. data/test/OBV/ValueBox/server.rb +8 -8
  133. data/test/Object/client.rb +6 -6
  134. data/test/Object/run_test.rb +2 -2
  135. data/test/Object/server.rb +9 -9
  136. data/test/POA/run_test.rb +2 -2
  137. data/test/POA/test.rb +4 -4
  138. data/test/Param_Test/client.rb +6 -6
  139. data/test/Param_Test/run_test.rb +2 -2
  140. data/test/Param_Test/server.rb +6 -6
  141. data/test/Performance/Simple/client.rb +6 -6
  142. data/test/Performance/Simple/run_test.rb +2 -2
  143. data/test/Performance/Simple/server.rb +7 -7
  144. data/test/Policies/run_test.rb +2 -2
  145. data/test/Policies/test.rb +4 -4
  146. data/test/Timeout/client.rb +11 -11
  147. data/test/Timeout/run_test.rb +2 -2
  148. data/test/Timeout/server.rb +9 -9
  149. data/test/lib/test.rb +5 -5
  150. data/test/test_runner.rb +8 -7
  151. metadata +6 -7
@@ -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
@@ -11,14 +11,12 @@
11
11
  #--------------------------------------------------------------------
12
12
 
13
13
  module R2CORBA
14
-
15
14
  # from Ruby 2.4 Fixnum and Bignum are deprecated
16
15
  FIXNUM_KLASS = (1.class == ::Integer ? ::Integer : ::Fixnum)
17
16
  BIGNUM_KLASS = (1.class == ::Integer ? ::Integer : ::Bignum)
18
-
19
17
  end
20
18
 
21
- [ 'version',
19
+ ['version',
22
20
  'const',
23
21
  'IDL',
24
22
  'exception',
@@ -11,11 +11,9 @@
11
11
  #--------------------------------------------------------------------
12
12
 
13
13
  module R2CORBA
14
-
15
14
  R2CORBA_MAJOR = 1
16
- R2CORBA_MINOR = 6
17
- R2CORBA_RELEASE = 2
15
+ R2CORBA_MINOR = 7
16
+ R2CORBA_RELEASE = 1
18
17
 
19
18
  R2CORBA_VERSION = "#{R2CORBA_MAJOR}.#{R2CORBA_MINOR}.#{R2CORBA_RELEASE}".freeze
20
-
21
19
  end
data/lib/corba/idl/IDL.rb CHANGED
@@ -10,11 +10,9 @@
10
10
  # Copyright (c) Remedy IT Expertise BV
11
11
  #--------------------------------------------------------------------
12
12
  module R2CORBA
13
-
14
13
  module CORBA
15
14
  def CORBA.implement(idlfile, params = {}, genbits = IDL::CLIENT_STUB, &block)
16
15
  IDL.implement(idlfile, params, genbits, &block)
17
16
  end
18
17
  end
19
-
20
18
  end
@@ -10,8 +10,8 @@
10
10
  # Copyright (c) Remedy IT Expertise BV
11
11
  #--------------------------------------------------------------------
12
12
 
13
- require 'corba/idl/IDL.rb'
14
- require 'corba/idl/r2c_orb.rb'
13
+ require 'corba/idl/IDL'
14
+ require 'corba/idl/r2c_orb'
15
15
 
16
16
  ## fake Ruby into believing 'orb.rb' has already been loaded
17
17
  ## which is what the IDL compiler will generate for
@@ -33,7 +33,7 @@ module R2CORBA
33
33
  TK_FLOAT, TK_DOUBLE, TK_LONGDOUBLE, TK_CHAR, TK_STRING, TK_WSTRING,
34
34
  TK_VALUE, TK_VALUE_BOX, TK_TYPECODE, TK_OBJREF, TK_PRINCIPAL].include?(restc.kind))
35
35
  jorb ||= CORBA::ORB._orb
36
- jany ||= jorb.create_any()
36
+ jany ||= jorb.create_any
37
37
  case restc.kind
38
38
  when TK_NULL
39
39
  # leave any as is
@@ -70,7 +70,7 @@ module R2CORBA
70
70
  when TK_STRING
71
71
  jany.insert_string(rval)
72
72
  when TK_WSTRING
73
- jany.insert_wstring(rval.inject('') {|s, b| s << b.chr})
73
+ jany.insert_wstring(rval.inject('') { |s, b| s << b.chr })
74
74
  when TK_VALUE
75
75
  jany.insert_Value(rval, rtc.tc_)
76
76
  when TK_VALUE_BOX
@@ -114,15 +114,15 @@ module R2CORBA
114
114
  jdynany.set_as_ulong(rval)
115
115
  when TK_ARRAY
116
116
  jelems = CORBA::Native::Reflect::Array.newInstance(CORBA::Native::Any.java_class, rval.size)
117
- rval.each_with_index {|e, i| jelems[i] = Any.to_any(e, restc.content_type).to_java(jorb) }
117
+ rval.each_with_index { |e, i| jelems[i] = Any.to_any(e, restc.content_type).to_java(jorb) }
118
118
  jdynany.set_elements(jelems)
119
119
  when TK_SEQUENCE
120
120
  jelems = CORBA::Native::Reflect::Array.newInstance(CORBA::Native::Any.java_class, rval.size)
121
- rval.each_with_index {|e, i| jelems[i] = Any.to_any(e, restc.content_type).to_java(jorb) }
121
+ rval.each_with_index { |e, i| jelems[i] = Any.to_any(e, restc.content_type).to_java(jorb) }
122
122
  jdynany.set_elements(jelems)
123
123
  when TK_STRUCT, TK_EXCEPT
124
124
  jmembers = CORBA::Native::Reflect::Array.newInstance(CORBA::Native::Dynamic::NameValuePair.java_class, restc.members.size)
125
- rtc.members.each_with_index {|(mn, mt), i| jmembers[i] = CORBA::Native::Dynamic::NameValuePair.new(mn, Any.to_any(rval.__send__(mn.intern), mt).to_java(jorb)) }
125
+ rtc.members.each_with_index { |(mn, mt), i| jmembers[i] = CORBA::Native::Dynamic::NameValuePair.new(mn, Any.to_any(rval.__send__(mn.intern), mt).to_java(jorb)) }
126
126
  jdynany.set_members(jmembers)
127
127
  when TK_UNION
128
128
  if rval._is_at_default?
@@ -142,7 +142,7 @@ module R2CORBA
142
142
  if jany.nil?
143
143
  jany = jdynany.to_any
144
144
  else
145
- jany.read_value(jdynany.to_any.create_input_stream(), rtc.tc_)
145
+ jany.read_value(jdynany.to_any.create_input_stream, rtc.tc_)
146
146
  end
147
147
  ensure
148
148
  jdynany.destroy
@@ -167,52 +167,52 @@ module R2CORBA
167
167
  when TK_NULL, TK_VOID
168
168
  # leave as is
169
169
  when TK_ANY
170
- rval = Any.from_java(jany.extract_any(), jorb)
170
+ rval = Any.from_java(jany.extract_any, jorb)
171
171
  when TK_BOOLEAN
172
- rval = jany.extract_boolean()
172
+ rval = jany.extract_boolean
173
173
  when TK_SHORT
174
- rval = jany.extract_short()
174
+ rval = jany.extract_short
175
175
  when TK_LONG
176
- rval = jany.extract_long()
176
+ rval = jany.extract_long
177
177
  when TK_USHORT
178
- rval = [jany.extract_ushort()].pack('s').unpack('S').first
178
+ rval = [jany.extract_ushort].pack('s').unpack('S').first
179
179
  when TK_WCHAR
180
- rval = jany.extract_wchar()
180
+ rval = jany.extract_wchar
181
181
  when TK_ULONG
182
- rval = [jany.extract_ulong()].pack('l').unpack('L').first
182
+ rval = [jany.extract_ulong].pack('l').unpack('L').first
183
183
  when TK_LONGLONG
184
- rval = jany.extract_longlong()
184
+ rval = jany.extract_longlong
185
185
  when TK_ULONGLONG
186
- rval = [jany.extract_ulonglong()].pack('q').unpack('Q').first
186
+ rval = [jany.extract_ulonglong].pack('q').unpack('Q').first
187
187
  when TK_OCTET
188
- rval = [jany.extract_octet()].pack('c').unpack('C').first
188
+ rval = [jany.extract_octet].pack('c').unpack('C').first
189
189
  when TK_FLOAT
190
- rval = jany.extract_float()
190
+ rval = jany.extract_float
191
191
  when TK_DOUBLE
192
- rval = jany.extract_double()
192
+ rval = jany.extract_double
193
193
  when TK_LONGDOUBLE
194
194
  raise CORBA::NO_IMPLEMENT.new('LongDouble not supported', 0, CORBA::COMPLETED_NO)
195
195
  when TK_FIXED
196
- rval = BigDecimal(jany.extract_fixed().toString())
196
+ rval = BigDecimal(jany.extract_fixed.toString)
197
197
  when TK_CHAR
198
- rval = jany.extract_char().chr
198
+ rval = jany.extract_char.chr
199
199
  when TK_STRING
200
- rval = jany.extract_string()
200
+ rval = jany.extract_string
201
201
  when TK_WSTRING
202
- rval = jany.extract_wstring()
202
+ rval = jany.extract_wstring
203
203
  when TK_VALUE
204
- rval = jany.extract_Value()
204
+ rval = jany.extract_Value
205
205
  when TK_VALUE_BOX
206
206
  rtc.get_type::Factory._check_factory(jorb || CORBA::ORB._orb) # make sure valuebox factory has been registered
207
- rval = jany.extract_Value()
207
+ rval = jany.extract_Value
208
208
  rval = rval.value unless rval.nil?
209
209
  when TK_TYPECODE
210
- rval = CORBA::TypeCode.from_native(jany.extract_TypeCode())
210
+ rval = CORBA::TypeCode.from_native(jany.extract_TypeCode)
211
211
  when TK_OBJREF
212
- rval = CORBA::Object._wrap_native(jany.extract_Object())
212
+ rval = CORBA::Object._wrap_native(jany.extract_Object)
213
213
  rval = rtc.get_type._narrow(rval) if rval
214
214
  when TK_ABSTRACT_INTERFACE
215
- jobj = jany.create_input_stream().read_abstract_interface()
215
+ jobj = jany.create_input_stream.read_abstract_interface
216
216
  rval = if jobj.is_a?(CORBA::Native::Object)
217
217
  rtc.get_type._narrow(CORBA::Object._wrap_native(jobj))
218
218
  else
@@ -232,24 +232,24 @@ module R2CORBA
232
232
  restc = rtc.resolved_tc
233
233
  case restc.kind
234
234
  when TK_ENUM
235
- rval = jdynany.get_as_ulong()
235
+ rval = jdynany.get_as_ulong
236
236
  when TK_ARRAY
237
237
  rval = rtc.get_type.new
238
- jdynany.get_elements().each {|e| rval << Any.from_java(e, jorb, restc.content_type) }
238
+ jdynany.get_elements.each { |e| rval << Any.from_java(e, jorb, restc.content_type) }
239
239
  when TK_SEQUENCE
240
240
  rval = rtc.get_type.new
241
- jdynany.get_elements().each {|e| rval << Any.from_java(e, jorb, restc.content_type) }
241
+ jdynany.get_elements.each { |e| rval << Any.from_java(e, jorb, restc.content_type) }
242
242
  when TK_STRUCT, TK_EXCEPT
243
243
  rval = rtc.get_type.new
244
- jdynany.get_members().each_with_index {|nvp, i| rval.__send__("#{nvp.id}=".intern, Any.from_java(nvp.value, jorb, restc.member_type(i))) }
244
+ jdynany.get_members.each_with_index { |nvp, i| rval.__send__("#{nvp.id}=".intern, Any.from_java(nvp.value, jorb, restc.member_type(i))) }
245
245
  when TK_UNION
246
246
  rval = rtc.get_type.new
247
- if jdynany.get_discriminator().type().kind().value() == CORBA::TK_OCTET
248
- rdisc = jdynany.get_discriminator().get_octet()
247
+ if jdynany.get_discriminator.type.kind.value == CORBA::TK_OCTET
248
+ rdisc = jdynany.get_discriminator.get_octet
249
249
  # Octet 0 designates default member
250
250
  rdisc = rdisc == 0 ? :default : rdisc
251
251
  else
252
- rdisc = Any.from_java(jdynany.get_discriminator().to_any(), jorb, restc.discriminator_type)
252
+ rdisc = Any.from_java(jdynany.get_discriminator.to_any, jorb, restc.discriminator_type)
253
253
  end
254
254
  rval.instance_variable_set('@discriminator', rdisc)
255
255
  unless jdynany.has_no_active_member
@@ -268,7 +268,6 @@ module R2CORBA
268
268
  end
269
269
  return rval
270
270
  end # from_java
271
-
272
271
  end # Any
273
272
  end # CORBA
274
273
  end # R2CORBA
@@ -12,9 +12,7 @@
12
12
 
13
13
  module R2CORBA
14
14
  module CORBA
15
-
16
15
  module ORB
17
-
18
16
  class << self
19
17
  protected
20
18
  def _singleton_orb_init
@@ -39,21 +37,24 @@ module R2CORBA
39
37
  a1, a2, a3 = args
40
38
  if Array === a1
41
39
  raise ArgumentError, "Incorrect nr. of arguments; #{args.size}" if args.size > 3
40
+
42
41
  argv = a1
43
42
  orb_id = (Hash === a2 ? nil : a2)
44
43
  prop = (Hash === a2 ? a2 : a3)
45
44
  elsif args.size == 1 || Hash === a2
46
45
  raise ArgumentError, "Incorrect nr. of arguments; #{args.size}" if args.size > 2
46
+
47
47
  orb_id = a1
48
48
  prop = a2
49
49
  else
50
50
  argv = args
51
51
  end
52
52
  raise ArgumentError, "Invalid argument #{prop.class}; expected Hash" unless prop.nil? || Hash === prop
53
+
53
54
  jprop = Java::JavaUtil::Properties.new
54
55
  jprop.setProperty('ORBid', orb_id) if orb_id
55
56
  prop.each { |k, v| jprop.setProperty(k.to_s, v.to_s) } if prop
56
- @@cached_orb = CORBA::Native::ORB.init(argv.collect {|a| a.to_s }.to_java(:string), jprop)
57
+ @@cached_orb = CORBA::Native::ORB.init(argv.collect { |a| a.to_s }.to_java(:string), jprop)
57
58
  end
58
59
  @@wrapper_klass.new(n_orb)
59
60
  end
@@ -84,7 +85,7 @@ module R2CORBA
84
85
  rescue ::NativeException
85
86
  CORBA::Exception.native2r($!)
86
87
  end
87
- end).join()
88
+ end).join
88
89
  else
89
90
  # need to start a shutdown *with* waiting in a thread because JacORB
90
91
  # occasionally fails with a comm error when #shutdown(false) is called
@@ -104,8 +105,6 @@ module R2CORBA
104
105
  def ior_map
105
106
  @iormap ||= R2CORBA::IORMap.new(self)
106
107
  end
107
-
108
108
  end
109
-
110
109
  end # CORBA
111
110
  end # R2CORBA