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

#include <producer_schedule.hpp>

Inheritance diagram for sysio::chain::producer_authority_schedule:
Collaboration diagram for sysio::chain::producer_authority_schedule:

Public Member Functions

 producer_authority_schedule ()=default
 
 producer_authority_schedule (const legacy::producer_schedule_type &old)
 
 producer_authority_schedule (uint32_t version, std::initializer_list< producer_authority > producers)
 
auto to_shared (chainbase::allocator< char > alloc) const
 

Static Public Member Functions

static auto from_shared (const shared_producer_authority_schedule &src)
 

Public Attributes

uint32_t version = 0
 sequentially incrementing version number
 
vector< producer_authorityproducers
 

Friends

bool operator== (const producer_authority_schedule &a, const producer_authority_schedule &b)
 
bool operator!= (const producer_authority_schedule &a, const producer_authority_schedule &b)
 

Detailed Description

Definition at line 231 of file producer_schedule.hpp.

Constructor & Destructor Documentation

◆ producer_authority_schedule() [1/3]

sysio::chain::producer_authority_schedule::producer_authority_schedule ( )
default

◆ producer_authority_schedule() [2/3]

sysio::chain::producer_authority_schedule::producer_authority_schedule ( const legacy::producer_schedule_type & old)
inlineexplicit

Up-convert a legacy producer schedule

Definition at line 237 of file producer_schedule.hpp.

238 :version(old.version)
239 {
240 producers.reserve( old.producers.size() );
241 for( const auto& p : old.producers )
242 producers.emplace_back(producer_authority{ p.producer_name, block_signing_authority_v0{ 1, {{p.block_signing_key, 1}} } });
243 }
const mie::Vuint & p
Definition bn.cpp:27
uint32_t version
sequentially incrementing version number

◆ producer_authority_schedule() [3/3]

sysio::chain::producer_authority_schedule::producer_authority_schedule ( uint32_t version,
std::initializer_list< producer_authority > producers )
inline

Definition at line 245 of file producer_schedule.hpp.

248 {}

Member Function Documentation

◆ from_shared()

static auto sysio::chain::producer_authority_schedule::from_shared ( const shared_producer_authority_schedule & src)
inlinestatic

Definition at line 261 of file producer_schedule.hpp.

261 {
263 result.version = src.version;
264 result.producers.reserve(src.producers.size());
265 for( const auto& p : src.producers ) {
266 result.producers.emplace_back(producer_authority::from_shared(p));
267 }
268
269 return result;
270 }
static auto from_shared(const shared_producer_authority &src)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_shared()

auto sysio::chain::producer_authority_schedule::to_shared ( chainbase::allocator< char > alloc) const
inline

Definition at line 250 of file producer_schedule.hpp.

250 {
251 auto result = shared_producer_authority_schedule(alloc);
252 result.version = version;
253 result.producers.clear();
254 result.producers.reserve( producers.size() );
255 for( const auto& p : producers ) {
256 result.producers.emplace_back(p.to_shared(alloc));
257 }
258 return result;
259 }
Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const producer_authority_schedule & a,
const producer_authority_schedule & b )
friend

Definition at line 284 of file producer_schedule.hpp.

285 {
286 return !(a==b);
287 }
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181

◆ operator==

bool operator== ( const producer_authority_schedule & a,
const producer_authority_schedule & b )
friend

Definition at line 275 of file producer_schedule.hpp.

276 {
277 if( a.version != b.version ) return false;
278 if ( a.producers.size() != b.producers.size() ) return false;
279 for( uint32_t i = 0; i < a.producers.size(); ++i )
280 if( ! (a.producers[i] == b.producers[i]) ) return false;
281 return true;
282 }
unsigned int uint32_t
Definition stdint.h:126

Member Data Documentation

◆ producers

vector<producer_authority> sysio::chain::producer_authority_schedule::producers

Definition at line 273 of file producer_schedule.hpp.

◆ version

uint32_t sysio::chain::producer_authority_schedule::version = 0

Definition at line 272 of file producer_schedule.hpp.


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