rubyx/lib/virtual/slots/message_slot.rb

47 lines
1.2 KiB
Ruby
Raw Normal View History

2015-05-06 07:38:29 +02:00
module Virtual
2015-06-20 22:49:30 +02:00
MESSAGE_CALLER = 0
MESSAGE_RETURN_ADDRESS = 1
MESSAGE_EXCEPTION_ADDRESS = 2
MESSAGE_SELF = 3
MESSAGE_NAME = 4
MESSAGE_RETURN_VALUE = 5
MESSAGE_FRAME = 6
MESSAGE_PAYLOAD = 7
# The current Message is one of four objects the virtual machine knows
#
# Slots represent instance variables of objects, so MessageSlots
# represent instance variables of Message objects.
# The Message has a layout as per the constant above
2015-05-06 07:38:29 +02:00
class MessageSlot < Slot
def initialize index , type = Unknown , value = nil
2015-05-06 07:38:29 +02:00
super(index ,type , value )
end
end
2015-06-20 23:21:42 +02:00
# named classes exist for slots that often accessed
# Return is the MessageSlot(MESSAGE_RETURN_VALUE)
2015-05-06 07:38:29 +02:00
class Return < MessageSlot
def initialize type = Unknown, value = nil
2015-05-06 07:38:29 +02:00
super( MESSAGE_RETURN_VALUE , type , value )
end
end
2015-06-20 23:21:42 +02:00
# Self is the MessageSlot(MESSAGE_SELF)
2015-05-06 07:38:29 +02:00
class Self < MessageSlot
def initialize type = Unknown, value = nil
2015-05-06 07:38:29 +02:00
super( MESSAGE_SELF , type , value )
end
end
2015-06-20 23:21:42 +02:00
# MessageName of the current message
class MessageName < MessageSlot
def initialize type = Unknown, value = nil
2015-05-06 07:38:29 +02:00
super( MESSAGE_NAME , type , value )
end
end
end