Cattle.Buffer

g Cattle.Buffer Cattle.Buffer GObject.Object GObject.Object GObject.Object->Cattle.Buffer

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (size)

get_size ()

get_value (position)

set_contents (contents)

set_value (position, value)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

size

int

r/w/co

Get size of the memory buffer

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Cattle.Buffer(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Cattle.BufferClass

Opaque data structure representing a memory buffer. It should never be accessed directly.

classmethod new(size)[source]
Parameters:

size (int) – size of the buffer

Returns:

a new Cattle.Buffer

Return type:

Cattle.Buffer

Create and initialize a new memory buffer.

get_size()[source]
Returns:

the size of the memory buffer

Return type:

int

Get the size of the memory buffer.

get_value(position)[source]
Parameters:

position (int) – offset inside the memory buffer

Returns:

the value of the selected byte.

Return type:

int

Get the value of a specific byte inside the memory buffer.

The value of position must be smaller than the size of the memory buffer, as returned by Cattle.Buffer.get_size().

set_contents(contents)[source]
Parameters:

contents ([int]) – data to copy inside the memory buffer

Set the contents of the memory buffer.

This method exists mainly for bindings; Cattle.Buffer.set_contents() is more convenient when writing C code.

set_value(position, value)[source]
Parameters:
  • position (int) – offset inside the memory buffer

  • value (int) – new value

Set the value of a specific byte inside the memory buffer.

The value of position must be smaller than the size of the memory buffer, as returned by Cattle.Buffer.get_size().

Property Details

Cattle.Buffer.props.size
Name:

size

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Size of the memory buffer.