Class: RubDev::Queue
- Inherits:
-
Object
- Object
- RubDev::Queue
- Defined in:
- lib/rubdev/queue.rb
Instance Method Summary collapse
- #active? ⇒ Boolean
- #context ⇒ Object
- #empty? ⇒ Boolean
- #failed ⇒ Object
-
#initialize(context) ⇒ Queue
constructor
A new instance of Queue.
- #kernel_seqnum ⇒ Object
- #queued ⇒ Object
- #ref ⇒ Object
- #seqnum_finished?(seqnum) ⇒ Boolean
- #seqnum_sequence_finished?(start, stop) ⇒ Boolean
- #udev_seqnum ⇒ Object
- #unref ⇒ Object
Constructor Details
Instance Method Details
#active? ⇒ Boolean
48 49 50 |
# File 'lib/rubdev/queue.rb', line 48 def active? !RubDev::C.udev_queue_get_udev_is_active(@pointer).zero? end |
#context ⇒ Object
36 37 38 39 40 |
# File 'lib/rubdev/queue.rb', line 36 def context Context.allocate.tap {|i| i.instance_variable_set(:@pointer, RubDev::C.udev_queue_get_udev(@pointer)) } end |
#empty? ⇒ Boolean
52 53 54 |
# File 'lib/rubdev/queue.rb', line 52 def empty? !RubDev::C.udev_queue_get_queue_is_empty(@pointer).zero? end |
#failed ⇒ Object
68 69 70 |
# File 'lib/rubdev/queue.rb', line 68 def failed List.new(RubDev::C.udev_queue_get_failed_list_entry(@pointer)) end |
#kernel_seqnum ⇒ Object
72 73 74 |
# File 'lib/rubdev/queue.rb', line 72 def kernel_seqnum RubDev::C.udev_queue_get_kernel_seqnum(@pointer) end |
#queued ⇒ Object
64 65 66 |
# File 'lib/rubdev/queue.rb', line 64 def queued List.new(RubDev::C.udev_queue_get_queued_list_entry(@pointer)) end |
#ref ⇒ Object
26 27 28 29 |
# File 'lib/rubdev/queue.rb', line 26 def ref RubDev::C.udev_queue_ref(@pointer) self end |
#seqnum_finished?(seqnum) ⇒ Boolean
56 57 58 |
# File 'lib/rubdev/queue.rb', line 56 def seqnum_finished? (seqnum) !RubDev::C.udev_queue_get_seqnum_is_finished(@pointer, seqnum).zero? end |
#seqnum_sequence_finished?(start, stop) ⇒ Boolean
60 61 62 |
# File 'lib/rubdev/queue.rb', line 60 def seqnum_sequence_finished? (start, stop) !RubDev::C.udev_queue_get_seqnum_sequence_is_finished(@pointer, start, stop).zero? end |