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