class Babeltrace2::BTFieldClass::BitArray

Public Class Methods

from_h(trace_class, h, stream_class_h = nil) click to toggle source
# File lib/babeltrace2/trace-ir/field-class.rb, line 265
def self.from_h(trace_class, h, stream_class_h = nil)
  o = self.new(trace_class: trace_class, length: h[:length]).from_h(h)
  h[:bt_field_class] = o
  o
end
new(handle = nil, retain: true, auto_release: true, trace_class: nil, length: nil) click to toggle source
Calls superclass method
# File lib/babeltrace2/trace-ir/field-class.rb, line 243
def initialize(handle = nil, retain: true, auto_release: true,
               trace_class: nil, length: nil)
  if handle
    super(handle, retain: retain, auto_release: auto_release)
  else
    handle = Babeltrace2.bt_field_class_bit_array_create(trace_class, length)
    raise Babeltrace2.process_error if handle.null?
    super(handle, retain: false)
  end
end

Public Instance Methods

get_length() click to toggle source
# File lib/babeltrace2/trace-ir/field-class.rb, line 254
def get_length
  Babeltrace2.bt_field_class_bit_array_get_length(@handle)
end
Also aliased as: length
length()
Alias for: get_length
to_h() click to toggle source
Calls superclass method Babeltrace2::BTFieldClass#to_h
# File lib/babeltrace2/trace-ir/field-class.rb, line 259
def to_h
  res = super
  res[:length] = length
  res
end