Cattle.Buffer¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
Get size of the memory buffer |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Cattle.Buffer(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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:
Create and initialize a new memory buffer.
- get_size()[source]¶
- Returns:
the size of the memory buffer
- Return type:
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:
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]¶
-
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:
- Default Value:
0
- Flags:
Size of the memory buffer.