Class: Babeltrace2::BTValue::Real

Inherits:
Babeltrace2::BTValue show all
Defined in:
lib/babeltrace2/value.rb

Constant Summary

Constants inherited from Babeltrace2::BTValue

ArrayAppendElementStatus, ArraySetElementByIndexStatus, IntegerSigned, IntegerUnsigned, MapExtendStatus, MapForeachEntryConstFuncStatus, MapForeachEntryConstStatus, MapForeachEntryFuncStatus, MapForeachEntryStatus, StringSetStatus, TYPE_MAP

Instance Attribute Summary

Attributes inherited from Babeltrace2::BTObject

#handle

Instance Method Summary collapse

Methods inherited from Babeltrace2::BTValue

#copy, from_handle, from_value, #get_type, #is_equal, #to_s

Methods inherited from Babeltrace2::BTSharedObject

inherited

Methods inherited from Babeltrace2::BTObject

#==, #to_ptr

Constructor Details

#initialize(handle = nil, retain: true, auto_release: true, value: nil) ⇒ Real

Returns a new instance of Real.



325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/babeltrace2/value.rb', line 325

def initialize(handle = nil, retain: true, auto_release: true, value: nil)
  if handle
    super(handle, retain: retain, auto_release: auto_release)
  else
    handle = if value.nil?
        Babeltrace2.bt_value_real_create()
      else
        Babeltrace2.bt_value_real_create_init(value)
      end
    raise Babeltrace2.process_error if handle.null?
    super(handle)
  end
end

Instance Method Details

#getObject Also known as: value, to_f



349
350
351
# File 'lib/babeltrace2/value.rb', line 349

def get
  Babeltrace2.bt_value_real_get(@handle)
end

#set(value) ⇒ Object



339
340
341
342
# File 'lib/babeltrace2/value.rb', line 339

def set(value)
  Babeltrace2.bt_value_real_set(@handle, value)
  self
end

#value=(value) ⇒ Object



344
345
346
347
# File 'lib/babeltrace2/value.rb', line 344

def value=(value)
  set(value)
  value
end