Class: Babeltrace2::BTFieldClass::String

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) ⇒ String

Returns a new instance of String.



783
784
785
786
787
788
789
790
791
792
# File 'lib/babeltrace2/trace-ir/field-class.rb', line 783

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_string_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



794
795
796
797
798
# File 'lib/babeltrace2/trace-ir/field-class.rb', line 794

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