COOPENOMICS  v1
Кооперативная Экономика
Файл table_branch_weights.hpp
#include <eosio/asset.hpp>
#include <eosio/eosio.hpp>
#include "../consts.hpp"
#include "../core/utils.hpp"

См. исходные тексты.

Классы

struct  branch_weight
 Реестр распределения членских взносов кооперативного участка (requirement b6 «Экономика КУ»). Подробнее...
 
struct  branch_weight_total
 Агрегат весов по (КУ, контракт-источник): сумма весов всех участников распределения. Поддерживается автоматически действиями setweight/delweight/deltrusted; используется при раскладке в distribute и для чтения столом ПВЗ («сумма весов по конкретной ЦПП»). Подробнее...
 

Определения типов

typedef eosio::multi_index< "weights"_n, branch_weight, eosio::indexed_by<"bycontrbra"_n, eosio::const_mem_fun< branch_weight, uint128_t, &branch_weight::by_contract_branch > >, eosio::indexed_by<"bybranch"_n, eosio::const_mem_fun< branch_weight, uint64_t, &branch_weight::by_branch > > > branch_weights_index
 
typedef eosio::multi_index< "weighttotals"_n, branch_weight_total, eosio::indexed_by<"bycontrbra"_n, eosio::const_mem_fun< branch_weight_total, uint128_t, &branch_weight_total::by_contract_branch > >, eosio::indexed_by<"bybranch"_n, eosio::const_mem_fun< branch_weight_total, uint64_t, &branch_weight_total::by_branch > > > branch_weight_totals_index
 

Функции

void apply_weight_total_delta (eosio::name coopname, eosio::name braname, eosio::name contract, int64_t delta)
 Применить дельту к агрегату весов (braname, contract). Создаёт запись при первой положительной дельте, удаляет при обнулении. Используется в setweight/delweight/deltrusted. Подробнее...
 
uint64_t get_weight_total (eosio::name coopname, eosio::name braname, eosio::name contract)
 Σ весов по (braname, contract); 0 — распределение не настроено. Подробнее...
 

Типы

◆ branch_weight_totals_index

typedef eosio::multi_index< "weighttotals"_n, branch_weight_total, eosio::indexed_by<"bycontrbra"_n, eosio::const_mem_fun<branch_weight_total, uint128_t, &branch_weight_total::by_contract_branch> >, eosio::indexed_by<"bybranch"_n, eosio::const_mem_fun<branch_weight_total, uint64_t, &branch_weight_total::by_branch> > > branch_weight_totals_index

◆ branch_weights_index

typedef eosio::multi_index< "weights"_n, branch_weight, eosio::indexed_by<"bycontrbra"_n, eosio::const_mem_fun<branch_weight, uint128_t, &branch_weight::by_contract_branch> >, eosio::indexed_by<"bybranch"_n, eosio::const_mem_fun<branch_weight, uint64_t, &branch_weight::by_branch> > > branch_weights_index

Функции

◆ apply_weight_total_delta()

void apply_weight_total_delta ( eosio::name  coopname,
eosio::name  braname,
eosio::name  contract,
int64_t  delta 
)

Применить дельту к агрегату весов (braname, contract). Создаёт запись при первой положительной дельте, удаляет при обнулении. Используется в setweight/delweight/deltrusted.

◆ get_weight_total()

uint64_t get_weight_total ( eosio::name  coopname,
eosio::name  braname,
eosio::name  contract 
)

Σ весов по (braname, contract); 0 — распределение не настроено.