Kagome
Polkadot Runtime Engine in C++17
kagome::consensus::BabeConfigNode Class Referencefinal

#include <babe_config_node.hpp>

Inheritance diagram for kagome::consensus::BabeConfigNode:
Collaboration diagram for kagome::consensus::BabeConfigNode:

Public Member Functions

 BabeConfigNode ()=default
 
 BabeConfigNode (const std::shared_ptr< const BabeConfigNode > &ancestor, primitives::BlockInfo block)
 
std::shared_ptr< BabeConfigNodemakeDescendant (const primitives::BlockInfo &block, std::optional< EpochNumber > epoch_number=std::nullopt) const
 

Static Public Member Functions

static std::shared_ptr< BabeConfigNodecreateAsRoot (primitives::BlockInfo block, std::shared_ptr< const primitives::BabeConfiguration > config)
 

Public Attributes

const primitives::BlockInfo block {}
 
std::weak_ptr< const BabeConfigNodeparent
 
std::vector< std::shared_ptr< BabeConfigNode > > descendants {}
 
consensus::EpochNumber epoch {}
 
bool epoch_changed = false
 
std::shared_ptr< const primitives::BabeConfigurationconfig
 
std::optional< std::shared_ptr< const primitives::BabeConfiguration > > next_config
 

Friends

friend::scale::ScaleEncoderStream & operator<< (::scale::ScaleEncoderStream &s, const BabeConfigNode &node)
 
friend::scale::ScaleDecoderStream & operator>> (::scale::ScaleDecoderStream &s, BabeConfigNode &node)
 

Detailed Description

Definition at line 18 of file babe_config_node.hpp.

Constructor & Destructor Documentation

kagome::consensus::BabeConfigNode::BabeConfigNode ( )
default
kagome::consensus::BabeConfigNode::BabeConfigNode ( const std::shared_ptr< const BabeConfigNode > &  ancestor,
primitives::BlockInfo  block 
)

Definition at line 10 of file babe_config_node.cpp.

Member Function Documentation

std::shared_ptr< BabeConfigNode > kagome::consensus::BabeConfigNode::createAsRoot ( primitives::BlockInfo  block,
std::shared_ptr< const primitives::BabeConfiguration config 
)
static

Creates node as root

Parameters
block- target block
config- config associated with provided block
Returns
node

Definition at line 17 of file babe_config_node.cpp.

std::shared_ptr< BabeConfigNode > kagome::consensus::BabeConfigNode::makeDescendant ( const primitives::BlockInfo block,
std::optional< EpochNumber epoch_number = std::nullopt 
) const

Creates descendant schedule node for block

Parameters
block- target block
epoch_number- optional number to inform if provided block of other epoch
Returns
descendant node

Definition at line 27 of file babe_config_node.cpp.

Friends And Related Function Documentation

::scale::ScaleEncoderStream& operator<< ( ::scale::ScaleEncoderStream &  s,
const BabeConfigNode node 
)
friend

Definition at line 43 of file babe_config_node.hpp.

::scale::ScaleDecoderStream& operator>> ( ::scale::ScaleDecoderStream &  s,
BabeConfigNode node 
)
friend

Definition at line 48 of file babe_config_node.hpp.

Member Data Documentation

const primitives::BlockInfo kagome::consensus::BabeConfigNode::block {}

Definition at line 54 of file babe_config_node.hpp.

std::shared_ptr<const primitives::BabeConfiguration> kagome::consensus::BabeConfigNode::config

Definition at line 60 of file babe_config_node.hpp.

std::vector<std::shared_ptr<BabeConfigNode> > kagome::consensus::BabeConfigNode::descendants {}

Definition at line 56 of file babe_config_node.hpp.

consensus::EpochNumber kagome::consensus::BabeConfigNode::epoch {}

Definition at line 58 of file babe_config_node.hpp.

bool kagome::consensus::BabeConfigNode::epoch_changed = false

Definition at line 59 of file babe_config_node.hpp.

std::optional<std::shared_ptr<const primitives::BabeConfiguration> > kagome::consensus::BabeConfigNode::next_config

Definition at line 62 of file babe_config_node.hpp.

std::weak_ptr<const BabeConfigNode> kagome::consensus::BabeConfigNode::parent

Definition at line 55 of file babe_config_node.hpp.


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