Recipe
State Variables
_tableId
ResourceId constant _tableId = ResourceId.wrap(0x7462000000000000000000000000000052656369706500000000000000000000);
_fieldLayout
FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0000000100000000000000000000000000000000000000000000000000000000);
_keySchema
Schema constant _keySchema = Schema.wrap(0x00210200005f0000000000000000000000000000000000000000000000000000);
_valueSchema
Schema constant _valueSchema = Schema.wrap(0x00000001af000000000000000000000000000000000000000000000000000000);
lengthOutputs
uint256 constant lengthOutputs = 2;
length
uint256 constant length = 2;
Functions
getKeyNames
Get the table's key field names.
function getKeyNames() internal pure returns (string[] memory keyNames);
Returns
Name | Type | Description |
---|---|---|
keyNames | string[] | An array of strings with the names of key fields. |
getFieldNames
Get the table's value field names.
function getFieldNames() internal pure returns (string[] memory fieldNames);
Returns
Name | Type | Description |
---|---|---|
fieldNames | string[] | An array of strings with the names of value fields. |
register
Register the table with its config.
function register() internal;
_register
Register the table with its config.
function _register() internal;
getOutputs
Get outputs.
function getOutputs(MACHINE_TYPE machineType, bytes32 input) internal view returns (bytes14[2] memory outputs);
_getOutputs
Get outputs.
function _getOutputs(MACHINE_TYPE machineType, bytes32 input) internal view returns (bytes14[2] memory outputs);
get
Get outputs.
function get(MACHINE_TYPE machineType, bytes32 input) internal view returns (bytes14[2] memory outputs);
_get
Get outputs.
function _get(MACHINE_TYPE machineType, bytes32 input) internal view returns (bytes14[2] memory outputs);
setOutputs
Set outputs.
function setOutputs(MACHINE_TYPE machineType, bytes32 input, bytes14[2] memory outputs) internal;
_setOutputs
Set outputs.
function _setOutputs(MACHINE_TYPE machineType, bytes32 input, bytes14[2] memory outputs) internal;
set
Set outputs.
function set(MACHINE_TYPE machineType, bytes32 input, bytes14[2] memory outputs) internal;
_set
Set outputs.
function _set(MACHINE_TYPE machineType, bytes32 input, bytes14[2] memory outputs) internal;
getItemOutputs
Get an item of outputs.
Reverts with Store_IndexOutOfBounds if _index
is out of bounds for the array.
function getItemOutputs(MACHINE_TYPE machineType, bytes32 input, uint256 _index) internal view returns (bytes14);
_getItemOutputs
Get an item of outputs.
Reverts with Store_IndexOutOfBounds if _index
is out of bounds for the array.
function _getItemOutputs(MACHINE_TYPE machineType, bytes32 input, uint256 _index) internal view returns (bytes14);
getItem
Get an item of outputs.
Reverts with Store_IndexOutOfBounds if _index
is out of bounds for the array.
function getItem(MACHINE_TYPE machineType, bytes32 input, uint256 _index) internal view returns (bytes14);
_getItem
Get an item of outputs.
Reverts with Store_IndexOutOfBounds if _index
is out of bounds for the array.
function _getItem(MACHINE_TYPE machineType, bytes32 input, uint256 _index) internal view returns (bytes14);
updateOutputs
Update an element of outputs at _index
.
function updateOutputs(MACHINE_TYPE machineType, bytes32 input, uint256 _index, bytes14 _element) internal;
_updateOutputs
Update an element of outputs at _index
.
function _updateOutputs(MACHINE_TYPE machineType, bytes32 input, uint256 _index, bytes14 _element) internal;
update
Update an element of outputs at _index
.
function update(MACHINE_TYPE machineType, bytes32 input, uint256 _index, bytes14 _element) internal;
_update
Update an element of outputs at _index
.
function _update(MACHINE_TYPE machineType, bytes32 input, uint256 _index, bytes14 _element) internal;
deleteRecord
Delete all data for given keys.
function deleteRecord(MACHINE_TYPE machineType, bytes32 input) internal;
_deleteRecord
Delete all data for given keys.
function _deleteRecord(MACHINE_TYPE machineType, bytes32 input) internal;
encodeLengths
Tightly pack dynamic data lengths using this table's schema.
function encodeLengths(bytes14[2] memory outputs) internal pure returns (EncodedLengths _encodedLengths);
Returns
Name | Type | Description |
---|---|---|
_encodedLengths | EncodedLengths | The lengths of the dynamic fields (packed into a single bytes32 value). |
encodeDynamic
Tightly pack dynamic (variable length) data using this table's schema.
function encodeDynamic(bytes14[2] memory outputs) internal pure returns (bytes memory);
Returns
Name | Type | Description |
---|---|---|
<none> | bytes | The dynamic data, encoded into a sequence of bytes. |
encode
Encode all of a record's fields.
function encode(bytes14[2] memory outputs) internal pure returns (bytes memory, EncodedLengths, bytes memory);
Returns
Name | Type | Description |
---|---|---|
<none> | bytes | The static (fixed length) data, encoded into a sequence of bytes. |
<none> | EncodedLengths | The lengths of the dynamic fields (packed into a single bytes32 value). |
<none> | bytes | The dynamic (variable length) data, encoded into a sequence of bytes. |
encodeKeyTuple
Encode keys as a bytes32 array using this table's field layout.
function encodeKeyTuple(MACHINE_TYPE machineType, bytes32 input) internal pure returns (bytes32[] memory);