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
2312 2313 2314 2315 2316 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 2312 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
2330 2331 2332 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 2330 def ==(val) return true if @val == val end |
#is?(val) ⇒ Boolean
Returns true if val corresponds to the enum value
2325 2326 2327 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 2325 def is?(val) return true if @val == val end |
#to_i ⇒ Object
Returns the integer representing the Enum value
2340 2341 2342 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 2340 def to_i return @val end |
#to_int ⇒ Object
Returns the integer representing the Enum value
2345 2346 2347 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 2345 def to_int return @val end |
#to_s ⇒ Object
Returns a String corresponfing to the Enum value
2335 2336 2337 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 2335 def to_s return "#{self.name}" end |
#val=(v) ⇒ Object
Sets the internal value of the enum
2319 2320 2321 2322 |
# File 'lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb', line 2319 def val=(v) OpenCL::check_error( OpenCL::INVALID_VALUE ) if not @@codes[val] @val = v end |