Class: R2CORBA::INS::BindingIterator

Inherits:
POA::CosNaming::BindingIterator
  • Object
show all
Defined in:
lib/corba/svcs/ins/cos_naming.rb

Overview

Binding iterator servant class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reglist, iterator_id) ⇒ BindingIterator

Returns a new instance of BindingIterator.



71
72
73
74
# File 'lib/corba/svcs/ins/cos_naming.rb', line 71

def initialize(reglist, iterator_id)
  @rl = reglist
  @id = iterator_id
end

Instance Attribute Details

#oidObject

Returns the value of attribute oid.



76
77
78
# File 'lib/corba/svcs/ins/cos_naming.rb', line 76

def oid
  @oid
end

Instance Method Details

#destroyObject



94
95
96
97
98
99
# File 'lib/corba/svcs/ins/cos_naming.rb', line 94

def destroy
  poa = self._default_POA
  poa.deactivate_object(self.oid)
  @rl.clear
  INS::NamingContext.clear_iterator(@id)
end

#next_n(how_many) ⇒ Object

Raises:

  • (CORBA::BAD_PARAM)


83
84
85
86
87
88
89
90
91
92
# File 'lib/corba/svcs/ins/cos_naming.rb', line 83

def next_n(how_many)
  raise CORBA::BAD_PARAM.new if how_many < 1
  bindings = []
  while how_many>0 and !@rl.empty?
    reg = @rl.shift
    bindings << CosNaming::Binding.new(reg[:name], reg[:type])
    how_many -= 1
  end
  [!bindings.empty?, bindings]
end

#next_oneObject



78
79
80
81
# File 'lib/corba/svcs/ins/cos_naming.rb', line 78

def next_one
  reg = @rl.shift
  [!reg.nil?, reg ? CosNaming::Binding.new(reg[:name], reg[:type]) : nil]
end