Class: Babeltrace2Gen::BTFieldClass::Array::Static
- Inherits:
-
Babeltrace2Gen::BTFieldClass::Array
- Object
- Babeltrace2Gen::BTFieldClass
- Babeltrace2Gen::BTFieldClass::Array
- Babeltrace2Gen::BTFieldClass::Array::Static
- 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
-
#length ⇒ Object
readonly
Returns the value of attribute length.
Attributes inherited from Babeltrace2Gen::BTFieldClass::Array
Attributes inherited from Babeltrace2Gen::BTFieldClass
Attributes included from Babeltrace2Gen::BTLocator
Instance Method Summary collapse
- #get_declarator(trace_class:, variable:) ⇒ Object
-
#initialize(parent:, element_field_class:, length:) ⇒ Static
constructor
A new instance of Static.
Methods included from Babeltrace2Gen::BTFromH
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:, element_field_class:, length:) ⇒ Static
Returns a new instance of Static.
550 551 552 553 |
# File 'lib/metababel/bt2_stream_classes_generator.rb', line 550 def initialize(parent:, element_field_class:, length:) @length = length super(parent: parent, element_field_class: element_field_class) end |
Instance Attribute Details
#length ⇒ Object (readonly)
Returns the value of attribute length.
548 549 550 |
# File 'lib/metababel/bt2_stream_classes_generator.rb', line 548 def length @length end |
Instance Method Details
#get_declarator(trace_class:, variable:) ⇒ Object
555 556 557 558 559 560 561 562 |
# File 'lib/metababel/bt2_stream_classes_generator.rb', line 555 def get_declarator(trace_class:, variable:) element_field_class_variable = "#{variable}_field_class" scope do pr "bt_field_class *#{element_field_class_variable};" @element_field_class.get_declarator(trace_class: trace_class, variable: element_field_class_variable) pr "#{variable} = bt_field_class_array_static_create(#{trace_class}, #{element_field_class_variable}, #{@length});" end end |