COOPENOMICS  v1
Кооперативная Экономика
table_draft_translations.hpp
См. документацию.
1#pragma once
2
3
4#include "../core/ram_payer.hpp"
5#include <eosio/contract.hpp>
6#include <eosio/eosio.hpp>
7#include <string>
8
9#include "../consts.hpp"
10#include "../core/utils.hpp"
11
18struct [[eosio::table, eosio::contract(DRAFT)]] translation {
19 uint64_t id;
20 uint64_t draft_id;
21 eosio::name lang;
22 std::string data;
23
24 uint64_t primary_key() const { return id; }
25 uint64_t by_draft() const { return draft_id; }
26
27 uint128_t by_draft_lang() const { return combine_ids(draft_id, lang.value); }
28};
29
30typedef eosio::multi_index<
31 "translations"_n, translation,
32 eosio::indexed_by<"bydraft"_n, eosio::const_mem_fun<translation, uint64_t, &translation::by_draft>>,
33 eosio::indexed_by<"bydraftlang"_n,
34 eosio::const_mem_fun<translation, uint128_t, &translation::by_draft_lang>>>
36
37// Плательщик за оперативную память строк таблицы — правило в lib/core/ram_payer.hpp.
contract
Definition: eosio.msig_tests.cpp:977
Definition: eosio.msig.hpp:34
Definition: table_draft_translations.hpp:18
uint64_t by_draft() const
Definition: table_draft_translations.hpp:25
eosio::name lang
Definition: table_draft_translations.hpp:21
uint128_t by_draft_lang() const
Definition: table_draft_translations.hpp:27
uint64_t primary_key() const
Definition: table_draft_translations.hpp:24
uint64_t draft_id
Definition: table_draft_translations.hpp:20
std::string data
Definition: table_draft_translations.hpp:22
uint64_t id
Definition: table_draft_translations.hpp:19
eosio::multi_index< "translations"_n, translation, eosio::indexed_by<"bydraft"_n, eosio::const_mem_fun< translation, uint64_t, &translation::by_draft > >, eosio::indexed_by<"bydraftlang"_n, eosio::const_mem_fun< translation, uint128_t, &translation::by_draft_lang > > > translations_index
Definition: table_draft_translations.hpp:35
RAM_PAYER_CLASS(translation, system)
static uint128_t combine_ids(const uint64_t &x, const uint64_t &y)
Definition: utils.hpp:7