Class: Ragweed::Wrap32::Overlapped

Inherits:
Object
  • Object
show all
Defined in:
lib/ragweed/wrap32/overlapped.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(str = nil) ⇒ Overlapped

Returns a new instance of Overlapped.



16
17
18
19
20
# File 'lib/ragweed/wrap32/overlapped.rb', line 16

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

Instance Attribute Details

#eventObject

Returns the value of attribute event.



6
7
8
# File 'lib/ragweed/wrap32/overlapped.rb', line 6

def event
  @event
end

#internalObject

Returns the value of attribute internal.



2
3
4
# File 'lib/ragweed/wrap32/overlapped.rb', line 2

def internal
  @internal
end

#internal_highObject

Returns the value of attribute internal_high.



3
4
5
# File 'lib/ragweed/wrap32/overlapped.rb', line 3

def internal_high
  @internal_high
end

#offsetObject

Returns the value of attribute offset.



4
5
6
# File 'lib/ragweed/wrap32/overlapped.rb', line 4

def offset
  @offset
end

#offset_highObject

Returns the value of attribute offset_high.



5
6
7
# File 'lib/ragweed/wrap32/overlapped.rb', line 5

def offset_high
  @offset_high
end

#targetObject

Returns the value of attribute target.



7
8
9
# File 'lib/ragweed/wrap32/overlapped.rb', line 7

def target
  @target
end

Class Method Details

.getObject



9
10
11
12
13
14
# File 'lib/ragweed/wrap32/overlapped.rb', line 9

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

Instance Method Details

#releaseObject



27
28
29
# File 'lib/ragweed/wrap32/overlapped.rb', line 27

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

#to_sObject



22
23
24
25
# File 'lib/ragweed/wrap32/overlapped.rb', line 22

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

#wait(h) ⇒ Object



31
32
33
34
35
# File 'lib/ragweed/wrap32/overlapped.rb', line 31

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