class PAPI::Event
Constants
- MAX_PRESET_EVENTS
- NATIVE_AND_MASK
- NATIVE_MASK
- PRESET_AND_MASK
- PRESET_MASK
Attributes
info[R]
masks[R]
Public Class Methods
new(info, masks = nil)
click to toggle source
# File lib/PAPI/Event.rb, line 31 def initialize(info, masks = nil) @info = info @masks = masks end
Public Instance Methods
to_i()
click to toggle source
# File lib/PAPI/Event.rb, line 36 def to_i @info[:event_code] end
to_s(description = false, masks = false)
click to toggle source
# File lib/PAPI/Event.rb, line 40 def to_s(description = false, masks = false) s1 = @info[:symbol].to_ptr.read_string s = "#{s1}" s += "\n #{@info[:long_descr]}" if description if masks and @masks then s += "\n " s += @masks.collect{ |m| m.to_s.gsub(s1.gsub(/.*::/,""),"")+"\n " + m.info[:long_descr].to_ptr.read_string.gsub(/.*masks:/,"") }.join("\n ") end return s end