Kagome
Polkadot Runtime Engine in C++17
kagome::network::CollationProtocol Class Referencefinal

#include <collation_protocol.hpp>

Inheritance diagram for kagome::network::CollationProtocol:
Collaboration diagram for kagome::network::CollationProtocol:

Public Member Functions

 CollationProtocol ()=delete
 
 ~CollationProtocol () override=default
 
 CollationProtocol (libp2p::Host &host, application::AppConfiguration const &app_config, application::ChainSpec const &chain_spec, std::shared_ptr< CollationObserver > observer)
 
void onIncomingStream (std::shared_ptr< Stream > stream) override
 
void newOutgoingStream (const PeerInfo &peer_info, std::function< void(outcome::result< std::shared_ptr< Stream >>)> &&cb) override
 
bool start () override
 
bool stop () override
 
const std::string & protocolName () const override
 
- Public Member Functions inherited from kagome::network::ProtocolBase
 ProtocolBase ()=default
 
 ProtocolBase (ProtocolBase &&) noexcept=delete
 
 ProtocolBase (const ProtocolBase &)=delete
 
virtual ~ProtocolBase ()=default
 
ProtocolBaseoperator= (ProtocolBase &&) noexcept=delete
 
ProtocolBaseoperator= (ProtocolBase const &)=delete
 

Private Member Functions

template<bool DirectionIncoming, typename F >
void exchangeHandshake (std::shared_ptr< kagome::network::Stream > const &stream, F &&func)
 
template<bool DirectionIncoming, typename F >
void doCollatorHandshake (std::shared_ptr< kagome::network::Stream > const &stream, F &&func)
 
void readCollationMsg (std::shared_ptr< kagome::network::Stream > stream)
 
void onCollationMessageRx (libp2p::peer::PeerId const &peer_id, CollationMessage &&collation_message)
 
void onCollationDeclRx (libp2p::peer::PeerId const &peer_id, CollatorDeclaration &&collation_decl)
 
void onCollationAdvRx (libp2p::peer::PeerId const &peer_id, CollatorAdvertisement &&collation_adv)
 
- Private Member Functions inherited from NonCopyable
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 
 NonCopyable ()=default
 
 ~NonCopyable ()=default
 
- Private Member Functions inherited from NonMovable
 NonMovable (NonMovable &&)=delete
 
NonMovableoperator= (NonMovable &&)=delete
 
 NonMovable ()=default
 
 ~NonMovable ()=default
 

Private Attributes

ProtocolBaseImpl base_
 
std::shared_ptr< CollationObserverobserver_
 
application::AppConfiguration const & app_config_
 

Detailed Description

Definition at line 33 of file collation_protocol.hpp.

Constructor & Destructor Documentation

kagome::network::CollationProtocol::CollationProtocol ( )
delete
kagome::network::CollationProtocol::~CollationProtocol ( )
overridedefault
kagome::network::CollationProtocol::CollationProtocol ( libp2p::Host &  host,
application::AppConfiguration const &  app_config,
application::ChainSpec const &  chain_spec,
std::shared_ptr< CollationObserver observer 
)

Definition at line 17 of file collation_protocol.cpp.

Member Function Documentation

template<bool DirectionIncoming, typename F >
void kagome::network::CollationProtocol::doCollatorHandshake ( std::shared_ptr< kagome::network::Stream > const &  stream,
F &&  func 
)
inlineprivate

Definition at line 99 of file collation_protocol.hpp.

template<bool DirectionIncoming, typename F >
void kagome::network::CollationProtocol::exchangeHandshake ( std::shared_ptr< kagome::network::Stream > const &  stream,
F &&  func 
)
inlineprivate

Definition at line 62 of file collation_protocol.hpp.

void kagome::network::CollationProtocol::newOutgoingStream ( const PeerInfo peer_info)
overridevirtual

Implements kagome::network::ProtocolBase.

Definition at line 34 of file collation_protocol.cpp.

void kagome::network::CollationProtocol::onCollationAdvRx ( libp2p::peer::PeerId const &  peer_id,
CollatorAdvertisement &&  collation_adv 
)
private

Definition at line 88 of file collation_protocol.cpp.

void kagome::network::CollationProtocol::onCollationDeclRx ( libp2p::peer::PeerId const &  peer_id,
CollatorDeclaration &&  collation_decl 
)
private

Definition at line 77 of file collation_protocol.cpp.

void kagome::network::CollationProtocol::onCollationMessageRx ( libp2p::peer::PeerId const &  peer_id,
CollationMessage &&  collation_message 
)
private

Definition at line 96 of file collation_protocol.cpp.

void kagome::network::CollationProtocol::onIncomingStream ( std::shared_ptr< Stream stream)
overridevirtual

Implements kagome::network::ProtocolBase.

Definition at line 160 of file collation_protocol.cpp.

const std::string& kagome::network::CollationProtocol::protocolName ( ) const
inlineoverridevirtual

Implements kagome::network::ProtocolBase.

Definition at line 56 of file collation_protocol.hpp.

void kagome::network::CollationProtocol::readCollationMsg ( std::shared_ptr< kagome::network::Stream stream)
private

Definition at line 112 of file collation_protocol.cpp.

bool kagome::network::CollationProtocol::start ( )
overridevirtual

Implements kagome::network::ProtocolBase.

Definition at line 26 of file collation_protocol.cpp.

bool kagome::network::CollationProtocol::stop ( )
overridevirtual

Implements kagome::network::ProtocolBase.

Definition at line 30 of file collation_protocol.cpp.

Member Data Documentation

application::AppConfiguration const& kagome::network::CollationProtocol::app_config_
private

Definition at line 131 of file collation_protocol.hpp.

ProtocolBaseImpl kagome::network::CollationProtocol::base_
private

Definition at line 129 of file collation_protocol.hpp.

std::shared_ptr<CollationObserver> kagome::network::CollationProtocol::observer_
private

Definition at line 130 of file collation_protocol.hpp.


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