Class: Babeltrace2Gen::BTFieldClass::BitArray

Inherits:
Babeltrace2Gen::BTFieldClass show all
Extended by:
Babeltrace2Gen::BTFromH
Defined in:
lib/metababel/bt2_stream_classes_generator.rb

Constant Summary

Constants included from Babeltrace2Gen::BTPrinter

Babeltrace2Gen::BTPrinter::INDENT_INCREMENT

Instance Attribute Summary collapse

Attributes inherited from Babeltrace2Gen::BTFieldClass

#cast_type

Attributes included from Babeltrace2Gen::BTLocator

#parent, #variable

Instance Method Summary collapse

Methods included from Babeltrace2Gen::BTFromH

from_h

Methods inherited from Babeltrace2Gen::BTFieldClass

#bt_get_variable, from_h, #get_getter, #get_setter

Methods included from Babeltrace2Gen::BTPrinter

context, #name_sanitized, pr, #scope

Methods included from Babeltrace2Gen::BTLocator

#rec_event_class, #rec_menber_class, #rec_stream_class, #resolve_path

Constructor Details

#initialize(parent:, length:) ⇒ BitArray

Returns a new instance of BitArray.



421
422
423
424
# File 'lib/metababel/bt2_stream_classes_generator.rb', line 421

def initialize(parent:, length:)
  @parent = parent
  @length = length
end

Instance Attribute Details

#lengthObject (readonly)

Returns the value of attribute length.



416
417
418
# File 'lib/metababel/bt2_stream_classes_generator.rb', line 416

def length
  @length
end

Instance Method Details

#get_declarator(trace_class:, variable:) ⇒ Object



426
427
428
# File 'lib/metababel/bt2_stream_classes_generator.rb', line 426

def get_declarator(trace_class:, variable:)
  pr "#{variable} = bt_field_class_bit_array_create(#{trace_class}, #{@length});"
end