Class: Hwloc::Distances

Inherits:
Struct
  • Object
show all
Defined in:
lib/hwloc/Obj.rb,
lib/hwloc/Obj.rb

Instance Attribute Summary

Attributes inherited from Struct

#topology

Instance Method Summary collapse

Methods inherited from Struct

#[], #method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Hwloc::Struct

Instance Method Details

#objsObject



158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/hwloc/Obj.rb', line 158

def objs
  arity = self[:nbobjs]
  if arity == 0 then
    return []
  else
    return self[:objs].read_array_of_pointer(arity).collect { |p|
      c = Obj::new(p)
      c.instance_variable_set(:@topology, @topology)
      c
    }
  end
end

#valuesObject



171
172
173
174
175
176
177
178
179
# File 'lib/hwloc/Obj.rb', line 171

def values
  arity = self[:nbobjs]
  arity *= arity
  if arity == 0 then
    return []
  else
    return self[:values].read_array_of_uint64(arity)
  end
end