Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
sysio::chain::shared_authority Struct Reference

#include <authority.hpp>

Public Member Functions

 shared_authority (chainbase::allocator< char > alloc)
 
shared_authorityoperator= (const authority &a)
 
 operator authority () const
 
authority to_authority () const
 
size_t get_billable_size () const
 

Public Attributes

uint32_t threshold = 0
 
shared_vector< shared_key_weightkeys
 
shared_vector< permission_level_weightaccounts
 
shared_vector< wait_weightwaits
 

Detailed Description

Definition at line 203 of file authority.hpp.

Constructor & Destructor Documentation

◆ shared_authority()

sysio::chain::shared_authority::shared_authority ( chainbase::allocator< char > alloc)
inline

Definition at line 204 of file authority.hpp.

205 :keys(alloc),accounts(alloc),waits(alloc){}
shared_vector< permission_level_weight > accounts
shared_vector< wait_weight > waits
shared_vector< shared_key_weight > keys

Member Function Documentation

◆ get_billable_size()

size_t sysio::chain::shared_authority::get_billable_size ( ) const
inline

< serialized size of the key

Definition at line 237 of file authority.hpp.

237 {
238 size_t accounts_size = accounts.size() * config::billable_size_v<permission_level_weight>;
239 size_t waits_size = waits.size() * config::billable_size_v<wait_weight>;
240 size_t keys_size = 0;
241 for (const auto& k: keys) {
243 keys_size += fc::raw::pack_size(k.key);
244 }
245
246 return accounts_size + waits_size + keys_size;
247 }
size_t pack_size(const T &v)
Definition raw.hpp:671
constexpr uint64_t billable_size_v
Definition config.hpp:147
Here is the call graph for this function:

◆ operator authority()

sysio::chain::shared_authority::operator authority ( ) const
inline

Definition at line 224 of file authority.hpp.

224{ return to_authority(); }
authority to_authority() const
Here is the call graph for this function:

◆ operator=()

shared_authority & sysio::chain::shared_authority::operator= ( const authority & a)
inline

Definition at line 207 of file authority.hpp.

207 {
208 threshold = a.threshold;
209 keys.clear();
210 keys.reserve(a.keys.size());
211 for(const key_weight& k : a.keys) {
212 keys.emplace_back(shared_key_weight::convert(keys.get_allocator(), k));
213 }
214 accounts = decltype(accounts)(a.accounts.begin(), a.accounts.end(), accounts.get_allocator());
215 waits = decltype(waits)(a.waits.begin(), a.waits.end(), waits.get_allocator());
216 return *this;
217 }
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
static shared_key_weight convert(chainbase::allocator< char > allocator, const key_weight &k)
Here is the call graph for this function:

◆ to_authority()

authority sysio::chain::shared_authority::to_authority ( ) const
inline

Definition at line 225 of file authority.hpp.

225 {
226 authority auth;
227 auth.threshold = threshold;
228 auth.keys.reserve(keys.size());
229 auth.accounts.reserve(accounts.size());
230 auth.waits.reserve(waits.size());
231 for( const auto& k : keys ) { auth.keys.emplace_back( k ); }
232 for( const auto& a : accounts ) { auth.accounts.emplace_back( a ); }
233 for( const auto& w : waits ) { auth.waits.emplace_back( w ); }
234 return auth;
235 }
Here is the caller graph for this function:

Member Data Documentation

◆ accounts

shared_vector<permission_level_weight> sysio::chain::shared_authority::accounts

Definition at line 221 of file authority.hpp.

◆ keys

shared_vector<shared_key_weight> sysio::chain::shared_authority::keys

Definition at line 220 of file authority.hpp.

◆ threshold

uint32_t sysio::chain::shared_authority::threshold = 0

Definition at line 219 of file authority.hpp.

◆ waits

shared_vector<wait_weight> sysio::chain::shared_authority::waits

Definition at line 222 of file authority.hpp.


The documentation for this struct was generated from the following file: