Class: R2CORBA::CORBA::TypeCode::Except
- Inherits:
-
Struct
- Object
- R2CORBA::CORBA::TypeCode
- IdentifiedTypeCode
- Struct
- R2CORBA::CORBA::TypeCode::Except
- Defined in:
- lib/corba/cbase/Typecode.rb,
lib/corba/jbase/Typecode.rb,
lib/corba/common/Typecode.rb
Overview
Struct
Constant Summary
Constants inherited from R2CORBA::CORBA::TypeCode
LongLongRange, LongRange, OctetRange, ShortRange, ULongLongRange, ULongRange, UShortRange
Instance Attribute Summary
Attributes inherited from Struct
Attributes inherited from R2CORBA::CORBA::TypeCode
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Struct
#add_member, #initialize, #inspect, #member_count, #member_name, #member_type, #needs_conversion, #validate
Methods inherited from IdentifiedTypeCode
Methods inherited from R2CORBA::CORBA::TypeCode
_tc, _wrap_native, #concrete_base_type, #content_type, #default_index, #discriminator_type, #equal?, #equivalent?, #fixed_digits, #fixed_scale, from_native, #get_compact_typecode, get_primitive_tc, #id, #initialize, #is_recursive_tc?, #kind, #length, #member_count, #member_label, #member_name, #member_type, #member_visibility, #name, native_kind, #needs_conversion, register_id_type, #resolved_tc, #type_modifier, typecode_for_id, typecodes_for_name, #validate
Constructor Details
This class inherits a constructor from R2CORBA::CORBA::TypeCode::Struct
Class Method Details
.define_type(tc) ⇒ Object
857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 |
# File 'lib/corba/common/Typecode.rb', line 857 def Except.define_type(tc) except_type = ::Object.module_eval(%Q{ class #{tc.name} < CORBA::UserException def _tc @@tc_#{tc.name} ||= TypeCode.typecode_for_id('#{tc.id}') end def initialize(*param_) #{tc.members.collect {|n,t| "@#{n}"}.join(',')} = param_ end end #{tc.name} }) tc.members.each do |mname, mtc| except_type.module_eval(%Q{attr_accessor :#{mname}}) end except_type end |
Instance Method Details
#from_java(jex) ⇒ Object
392 393 394 395 396 397 |
# File 'lib/corba/jbase/Typecode.rb', line 392 def from_java(jex) raise CORBA::BAD_PARAM.new('org.om.CORBA.UserException expected',0,CORBA::COMPLETED_NO) unless jex.is_a?(CORBA::Native::UserException) ex = get_type.new members.each {|mname,mtc| ex.__send__("#{mname}=".to_sym, jex.__send__(mname.to_sym)) } ex end |
#get_type ⇒ Object
875 876 877 |
# File 'lib/corba/common/Typecode.rb', line 875 def get_type @type ||= CORBA::TypeCode::Except.define_type(self) end |
#is_compatible?(jex) ⇒ Boolean
399 400 401 402 |
# File 'lib/corba/jbase/Typecode.rb', line 399 def is_compatible?(jex) raise CORBA::BAD_PARAM.new('org.om.CORBA.UserException expected',0,CORBA::COMPLETED_NO) unless jex.is_a?(CORBA::Native::UserException) members.all? {|mname,mtc| jex.respond_to?(mname.to_sym) } end |