Class: Qt::Enum

Inherits:
Object show all
Defined in:
lib/Qt/qtruby4.rb

Overview

If a C++ enum was converted to an ordinary ruby Integer, the name of the type is lost. The enum type name is needed for overloaded method resolution when two methods differ only by an enum type.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(n, enum_type) ⇒ Enum

Returns a new instance of Enum.



324
325
326
327
# File 'lib/Qt/qtruby4.rb', line 324

def initialize(n, enum_type)
	@value = n 
	@type = enum_type
end

Instance Attribute Details

#typeObject

Returns the value of attribute type.



323
324
325
# File 'lib/Qt/qtruby4.rb', line 323

def type
  @type
end

#valueObject

Returns the value of attribute value.



323
324
325
# File 'lib/Qt/qtruby4.rb', line 323

def value
  @value
end

Instance Method Details

#%(n) ⇒ Object



341
342
343
# File 'lib/Qt/qtruby4.rb', line 341

def %(n) 
	return @value % n.to_i
end

#&(n) ⇒ Object



351
352
353
# File 'lib/Qt/qtruby4.rb', line 351

def &(n) 
	return Enum.new(@value & n.to_i, @type)
end

#*(n) ⇒ Object



335
336
337
# File 'lib/Qt/qtruby4.rb', line 335

def *(n) 
	return @value * n.to_i
end

#**(n) ⇒ Object



344
345
346
# File 'lib/Qt/qtruby4.rb', line 344

def **(n) 
	return @value ** n.to_i
end

#+(n) ⇒ Object



329
330
331
# File 'lib/Qt/qtruby4.rb', line 329

def +(n) 
	return @value + n.to_i
end

#-(n) ⇒ Object



332
333
334
# File 'lib/Qt/qtruby4.rb', line 332

def -(n) 
	return @value - n.to_i
end

#/(n) ⇒ Object



338
339
340
# File 'lib/Qt/qtruby4.rb', line 338

def /(n) 
	return @value / n.to_i
end

#<(n) ⇒ Object



360
361
362
# File 'lib/Qt/qtruby4.rb', line 360

def <(n) 
	return @value < n.to_i
end

#<<(n) ⇒ Object



372
373
374
# File 'lib/Qt/qtruby4.rb', line 372

def <<(n) 
	return Enum.new(@value << n.to_i, @type)
end

#<=(n) ⇒ Object



363
364
365
# File 'lib/Qt/qtruby4.rb', line 363

def <=(n) 
	return @value <= n.to_i
end

#==(n) ⇒ Object



379
# File 'lib/Qt/qtruby4.rb', line 379

def ==(n) return @value == n.to_i end

#>(n) ⇒ Object



366
367
368
# File 'lib/Qt/qtruby4.rb', line 366

def >(n) 
	return @value > n.to_i
end

#>=(n) ⇒ Object



369
370
371
# File 'lib/Qt/qtruby4.rb', line 369

def >=(n) 
	return @value >= n.to_i
end

#>>(n) ⇒ Object



375
376
377
# File 'lib/Qt/qtruby4.rb', line 375

def >>(n) 
	return Enum.new(@value >> n.to_i, @type)
end

#^(n) ⇒ Object



354
355
356
# File 'lib/Qt/qtruby4.rb', line 354

def ^(n) 
	return Enum.new(@value ^ n.to_i, @type)
end

#coerce(n) ⇒ Object



385
386
387
# File 'lib/Qt/qtruby4.rb', line 385

def coerce(n)
	[n, @value]
end

#inspectObject



389
390
391
# File 'lib/Qt/qtruby4.rb', line 389

def inspect
	to_s
end

#pretty_print(pp) ⇒ Object



393
394
395
# File 'lib/Qt/qtruby4.rb', line 393

def pretty_print(pp)
	pp.text "#<%s:0x%8.8x @type=%s, @value=%d>" % [self.class.name, object_id, type, value]
end

#to_fObject



382
# File 'lib/Qt/qtruby4.rb', line 382

def to_f() return @value.to_f end

#to_iObject



380
# File 'lib/Qt/qtruby4.rb', line 380

def to_i() return @value end

#to_sObject



383
# File 'lib/Qt/qtruby4.rb', line 383

def to_s() return @value.to_s end

#|(n) ⇒ Object



348
349
350
# File 'lib/Qt/qtruby4.rb', line 348

def |(n) 
	return Enum.new(@value | n.to_i, @type)
end

#~Object



357
358
359
# File 'lib/Qt/qtruby4.rb', line 357

def ~() 
	return ~ @value
end