Sha256: 6789b43973f718cbb5050dc853fab9c62734edd9bd2d64390550a82f87ab3af4

Contents?: true

Size: 990 Bytes

Versions: 30

Compression:

Stored size: 990 Bytes

Contents

class Ragweed::Wrap32::Overlapped
  attr_accessor :internal
  attr_accessor :internal_high
  attr_accessor :offset
  attr_accessor :offset_high
  attr_accessor :event
  attr_accessor :target

  def self.get
    h = Ragweed::Wrap32::create_event(nil, false, true)
    r = self.new
    r.event = h
    return r
  end

  def initialize(str=nil)
    @buf = "\x00" * 20
    @internal, @internal_high, @offset, @offset_high, @event = [0,0,0,0,0]
    init(str) if str    
  end

  def to_s
    buf = [@internal, @internal_high, @offset, @offset_high, @event].pack("LLLLL")
    @buf.replace(buf)
  end

  def release
    Ragweed::Wrap32::close_handle(@event)
  end

  def wait(h)
    return if not @event
    Ragweed::Wrap32::wait_for_single_object(@event)
    Ragweed::Wrap32::get_overlapped_result(h, self)
  end

  private

  def init(str)
    @internal,
    @internal_high,
    @offset,
    @offset_high,
    @event = str.unpack("LLLLL")
  end
end

Version data entries

30 entries across 30 versions & 3 rubygems

Version Path
iZsh-ragweed-0.1.8 lib/ragweed/wrap32/overlapped.rb
tduehr-ragweed-0.1.5 lib/ragweed/wrap32/overlapped.rb
tduehr-ragweed-0.1.6 lib/ragweed/wrap32/overlapped.rb
tduehr-ragweed-0.1.7.1 lib/ragweed/wrap32/overlapped.rb
tduehr-ragweed-0.1.7.2 lib/ragweed/wrap32/overlapped.rb
tduehr-ragweed-0.1.7 lib/ragweed/wrap32/overlapped.rb
ragweed-0.2.9 lib/ragweed/wrap32/overlapped.rb
ragweed-0.2.8 lib/ragweed/wrap32/overlapped.rb
ragweed-0.2.7 lib/ragweed/wrap32/overlapped.rb
ragweed-0.2.6-java lib/ragweed/wrap32/overlapped.rb
ragweed-0.2.6 lib/ragweed/wrap32/overlapped.rb
ragweed-0.2.5-java lib/ragweed/wrap32/overlapped.rb
ragweed-0.2.5 lib/ragweed/wrap32/overlapped.rb
ragweed-0.2.4-java lib/ragweed/wrap32/overlapped.rb
ragweed-0.2.4 lib/ragweed/wrap32/overlapped.rb
ragweed-0.2.3-java lib/ragweed/wrap32/overlapped.rb
ragweed-0.2.3 lib/ragweed/wrap32/overlapped.rb
ragweed-0.2.2 lib/ragweed/wrap32/overlapped.rb
ragweed-0.2.1-java lib/ragweed/wrap32/overlapped.rb
ragweed-0.2.1 lib/ragweed/wrap32/overlapped.rb