Kagome
Polkadot Runtime Engine in C++17
kagome::authority::ScheduleNode Class Reference

Node of scheduler tree. Contains actual authorities for the accorded block and all its descendant blocks until any changes are applied. May contain one of the changes. More...

#include <schedule_node.hpp>

Inheritance diagram for kagome::authority::ScheduleNode:
Collaboration diagram for kagome::authority::ScheduleNode:

Classes

struct  ForcedChange
 
struct  Pause
 
struct  Resume
 
struct  ScheduledChange
 

Public Types

using NoAction = Empty
 

Public Member Functions

 ScheduleNode ()=default
 
 ScheduleNode (const std::shared_ptr< const ScheduleNode > &ancestor, primitives::BlockInfo block)
 
void adjust (IsBlockFinalized finalized)
 
std::shared_ptr< ScheduleNodemakeDescendant (const primitives::BlockInfo &block, IsBlockFinalized finalized) const
 

Static Public Member Functions

static std::shared_ptr< ScheduleNodecreateAsRoot (std::shared_ptr< const primitives::AuthoritySet > current_authorities, primitives::BlockInfo block)
 

Public Attributes

const primitives::BlockInfo current_block {}
 
std::weak_ptr< const ScheduleNodeparent
 
std::vector< std::shared_ptr< ScheduleNode > > descendants {}
 
boost::variant< NoAction, ScheduledChange, ForcedChange, Pause, Resumeaction
 
std::shared_ptr< const primitives::AuthoritySetcurrent_authorities
 
bool enabled = true
 

Friends

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

Detailed Description

Node of scheduler tree. Contains actual authorities for the accorded block and all its descendant blocks until any changes are applied. May contain one of the changes.

Definition at line 24 of file schedule_node.hpp.

Member Typedef Documentation

Constructor & Destructor Documentation

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

Definition at line 11 of file schedule_node.cpp.

Member Function Documentation

void kagome::authority::ScheduleNode::adjust ( IsBlockFinalized  finalized)

Definition at line 27 of file schedule_node.cpp.

std::shared_ptr< ScheduleNode > kagome::authority::ScheduleNode::createAsRoot ( std::shared_ptr< const primitives::AuthoritySet current_authorities,
primitives::BlockInfo  block 
)
static

Creates schedule node as root

Returns
schedule node

Definition at line 18 of file schedule_node.cpp.

std::shared_ptr< ScheduleNode > kagome::authority::ScheduleNode::makeDescendant ( const primitives::BlockInfo block,
IsBlockFinalized  finalized 
) const

Creates descendant schedule node for block

Parameters
block- target block
finalized- true if block is finalized
Returns
schedule node

Definition at line 55 of file schedule_node.cpp.

Friends And Related Function Documentation

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

Definition at line 75 of file schedule_node.hpp.

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

Definition at line 81 of file schedule_node.hpp.

Member Data Documentation

boost::variant<NoAction, ScheduledChange, ForcedChange, Pause, Resume> kagome::authority::ScheduleNode::action

Definition at line 92 of file schedule_node.hpp.

std::shared_ptr<const primitives::AuthoritySet> kagome::authority::ScheduleNode::current_authorities

Definition at line 93 of file schedule_node.hpp.

const primitives::BlockInfo kagome::authority::ScheduleNode::current_block {}

Definition at line 88 of file schedule_node.hpp.

std::vector<std::shared_ptr<ScheduleNode> > kagome::authority::ScheduleNode::descendants {}

Definition at line 90 of file schedule_node.hpp.

bool kagome::authority::ScheduleNode::enabled = true

Definition at line 94 of file schedule_node.hpp.

std::weak_ptr<const ScheduleNode> kagome::authority::ScheduleNode::parent

Definition at line 89 of file schedule_node.hpp.


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