Class: Babeltrace2::BTFieldClass::BitArray
- Inherits:
-
Babeltrace2::BTFieldClass
- Object
- Babeltrace2::BTObject
- Babeltrace2::BTSharedObject
- Babeltrace2::BTFieldClass
- Babeltrace2::BTFieldClass::BitArray
- 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
Class Method Summary collapse
Instance Method Summary collapse
- #get_length ⇒ Object (also: #length)
-
#initialize(handle = nil, retain: true, auto_release: true, trace_class: nil, length: nil) ⇒ BitArray
constructor
A new instance of BitArray.
- #to_h ⇒ Object
Methods inherited from Babeltrace2::BTFieldClass
#from_h, from_handle, #get_type, #get_user_attributes, #set_user_attributes, #type_is, #user_attributes=
Methods inherited from Babeltrace2::BTSharedObject
Methods inherited from Babeltrace2::BTObject
Constructor Details
#initialize(handle = nil, retain: true, auto_release: true, trace_class: nil, length: nil) ⇒ BitArray
Returns a new instance of BitArray.
243 244 245 246 247 248 249 250 251 252 |
# 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 |
Class Method Details
.from_h(trace_class, h, stream_class_h = nil) ⇒ Object
265 266 267 268 269 |
# 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 |
Instance Method Details
#get_length ⇒ Object Also known as: length
254 255 256 |
# File 'lib/babeltrace2/trace-ir/field-class.rb', line 254 def get_length Babeltrace2.bt_field_class_bit_array_get_length(@handle) end |
#to_h ⇒ Object
259 260 261 262 263 |
# File 'lib/babeltrace2/trace-ir/field-class.rb', line 259 def to_h res = super res[:length] = length res end |