Class: Twib::Switch::Debug::Event::Event
- Inherits:
-
Object
- Object
- Twib::Switch::Debug::Event::Event
- Defined in:
- lib/twib/switch/debug.rb
Direct Known Subclasses
AttachProcess, AttachThread, Exception, ExitProcess, ExitThread
Instance Attribute Summary collapse
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#thread_id ⇒ Object
readonly
Returns the value of attribute thread_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(flags, thread_id, specific) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(flags, thread_id, specific) ⇒ Event
Returns a new instance of Event.
23 24 25 26 27 |
# File 'lib/twib/switch/debug.rb', line 23 def initialize(flags, thread_id, specific) @flags = flags @thread_id = thread_id unpack_specific(specific) end |
Instance Attribute Details
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
28 29 30 |
# File 'lib/twib/switch/debug.rb', line 28 def flags @flags end |
#thread_id ⇒ Object (readonly)
Returns the value of attribute thread_id.
29 30 31 |
# File 'lib/twib/switch/debug.rb', line 29 def thread_id @thread_id end |
Class Method Details
.unpack(pack) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/twib/switch/debug.rb', line 6 def self.unpack(pack) event_type, flags, thread_id, specific = pack.unpack("L<L<Q<a*") case event_type when AttachProcess::TYPE return AttachProcess.new(flags, thread_id, specific) when AttachThread::TYPE return AttachThread.new(flags, thread_id, specific) when ExitProcess::TYPE return ExitProcess.new(flags, thread_id, specific) when ExitThread::TYPE return ExitThread.new(flags, thread_id, specific) when Exception::TYPE return Exception.new(flags, thread_id, specific) else raise "unknown debug event type: #{event_type}" end end |