Method: Hwloc::Obj#attr

Defined in:
lib/hwloc/Obj.rb

#attrObject



628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
# File 'lib/hwloc/Obj.rb', line 628

def attr
  at = self[:attr]
  return nil if at.to_ptr.null?
  t = self[:type]
  case t
  when :OBJ_GROUP
    return at[:group]
  when :OBJ_PCI_DEVICE
    return at[:pcidev]
  when :OBJ_BRIDGE
    return at[:bridge]
  when :OBJ_OS_DEVICE
    return at[:osdev]
  else
    if API_VERSION >= API_VERSION_2_0 then
      return at[:numanode] if t == :OBJ_NUMANODE
    end
    return at[:cache] if self.is_a_cache?
  end
  return nil
end