Class: Indis::Entity

Inherits:
Object
  • Object
show all
Defined in:
lib/indis-core/entity.rb

Overview

Entity represens an object mapped to some given bytes in the traget’s virtual address space

Direct Known Subclasses

CStringEntity, DataEntity

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ofs) ⇒ Entity

Returns a new instance of Entity.



32
33
34
35
# File 'lib/indis-core/entity.rb', line 32

def initialize(ofs)
  @vmaddr = ofs
  @tags = {}
end

Instance Attribute Details

#sizeFixnum (readonly)

This method is abstract.

You must provide @size value in a subclass

Returns entity size in bytes.

Returns:

  • (Fixnum)

    entity size in bytes



28
29
30
# File 'lib/indis-core/entity.rb', line 28

def size
  @size
end

#tagsHash (readonly)

Returns cross-references and additional attributes of entity.

Returns:

  • (Hash)

    cross-references and additional attributes of entity



30
31
32
# File 'lib/indis-core/entity.rb', line 30

def tags
  @tags
end

#vmaddrFixnum (readonly)

Returns virtaul address of the entity.

Returns:

  • (Fixnum)

    virtaul address of the entity



24
25
26
# File 'lib/indis-core/entity.rb', line 24

def vmaddr
  @vmaddr
end

Instance Method Details

#unmapObject



37
38
39
40
# File 'lib/indis-core/entity.rb', line 37

def unmap
  # TODO: Reverse unmap tags
  @tags = nil
end