50 std::vector<std::pair<std::shared_ptr<SessionFace>, std::shared_ptr<Peer>>>
peerSessions()
const;
51 std::vector<std::pair<std::shared_ptr<SessionFace>, std::shared_ptr<Peer>>>
peerSessions(
u256 const& _version)
const;
54 virtual std::string
name()
const = 0;
58 virtual std::shared_ptr<Capability>
newPeerCapability(std::shared_ptr<SessionFace>
const& _s,
unsigned _idOffset,
CapDesc const& _cap, uint16_t _capID) = 0;
67 template<
class PeerCap>
81 virtual unsigned messageCount()
const {
return PeerCap::messageCount(); }
83 virtual std::shared_ptr<Capability>
newPeerCapability(std::shared_ptr<SessionFace>
const& _s,
unsigned _idOffset,
CapDesc const& _cap, uint16_t _capID)
85 _s->registerFraming(_capID);
86 auto p = std::make_shared<PeerCap>(_s,
this, _idOffset, _cap, _capID);
87 _s->registerCapability(_cap, p);
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
std::vector< std::pair< std::shared_ptr< SessionFace >, std::shared_ptr< Peer > > > peerSessions() const
virtual void onStarting()
virtual std::shared_ptr< Capability > newPeerCapability(std::shared_ptr< SessionFace > const &_s, unsigned _idOffset, CapDesc const &_cap, uint16_t _capID)
std::pair< std::string, u256 > CapDesc
virtual ~HostCapabilityFace()
The Host class Capabilities should be registered prior to startNetwork, since m_capabilities is not t...
static u256 staticVersion()
virtual u256 version() const
virtual unsigned messageCount() const
virtual ~HostCapability()
virtual std::string name() const
static unsigned staticMessageCount()
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void >> u256
virtual std::shared_ptr< Capability > newPeerCapability(std::shared_ptr< SessionFace > const &_s, unsigned _idOffset, CapDesc const &_cap, uint16_t _capID)=0
virtual unsigned messageCount() const =0
virtual std::string name() const =0
virtual void onStopping()
static std::string staticName()
virtual u256 version() const =0