Module: R2CORBA::CORBA::Object

Defined in:
lib/corba/cbase/policies.rb,
lib/corba/jbase/Object.rb,
lib/corba/common/Object.rb,
lib/corba/jbase/policies.rb

Overview

ORB

Constant Summary collapse

@@wrapper_klass =
Class.new do
  include CORBA::Object
  def initialize(nobj)
    @objref_ = nobj
  end
   def _free_ref
    self._release
  end
  attr_reader :objref_
  def self.name
    'CORBA::Object'
  end
end

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

._narrow(obj) ⇒ Object

Raises:

  • (CORBA::BAD_PARAM)


46
47
48
49
50
51
# File 'lib/corba/common/Object.rb', line 46

def self._narrow(obj)
  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)

  obj = self._wrap_native(obj) if obj.is_a?(Native::Object)
  obj
end

._tcObject



53
54
55
# File 'lib/corba/common/Object.rb', line 53

def self._tc
  CORBA._tc_Object
end

._wrap_native(nobj) ⇒ Object

Raises:

  • (ArgumentError)


40
41
42
43
44
# File 'lib/corba/common/Object.rb', line 40

def self._wrap_native(nobj)
  raise ArgumentError, 'Expected org.omg.CORBA.Object' unless nobj.nil? || nobj.is_a?(Native::Object)

  (nobj.nil? || (nobj.respond_to?(:_is_nil) && nobj._is_nil)) ? nil : @@wrapper_klass.new(nobj)
end

Instance Method Details

#==(other) ⇒ Object

——————- 4.3 “Object Reference Operations”



59
60
61
# File 'lib/corba/common/Object.rb', line 59

def ==(other)
  self.class == other.class && self.objref_.eql?(other.objref_)
end

#_duplicateObject

ret ::CORBA::Object



86
87
88
89
90
91
92
93
94
# File 'lib/corba/common/Object.rb', line 86

def _duplicate
  return nil if self._is_nil?

  begin
    self._wrap_native(self.objref_._duplicate)
  rescue ::NativeException
    CORBA::Exception.native2r($!)
  end
end

#_get_componentObject

ret ::CORBA::Object

Raises:

  • (CORBA::INV_OBJREF)


52
53
54
55
56
57
58
59
60
61
# File 'lib/corba/jbase/Object.rb', line 52

def _get_component
  raise CORBA::INV_OBJREF.new if self._is_nil?

  ## ask the remote side
  ## have to do this ourselves since JacORB does not support this remote method on Object
  ## and we can't use #invoke since this should work without narrowing
  req = self._request('_component')
  req.set_return_type(CORBA._tc_Object)
  return req.invoke
end

#_get_interfaceObject

ret InterfaceDef

Raises:

  • (::CORBA::NO_IMPLEMENT)


16
17
18
19
20
# File 'lib/corba/jbase/Object.rb', line 16

def _get_interface
  raise ::CORBA::NO_IMPLEMENT
  # ifdef_obj = self.objref_._get_interface_def rescue CORBA::Exception.native2r($!)
  # (ifdef_obj = CORBA::Native::InterfaceDefHelper.narrow(ifdef_obj) rescue CORBA::Exception.native2r($!)) unless ifdef_obj.nil?
end

#_get_orbObject

ret CORBA::ORB

Raises:

  • (CORBA::INV_OBJREF)


200
201
202
203
204
205
206
207
208
# File 'lib/corba/common/Object.rb', line 200

def _get_orb
  raise CORBA::INV_OBJREF.new if self._is_nil?

  begin
    CORBA::ORB._wrap_native(self.objref_._get_orb)
  rescue ::NativeException
    CORBA::Exception.native2r($!)
  end
end

#_get_policy(policy_type) ⇒ Object

def PolicyType policy_type ret Policy

Raises:

  • (::CORBA::NO_IMPLEMENT)


66
67
68
# File 'lib/corba/jbase/Object.rb', line 66

def _get_policy(policy_type)
  raise ::CORBA::NO_IMPLEMENT
end

#_get_policy_overrides(ts) ⇒ Object

int[] types ret PolicyList

Raises:

  • (::CORBA::NO_IMPLEMENT)


79
80
81
# File 'lib/corba/jbase/Object.rb', line 79

def _get_policy_overrides(types)
  raise ::CORBA::NO_IMPLEMENT
end

#_hash(maximum) ⇒ Object

Integer(ulong) maximum ret unsigned long

Raises:

  • (CORBA::INV_OBJREF)


139
140
141
142
143
144
145
146
147
# File 'lib/corba/common/Object.rb', line 139

def _hash(maximum)
  raise CORBA::INV_OBJREF.new if self._is_nil?

  begin
    self.objref_._hash(maximum)
  rescue ::NativeException
    CORBA::Exception.native2r($!)
  end
end

#_is_a?(logical_type_id) ⇒ Boolean

::String logical_type_id ret boolean

Returns:

  • (Boolean)


24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/corba/jbase/Object.rb', line 24

def _is_a?(logical_type_id)
  raise CORBA::INV_OBJREF.new if self._is_nil?
  ## JacORB's LocalObjects throw NO_IMPLEMENT on _is_a?() and _ids() is also not always defined
  return true if self.objref_.is_a?(CORBA::Native::LocalObject) &&
                  (!self.objref_.respond_to?(:_ids) || self.objref_._ids.include?(logical_type_id))

  begin
    self.objref_._is_a(logical_type_id)
  rescue ::NativeException
    CORBA::Exception.native2r($!)
  end
end

#_is_equivalent?(other_object) ⇒ Boolean

::CORBA::Object other_object ret boolean

Returns:

  • (Boolean)

Raises:

  • (CORBA::INV_OBJREF)


127
128
129
130
131
132
133
134
135
# File 'lib/corba/common/Object.rb', line 127

def _is_equivalent?(other_object)
  raise CORBA::INV_OBJREF.new if self._is_nil?

  begin
    self.objref_._is_equivalent(other_object)
  rescue ::NativeException
    CORBA::Exception.native2r($!)
  end
end

#_is_nil?Boolean

ret boolean

Returns:

  • (Boolean)


81
82
83
# File 'lib/corba/common/Object.rb', line 81

def _is_nil?
  self.objref_.nil? || (self.objref_.respond_to?(:_is_nil) && self.objref_._is_nil)
end

#_non_existent?Boolean

ret boolean

Returns:

  • (Boolean)

Raises:

  • (CORBA::INV_OBJREF)


115
116
117
118
119
120
121
122
123
# File 'lib/corba/common/Object.rb', line 115

def _non_existent?
  raise CORBA::INV_OBJREF.new if self._is_nil?

  begin
    self.objref_._non_existent
  rescue ::NativeException
    CORBA::Exception.native2r($!)
  end
end

#_releaseObject

ret void



97
98
99
100
# File 'lib/corba/common/Object.rb', line 97

def _release
  self.objref_._release unless self.objref_.nil?
  @objref_ = nil
end

#_repository_idObject

ret ::String

Raises:

  • (CORBA::INV_OBJREF)


38
39
40
41
42
43
44
45
46
47
48
# File 'lib/corba/jbase/Object.rb', line 38

def _repository_id
  raise CORBA::INV_OBJREF.new if self._is_nil?
  ## if this object ref has already been narrowed
  return self._interface_repository_id if self.respond_to?(:_interface_repository_id)

  ## ask the remote side
  ## have to do this ourselves since JacORB only resolves this locally (never calling remote)
  req = self._request('_repository_id')
  req.set_return_type(CORBA._tc_string)
  return req.invoke
end

#_request(operation) ⇒ Object

Raises:

  • (CORBA::INV_OBJREF)


89
90
91
92
93
94
95
# File 'lib/corba/jbase/Object.rb', line 89

def _request(operation)
  begin
    CORBA::Request._wrap_native(self.objref_._request(operation.to_s), self)
  rescue ::NativeException
    CORBA::Exception.native2r($!)
  end
end

#_set_policy_overrides(policies, set_add) ⇒ Object

of operation get_policy_overrides

Raises:

  • (CORBA::INV_OBJREF)


73
74
75
# File 'lib/corba/jbase/Object.rb', line 73

def _set_policy_overrides(policies, set_add)
  raise ::CORBA::NO_IMPLEMENT
end

#_validate_connection(inconsistent_policies) ⇒ Object

PolicyList inconsistent_policies ret bool

Raises:

  • (::CORBA::NO_IMPLEMENT)


85
86
87
# File 'lib/corba/jbase/Object.rb', line 85

def _validate_connection(inconsistent_policies)
  raise ::CORBA::NO_IMPLEMENT
end

#cloneObject



71
72
73
# File 'lib/corba/common/Object.rb', line 71

def clone
  self
end

#dupObject



67
68
69
# File 'lib/corba/common/Object.rb', line 67

def dup
  self
end

#hashObject



63
64
65
# File 'lib/corba/common/Object.rb', line 63

def hash
  self.objref_.hash
end