Module: SGC::Memory::IBuffer Abstract

Included in:
Buffer
Defined in:
lib/memory/interface/ibuffer.rb

Overview

This module is abstract.

A memory buffer interface.

A buffer stores elements of the same C data type.

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#[](index) ⇒ Object

Returns The element at index of this buffer.

Parameters:

  • index (Integer)

    The index (0..size-1) of the element to return.

Returns:

  • The element at index of this buffer.

Raises:

  • (NotImplementedError)


34
# File 'lib/memory/interface/ibuffer.rb', line 34

def [](index); raise NotImplementedError; end

#[]=(index, value) ⇒ Object

Set the element at index of this buffer to value.

Parameters:

  • index (Integer)

    The index (0..size-1) of the element to set.

  • value (Object)

    The value to set to.

Returns:

  • value.

Raises:

  • (NotImplementedError)


40
# File 'lib/memory/interface/ibuffer.rb', line 40

def []=(index, value); raise NotImplementedError; end

#element_sizeInteger

Returns The size of an element in this buffer in bytes.

Returns:

  • (Integer)

    The size of an element in this buffer in bytes.

Raises:

  • (NotImplementedError)


46
# File 'lib/memory/interface/ibuffer.rb', line 46

def element_size; raise NotImplementedError; end

#sizeInteger

Returns The number of elements in this buffer.

Returns:

  • (Integer)

    The number of elements in this buffer.

Raises:

  • (NotImplementedError)


43
# File 'lib/memory/interface/ibuffer.rb', line 43

def size; raise NotImplementedError; end