Cattle.Instruction

g Cattle.Instruction Cattle.Instruction GObject.Object GObject.Object GObject.Object->Cattle.Instruction

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

get_loop ()

get_next ()

get_quantity ()

get_value ()

set_loop (loop)

set_next (next)

set_quantity (quantity)

set_value (value)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

loop

Cattle.Instruction

r/w

Get/set loop code

next

Cattle.Instruction

r/w

Get/set next instruction

quantity

int

r/w

Get/set instruction’s quantity

value

Cattle.InstructionValue

r/w

Get/set instruction’s value

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Cattle.Instruction(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Cattle.InstructionClass

Opaque data structure representing an instruction. It should never be accessed directly.

classmethod new()[source]
Returns:

a new Cattle.Instruction

Return type:

Cattle.Instruction

Create and initialize a new instruction.

The newly-created instruction has a Cattle.Instruction :quantity of one, and its Cattle.Instruction :value is Cattle.InstructionValue.NONE.

get_loop()[source]
Returns:

a Cattle.Instruction, or None

Return type:

Cattle.Instruction or None

Get the first instruction of the loop.

This method should only be called on instructions whose value is Cattle.InstructionValue.LOOP_BEGIN.

get_next()[source]
Returns:

the next instruction, or None

Return type:

Cattle.Instruction or None

Get the next instruction.

Please note that the returned instruction might not be the next instruction in the execution flow: if self marks the beginning of a loop (its value is Cattle.InstructionValue.LOOP_BEGIN), the returned instruction will be executed only after the loop has ended.

get_quantity()[source]
Returns:

the quantity of self

Return type:

int

Get the quantity of self. See Cattle.Instruction.set_quantity().

get_value()[source]
Returns:

the value of self

Return type:

Cattle.InstructionValue

Get the value of self. See Cattle.Instruction.set_value().

set_loop(loop)[source]
Parameters:

loop (Cattle.Instruction or None) – first Cattle.Instruction in the loop, or None

Set the instructions to be executed in the loop.

This method should only be called on instructions whose value is Cattle.InstructionValue.LOOP_BEGIN.

set_next(next)[source]
Parameters:

next (Cattle.Instruction or None) – next Cattle.Instruction to execute, or None

Set the next instruction to be executed.

If self has value Cattle.InstructionValue.LOOP_BEGIN, next will be executed only after the loop has returned.

set_quantity(quantity)[source]
Parameters:

quantity (int) – quantity of self

Set the number of times self has to be executed.

This value is used at runtime for faster execution, and allows to use less memory for storing the code.

set_value(value)[source]
Parameters:

value (Cattle.InstructionValue) – value of self

Set the value of self. Accepted values are from the Cattle.InstructionValue enumeration.

Property Details

Cattle.Instruction.props.loop
Name:

loop

Type:

Cattle.Instruction

Default Value:

None

Flags:

READABLE, WRITABLE

Instructions to be executed in the loop. Should be None unless the value of the instruction is Cattle.InstructionValue.LOOP_BEGIN.

Changes to this property are not notified.

Cattle.Instruction.props.next
Name:

next

Type:

Cattle.Instruction

Default Value:

None

Flags:

READABLE, WRITABLE

Next instruction in the execution flow. Can be None if there are no more instructions to be executed.

Changes to this property are not notified.

Cattle.Instruction.props.quantity
Name:

quantity

Type:

int

Default Value:

1

Flags:

READABLE, WRITABLE

Number of times the instruction has to be executed.

Changes to this property are not notified.

Cattle.Instruction.props.value
Name:

value

Type:

Cattle.InstructionValue

Default Value:

Cattle.InstructionValue.NONE

Flags:

READABLE, WRITABLE

Value of the instruction. Accepted values are in the Cattle.InstructionValue enumeration.

Changes to this property are not notified.