Class: OpenCL::Enum
- Inherits:
-
Object
- Object
- OpenCL::Enum
- Defined in:
- lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb
Overview
A parent class to represent OpenCL enums that use :cl_uint
Direct Known Subclasses
AddressingMode, ChannelOrder, ChannelType, CommandType, Device::LocalMemType, Device::MemCacheType, EnumInt, FilterMode, GLObjectType, Kernel::Arg::AccessQualifier, Kernel::Arg::AddressQualifier, Mem::Type, Program::BinaryType, Sampler::Type
Constant Summary collapse
- @@codes =
native_type :cl_uint
{}
Instance Method Summary collapse
-
#==(val) ⇒ Object
Return true if val corresponds to the enum value.
-
#initialize(val) ⇒ Enum
constructor
Initializes an enum with the given val.
-
#is?(val) ⇒ Boolean
Returns true if val corresponds to the enum value.
-
#to_i ⇒ Object
Returns the integer representing the Enum value.
-
#to_int ⇒ Object
Returns the integer representing the Enum value.
-
#to_s ⇒ Object
Returns a String corresponfing to the Enum value.
-
#val=(v) ⇒ Object
Sets the internal value of the enum.
Constructor Details
#initialize(val) ⇒ Enum
Initializes an enum with the given val
621 622 623 624 625 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 621 def initialize( val ) OpenCL::check_error( OpenCL::INVALID_VALUE ) if not @@codes[val] super() @val = val end |
Instance Method Details
#==(val) ⇒ Object
Return true if val corresponds to the enum value
639 640 641 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 639 def ==(val) return true if @val == val end |
#is?(val) ⇒ Boolean
Returns true if val corresponds to the enum value
634 635 636 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 634 def is?(val) return true if @val == val end |
#to_i ⇒ Object
Returns the integer representing the Enum value
649 650 651 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 649 def to_i return @val end |
#to_int ⇒ Object
Returns the integer representing the Enum value
654 655 656 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 654 def to_int return @val end |
#to_s ⇒ Object
Returns a String corresponfing to the Enum value
644 645 646 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 644 def to_s return "#{self.name}" end |
#val=(v) ⇒ Object
Sets the internal value of the enum
628 629 630 631 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 628 def val=(v) OpenCL::check_error( OpenCL::INVALID_VALUE ) if not @@codes[val] @val = v end |