Class: Babeltrace2::BTSharedObject
- Defined in:
- lib/babeltrace2/types.rb
Direct Known Subclasses
BTClockClass, BTComponent, Babeltrace2::BTComponent::DescriptorSet, BTComponentClass, BTConnection, BTEventClass, BTFieldClass, BTFieldPath, BTGraph, BTIntegerRangeSet, BTInterrupter, BTMessage, BTMessageIterator, BTMessageIteratorClass, BTPacket, BTPlugin, Babeltrace2::BTPlugin::Set, BTPort, BTQueryExecutor, BTStream, BTStreamClass, BTTrace, BTTraceClass, BTValue
Defined Under Namespace
Classes: Releaser
Class Attribute Summary collapse
-
.get_ref ⇒ Object
readonly
Returns the value of attribute get_ref.
-
.put_ref ⇒ Object
readonly
Returns the value of attribute put_ref.
Attributes inherited from BTObject
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(handle, retain: false, auto_release: true) ⇒ BTSharedObject
constructor
A new instance of BTSharedObject.
Methods inherited from BTObject
Constructor Details
#initialize(handle, retain: false, auto_release: true) ⇒ BTSharedObject
Returns a new instance of BTSharedObject.
604 605 606 607 608 |
# File 'lib/babeltrace2/types.rb', line 604 def initialize(handle, retain: false, auto_release: true) super(handle) Babeltrace2.method(self.class.get_ref).call(handle) if retain ObjectSpace.define_finalizer(self, Releaser.new(handle, self.class.put_ref)) if auto_release end |
Class Attribute Details
.get_ref ⇒ Object (readonly)
Returns the value of attribute get_ref.
600 601 602 |
# File 'lib/babeltrace2/types.rb', line 600 def get_ref @get_ref end |
.put_ref ⇒ Object (readonly)
Returns the value of attribute put_ref.
601 602 603 |
# File 'lib/babeltrace2/types.rb', line 601 def put_ref @put_ref end |
Class Method Details
.inherited(child) ⇒ Object
595 596 597 598 |
# File 'lib/babeltrace2/types.rb', line 595 def self.inherited(child) child.instance_variable_set(:@get_ref, @get_ref) child.instance_variable_set(:@put_ref, @put_ref) end |