Class: OpenCL::Bitfield

Inherits:
Object
  • Object
show all
Defined in:
lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb

Overview

A parent class to represent OpenCL bitfields that use :cl_bitfield

Instance Method Summary collapse

Constructor Details

#initialize(val = 0) ⇒ Bitfield

Initializes a new Bitfield to val



694
695
696
697
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 694

def initialize( val = 0 )
  super()
  @val = val
end

Instance Method Details

#&(f) ⇒ Object

Returns the bitwise & operation between f and the internal Bitfield representation



721
722
723
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 721

def &(f)
  return self.class::new( @val & f )
end

#^(f) ⇒ Object

Returns the bitwise ^ operation between f and the internal Bitfield representation



726
727
728
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 726

def ^(f)
  return self.class::new( @val ^ f )
end

#flagsObject

Returns the internal representation of the Bitfield



736
737
738
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 736

def flags
  return @val
end

#flags=(val) ⇒ Object

Setss the internal representation of the Bitfield to val



741
742
743
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 741

def flags=(val)
  @val = val
end

#include?(flag) ⇒ Boolean

Returns true if flag is bitwise included in the Bitfield

Returns:

  • (Boolean)


700
701
702
703
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 700

def include?(flag)
  return true if ( @val & flag ) == flag
  return false
end

#to_iObject

Returns the integer representing the Bitfield value



711
712
713
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 711

def to_i
  return @val
end

#to_intObject

Returns the integer representing the Bitfield value



716
717
718
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 716

def to_int
  return @val
end

#to_sObject

Returns a String corresponfing to the Bitfield value



706
707
708
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 706

def to_s
  return "#{self.names}"
end

#|(f) ⇒ Object

Returns the bitwise | operation between f and the internal Bitfield representation



731
732
733
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 731

def |(f)
  return self.class::new( @val | f )
end