Kagome
Polkadot Runtime Engine in C++17
kagome::network::ReqCollationProtocolImpl Struct Reference
Inheritance diagram for kagome::network::ReqCollationProtocolImpl:
Collaboration diagram for kagome::network::ReqCollationProtocolImpl:

Public Member Functions

 ReqCollationProtocolImpl (libp2p::Host &host, application::AppConfiguration const &app_config, application::ChainSpec const &chain_spec, std::shared_ptr< ReqCollationObserver > observer)
 
- Public Member Functions inherited from kagome::network::RequestResponseProtocol< CollationFetchingRequest, CollationFetchingResponse, ScaleMessageReadWriter >
 RequestResponseProtocol (libp2p::Host &host, Protocol const &protocol, ProtocolName const &name)
 
virtual ~RequestResponseProtocol ()
 
bool start () override
 
bool stop () override
 
const ProtocolprotocolName () const override
 
void doRequest (const PeerId &peer_id, RequestType request, std::function< void(outcome::result< ResponseType >)> &&response_handler)
 
- 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
 
- Public Member Functions inherited from NonCopyable
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 
- Public Member Functions inherited from NonMovable
 NonMovable (NonMovable &&)=delete
 
NonMovableoperator= (NonMovable &&)=delete
 

Public Attributes

 observer_
 

Additional Inherited Members

- Public Types inherited from kagome::network::RequestResponseProtocol< CollationFetchingRequest, CollationFetchingResponse, ScaleMessageReadWriter >
using RequestType = CollationFetchingRequest
 
using ResponseType = CollationFetchingResponse
 
using ReadWriterType = ScaleMessageReadWriter
 
- Protected Member Functions inherited from kagome::network::RequestResponseProtocol< CollationFetchingRequest, CollationFetchingResponse, ScaleMessageReadWriter >
virtual outcome::result< ResponseTypeonRxRequest (RequestType request, std::shared_ptr< Stream > stream)=0
 
virtual void onTxRequest (RequestType const &request)=0
 
ProtocolBaseImplbase ()
 
- Protected Member Functions inherited from NonCopyable
 NonCopyable ()=default
 
 ~NonCopyable ()=default
 
- Protected Member Functions inherited from NonMovable
 NonMovable ()=default
 
 ~NonMovable ()=default
 

Detailed Description

Definition at line 14 of file protocol_req_collation.cpp.

Constructor & Destructor Documentation

kagome::network::ReqCollationProtocolImpl::ReqCollationProtocolImpl ( libp2p::Host &  host,
application::AppConfiguration const &  app_config,
application::ChainSpec const &  chain_spec,
std::shared_ptr< ReqCollationObserver observer 
)
inline

Definition at line 20 of file protocol_req_collation.cpp.

Member Data Documentation

kagome::network::ReqCollationProtocolImpl::observer_
Initial value:
{std::move(observer)} {}
protected:
outcome::result<CollationFetchingResponse> onRxRequest(
CollationFetchingRequest request,
std::shared_ptr<Stream> ) override {
BOOST_ASSERT(observer_);
return observer_->OnCollationRequest(std::move(request));
}
void onTxRequest(CollationFetchingRequest const &request) override {
if (base().logger()->level() >= log::Level::DEBUG) {
base().logger()->debug("Requesting collation");
}
}
private:
std::shared_ptr<ReqCollationObserver> observer_

Definition at line 30 of file protocol_req_collation.cpp.


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