make frame and message indexed

also auto generate a replacement for previous offset class method (dry)
This commit is contained in:
Torsten Ruger
2015-10-27 16:04:36 +02:00
parent fdc7f8b39c
commit 50029711ff
4 changed files with 18 additions and 12 deletions

View File

@ -9,8 +9,11 @@
module Parfait
class Message < Object
attributes [:next_message , :frame, :caller]
attributes [:receiver , :return_address , :return_value , :name]
attributes [:next_message , :receiver , :frame , :return_address ]
attributes [:return_value, :caller , :name ]
include Indexed
self.offset(8) # 8 == the seven attributes above + layout. (indexed_length gets added)
def initialize next_m
self.next_message = next_m
@ -28,9 +31,5 @@ module Parfait
index = @layout.get_index(name)
get_at(index)
end
def self.offset
1 + Space.object_space.get_class_by_name(:Message).object_layout.instance_length
end
end
end