Class: Efl::Ecore::REcorePipe

Inherits:
Object
  • Object
show all
Defined in:
lib/efl/ecore.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cb, data) ⇒ REcorePipe

Returns a new instance of REcorePipe.


24
25
26
# File 'lib/efl/ecore.rb', line 24

def initialize cb, data
    @ptr = FFI::AutoPointer.new Native.ecore_pipe_add(cb, data), REcorePipe.method(:release)
end

Class Method Details

.release(p) ⇒ Object


27
28
29
# File 'lib/efl/ecore.rb', line 27

def self.release p
    Native.ecore_pipe_del p
end

Instance Method Details

#delObject


30
31
32
33
34
# File 'lib/efl/ecore.rb', line 30

def del
    @ptr.autorelease=false
    REcorePipe.release @ptr
    @ptr=nil
end

#read_closeObject


35
36
37
# File 'lib/efl/ecore.rb', line 35

def read_close
    Native.ecore_pipe_read_close @ptr
end

#write(data) ⇒ Object


41
42
43
# File 'lib/efl/ecore.rb', line 41

def write data
    Native.ecore_pipe_write @ptr, FFI::MemoryPointer.from_string(data.to_s), data.to_s.length+1
end

#write_closeObject


38
39
40
# File 'lib/efl/ecore.rb', line 38

def write_close
    Native.ecore_pipe_write_close @ptr
end