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

#include <protocol_feature_manager.hpp>

Collaboration diagram for sysio::chain::protocol_feature:

Public Member Functions

fc::variant to_variant (bool include_subjective_restrictions=true, fc::mutable_variant_object *additional_fields=nullptr) const
 

Public Attributes

digest_type feature_digest
 
digest_type description_digest
 
flat_set< digest_typedependencies
 
time_point earliest_allowed_activation_time
 
bool preactivation_required = false
 
bool enabled = false
 
std::optional< builtin_protocol_feature_tbuiltin_feature
 

Friends

bool operator< (const protocol_feature &lhs, const protocol_feature &rhs)
 
bool operator< (const digest_type &lhs, const protocol_feature &rhs)
 
bool operator< (const protocol_feature &lhs, const digest_type &rhs)
 

Detailed Description

Definition at line 106 of file protocol_feature_manager.hpp.

Member Function Documentation

◆ to_variant()

fc::variant sysio::chain::protocol_feature::to_variant ( bool include_subjective_restrictions = true,
fc::mutable_variant_object * additional_fields = nullptr ) const

Definition at line 364 of file protocol_feature_manager.cpp.

366 {
367 SYS_ASSERT( builtin_feature, protocol_feature_exception, "not a builtin protocol feature" );
368
370
371 mvo( "feature_digest", feature_digest );
372
373 if( additional_fields ) {
374 for( const auto& e : *additional_fields ) {
375 if( e.key().compare( "feature_digest" ) != 0 )
376 mvo( e.key(), e.value() );
377 }
378 }
379
380 if( include_subjective_restrictions ) {
381 fc::mutable_variant_object subjective_restrictions;
382
383 subjective_restrictions( "enabled", enabled );
384 subjective_restrictions( "preactivation_required", preactivation_required );
385 subjective_restrictions( "earliest_allowed_activation_time", earliest_allowed_activation_time );
386
387 mvo( "subjective_restrictions", std::move( subjective_restrictions ) );
388 }
389
390 mvo( "description_digest", description_digest );
391 mvo( "dependencies", dependencies );
392 mvo( "protocol_feature_type", builtin_protocol_feature::feature_type_string );
393
394 fc::variants specification;
395 auto add_to_specification = [&specification]( const char* key_name, auto&& value ) {
397 obj( "name", key_name );
398 obj( "value", std::forward<decltype(value)>( value ) );
399 specification.emplace_back( std::move(obj) );
400 };
401
402
403 add_to_specification( "builtin_feature_codename", builtin_protocol_feature_codename( *builtin_feature ) );
404
405 mvo( "specification", std::move( specification ) );
406
407 return fc::variant( std::move(mvo) );
408 }
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
Definition exceptions.hpp:7
An order-preserving dictionary of variants.
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition variant.hpp:191
std::vector< fc::variant > variants
Definition variant.hpp:173
const char * builtin_protocol_feature_codename(builtin_protocol_feature_t)
#define value
Definition pkcs11.h:157
std::optional< builtin_protocol_feature_t > builtin_feature
Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ operator< [1/3]

bool operator< ( const digest_type & lhs,
const protocol_feature & rhs )
friend

Definition at line 122 of file protocol_feature_manager.hpp.

122 {
123 return lhs < rhs.feature_digest;
124 }

◆ operator< [2/3]

bool operator< ( const protocol_feature & lhs,
const digest_type & rhs )
friend

Definition at line 126 of file protocol_feature_manager.hpp.

126 {
127 return lhs.feature_digest < rhs;
128 }

◆ operator< [3/3]

bool operator< ( const protocol_feature & lhs,
const protocol_feature & rhs )
friend

Definition at line 118 of file protocol_feature_manager.hpp.

118 {
119 return lhs.feature_digest < rhs.feature_digest;
120 }

Member Data Documentation

◆ builtin_feature

std::optional<builtin_protocol_feature_t> sysio::chain::protocol_feature::builtin_feature

Definition at line 113 of file protocol_feature_manager.hpp.

◆ dependencies

flat_set<digest_type> sysio::chain::protocol_feature::dependencies

Definition at line 109 of file protocol_feature_manager.hpp.

◆ description_digest

digest_type sysio::chain::protocol_feature::description_digest

Definition at line 108 of file protocol_feature_manager.hpp.

◆ earliest_allowed_activation_time

time_point sysio::chain::protocol_feature::earliest_allowed_activation_time

Definition at line 110 of file protocol_feature_manager.hpp.

◆ enabled

bool sysio::chain::protocol_feature::enabled = false

Definition at line 112 of file protocol_feature_manager.hpp.

◆ feature_digest

digest_type sysio::chain::protocol_feature::feature_digest

Definition at line 107 of file protocol_feature_manager.hpp.

◆ preactivation_required

bool sysio::chain::protocol_feature::preactivation_required = false

Definition at line 111 of file protocol_feature_manager.hpp.


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