Class: Udb::InterruptCode
- Inherits:
-
TopLevelDatabaseObject
- Object
- DatabaseObject
- TopLevelDatabaseObject
- Udb::InterruptCode
- Extended by:
- T::Sig
- Includes:
- Comparable, Code
- Defined in:
- lib/udb/obj/exception_code.rb
Overview
an asynchroncous interrupt code
Instance Method Summary collapse
- #<=>(other) ⇒ Integer?
-
#display_name ⇒ String
included
from Code
Long-form display name (can include special characters).
- #eql?(other) ⇒ Boolean
- #hash ⇒ Integer
-
#num ⇒ Integer
included
from Code
Code, written into *mcause.
- #validate(resolver)
-
#var ⇒ String
included
from Code
Field name for an IDL enum.
Constructor Details
This class inherits a constructor from Udb::TopLevelDatabaseObject
Instance Method Details
#<=>(other) ⇒ Integer?
84 85 86 87 88 |
# File 'lib/udb/obj/exception_code.rb', line 84 def <=>(other) return nil unless T.cast(other, Object).is_a?(ExceptionCode) num <=> T.cast(other, ExceptionCode).num end |
#display_name ⇒ String Originally defined in module Code
Returns Long-form display name (can include special characters).
#eql?(other) ⇒ Boolean
91 92 93 |
# File 'lib/udb/obj/exception_code.rb', line 91 def eql?(other) (self <=> other) == 0 end |
#hash ⇒ Integer
96 |
# File 'lib/udb/obj/exception_code.rb', line 96 def hash = [ExceptionCode, num].hash |
#num ⇒ Integer Originally defined in module Code
Returns Code, written into *mcause.
#validate(resolver)
This method returns an undefined value.
71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/udb/obj/exception_code.rb', line 71 def validate(resolver) super(resolver) @arch.interrupt_codes.each do |code| next if code == self if num == code.num raise ValidationError, "Duplicate interrupt code #{num} for #{name}, #{code.name}" end end end |
#var ⇒ String Originally defined in module Code
Returns Field name for an IDL enum.