Class: LLDB::Event
- Inherits:
-
Object
- Object
- LLDB::Event
- Includes:
- NativeLifecycle
- Defined in:
- lib/lldb/event.rb
Class Method Summary collapse
Instance Method Summary collapse
- #broadcaster ⇒ Object
- #broadcaster_class ⇒ Object
- #data_flavor ⇒ Object
- #description ⇒ Object
-
#initialize(pointer, context: nil) ⇒ Event
constructor
A new instance of Event.
- #interrupted? ⇒ Boolean
- #process ⇒ Object
- #process_event? ⇒ Boolean
- #process_state ⇒ Object
- #restarted? ⇒ Boolean
- #to_ptr ⇒ Object
- #type ⇒ Object
- #valid? ⇒ Boolean
Methods included from NativeLifecycle
#close, #closed?, #context, #context!, #ensure_open!, #initialize_native_object
Constructor Details
#initialize(pointer, context: nil) ⇒ Event
Returns a new instance of Event.
12 13 14 15 16 17 18 |
# File 'lib/lldb/event.rb', line 12 def initialize(pointer, context: nil) initialize_native_object( pointer, release: ->(released) { FFIBindings.lldb_event_destroy(released) }, context: context ) end |
Class Method Details
.from_ptr(ptr, context: nil) ⇒ Object
23 24 25 |
# File 'lib/lldb/event.rb', line 23 def self.from_ptr(ptr, context: nil) new(ptr, context: context) end |
Instance Method Details
#broadcaster ⇒ Object
63 64 65 66 67 68 69 70 |
# File 'lib/lldb/event.rb', line 63 def broadcaster return nil unless valid? broadcaster_ptr = FFIBindings.lldb_event_get_broadcaster(@ptr) return nil if broadcaster_ptr.nil? || broadcaster_ptr.null? Broadcaster.from_ptr(broadcaster_ptr, context: context) end |
#broadcaster_class ⇒ Object
47 48 49 50 51 |
# File 'lib/lldb/event.rb', line 47 def broadcaster_class return nil unless valid? FFIBindings.lldb_event_get_broadcaster_class(@ptr) end |
#data_flavor ⇒ Object
40 41 42 43 44 |
# File 'lib/lldb/event.rb', line 40 def data_flavor return nil unless valid? FFIBindings.lldb_event_get_data_flavor(@ptr) end |
#description ⇒ Object
54 55 56 57 58 59 60 |
# File 'lib/lldb/event.rb', line 54 def description return '' unless valid? NativeBuffer.read_c_string do |buffer, length| FFIBindings.lldb_event_get_description(@ptr, buffer, length) end end |
#interrupted? ⇒ Boolean
100 101 102 |
# File 'lib/lldb/event.rb', line 100 def interrupted? valid? && FFIBindings.lldb_event_get_interrupted(@ptr) != 0 end |
#process ⇒ Object
85 86 87 88 89 90 91 92 |
# File 'lib/lldb/event.rb', line 85 def process return nil unless process_event? process_ptr = FFIBindings.lldb_event_get_process(@ptr) return nil if process_ptr.nil? || process_ptr.null? Process.new(process_ptr, target: nil, context: context) end |
#process_event? ⇒ Boolean
73 74 75 |
# File 'lib/lldb/event.rb', line 73 def process_event? valid? && FFIBindings.lldb_event_is_process_event(@ptr) != 0 end |
#process_state ⇒ Object
78 79 80 81 82 |
# File 'lib/lldb/event.rb', line 78 def process_state return State::INVALID unless valid? FFIBindings.lldb_event_get_process_state(@ptr) end |
#restarted? ⇒ Boolean
95 96 97 |
# File 'lib/lldb/event.rb', line 95 def restarted? valid? && FFIBindings.lldb_event_get_restarted(@ptr) != 0 end |
#to_ptr ⇒ Object
105 106 107 |
# File 'lib/lldb/event.rb', line 105 def to_ptr @ptr end |
#type ⇒ Object
33 34 35 36 37 |
# File 'lib/lldb/event.rb', line 33 def type return 0 unless valid? FFIBindings.lldb_event_get_type(@ptr) end |
#valid? ⇒ Boolean
28 29 30 |
# File 'lib/lldb/event.rb', line 28 def valid? !@ptr.null? && FFIBindings.lldb_event_is_valid(@ptr) != 0 end |