Class: Ronin::Support::Binary::CTypes::ObjectType Private

Inherits:
Type
  • Object
show all
Defined in:
lib/ronin/support/binary/ctypes/object_type.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Represents a object type that is memory mapped.

Since:

  • 1.0.0

Instance Attribute Summary collapse

Attributes inherited from Type

#pack_string

Instance Method Summary collapse

Methods inherited from Type

#[], #align, #alignment, #dequeue_value, #enqueue_value, #pack, #uninitialized_value, #unpack

Constructor Details

#initialize(size) ⇒ ObjectType

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initializes the memory-mapped type.

Parameters:

  • size (Integer)

    The size, in bytes, of the memory-mapped type.

Since:

  • 1.0.0



45
46
47
48
49
50
51
52
53
54
55
# File 'lib/ronin/support/binary/ctypes/object_type.rb', line 45

def initialize(size)
  @size = size

  super(
    pack_string: if size.finite?
                   "a#{@size}"
                 else
                   'a*'
                 end
  )
end

Instance Attribute Details

#sizeInteger (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The size, in bytes, of the memory-mapped type.

Returns:

Since:

  • 1.0.0



37
38
39
# File 'lib/ronin/support/binary/ctypes/object_type.rb', line 37

def size
  @size
end