Cattle.Instruction¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Get/set loop code |
||
r/w |
Get/set next instruction |
||
r/w |
Get/set instruction’s quantity |
||
r/w |
Get/set instruction’s value |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Cattle.Instruction(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Opaque data structure representing an instruction. It should never be accessed directly.
- classmethod new()[source]¶
- Returns:
a new
Cattle.Instruction
- Return type:
Create and initialize a new instruction.
The newly-created instruction has a
Cattle.Instruction
:quantity
of one, and itsCattle.Instruction
:value
isCattle.InstructionValue.NONE
.
- get_loop()[source]¶
- Returns:
a
Cattle.Instruction
, orNone
- Return type:
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:
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:
Get the quantity of self. See
Cattle.Instruction.set_quantity
().
- get_value()[source]¶
- Returns:
the value of self
- Return type:
Get the value of self. See
Cattle.Instruction.set_value
().
- set_loop(loop)[source]¶
- Parameters:
loop (
Cattle.Instruction
orNone
) – firstCattle.Instruction
in the loop, orNone
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
orNone
) – nextCattle.Instruction
to execute, orNone
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:
- Default Value:
- Flags:
Instructions to be executed in the loop. Should be
None
unless the value of the instruction isCattle.InstructionValue.LOOP_BEGIN
.Changes to this property are not notified.
- Cattle.Instruction.props.next¶
- Name:
next
- Type:
- Default Value:
- Flags:
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¶
-
Number of times the instruction has to be executed.
Changes to this property are not notified.
- Cattle.Instruction.props.value¶
- Name:
value
- Type:
- Default Value:
- Flags:
Value of the instruction. Accepted values are in the
Cattle.InstructionValue
enumeration.Changes to this property are not notified.