Class: Babeltrace2::BTFieldClass::Bool

Inherits:
Babeltrace2::BTFieldClass show all
Defined in:
lib/babeltrace2/trace-ir/field-class.rb

Constant Summary

Constants inherited from Babeltrace2::BTFieldClass

IntegerSigned, IntegerUnsigned, RealDoublePrecision, RealSinglePrecision, TYPE_MAP

Instance Attribute Summary

Attributes inherited from Babeltrace2::BTObject

#handle

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Babeltrace2::BTFieldClass

#from_h, from_handle, #get_type, #get_user_attributes, #set_user_attributes, #to_h, #type_is, #user_attributes=

Methods inherited from Babeltrace2::BTSharedObject

inherited

Methods inherited from Babeltrace2::BTObject

#==, #to_ptr

Constructor Details

#initialize(handle = nil, retain: true, auto_release: true, trace_class: nil) ⇒ Bool

Returns a new instance of Bool.



212
213
214
215
216
217
218
219
220
221
# File 'lib/babeltrace2/trace-ir/field-class.rb', line 212

def initialize(handle = nil, retain: true, auto_release: true,
               trace_class: nil)
  if handle
    super(handle, retain: retain, auto_release: auto_release)
  else
    handle = Babeltrace2.bt_field_class_bool_create(trace_class)
    raise Babeltrace2.process_error if handle.null?
    super(handle, retain: false)
  end
end

Class Method Details

.from_h(trace_class, h, stream_class_h = nil) ⇒ Object



223
224
225
226
227
# File 'lib/babeltrace2/trace-ir/field-class.rb', line 223

def self.from_h(trace_class, h, stream_class_h = nil)
  o = self.new(trace_class: trace_class).from_h(h)
  h[:bt_field_class] = o
  o
end