From 506fe0f6e88f268192403dc39ab8bb72c0367a98 Mon Sep 17 00:00:00 2001 From: subtly Date: Tue, 6 Jan 2015 16:51:10 +0100 Subject: [PATCH] define constructors for windows --- libp2p/NodeTable.h | 5 +++-- libp2p/UDP.h | 2 +- test/net.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libp2p/NodeTable.h b/libp2p/NodeTable.h index 8f15cb958..e8385998e 100644 --- a/libp2p/NodeTable.h +++ b/libp2p/NodeTable.h @@ -46,6 +46,7 @@ namespace p2p * @todo makeRequired: exclude bucket from refresh if we have node as peer. * * [Optimization] + * @todo encapsulate doFindNode into NetworkAlgorithm (task) * @todo Pong to include ip:port where ping was received * @todo expiration and sha3(id) 'to' for messages which are replies (prevents replay) * @todo std::shared_ptr m_cachedPingPacket; @@ -281,7 +282,7 @@ struct Pong: RLPXDatagram */ struct FindNode: RLPXDatagram { - using RLPXDatagram::RLPXDatagram; + FindNode(bi::udp::endpoint _ep): RLPXDatagram(_ep) {} FindNode(bi::udp::endpoint _ep, NodeId _target, std::chrono::seconds _expiration = std::chrono::seconds(30)): RLPXDatagram(_ep), target(_target), expiration(futureFromEpoch(_expiration)) {} h512 target; @@ -312,7 +313,7 @@ struct Neighbours: RLPXDatagram void interpretRLP(RLP const& _r) { ipAddress = _r[0].toString(); port = _r[1].toInt(); node = h512(_r[2].toBytes()); } }; - using RLPXDatagram::RLPXDatagram; + Neighbours(bi::udp::endpoint _ep): RLPXDatagram(_ep) {} Neighbours(bi::udp::endpoint _to, std::vector> const& _nearest, unsigned _offset = 0, unsigned _limit = 0): RLPXDatagram(_to) { auto limit = _limit ? std::min(_nearest.size(), (size_t)(_offset + _limit)) : _nearest.size(); diff --git a/libp2p/UDP.h b/libp2p/UDP.h index 96e7fd99e..6de783509 100644 --- a/libp2p/UDP.h +++ b/libp2p/UDP.h @@ -76,7 +76,7 @@ struct RLPXDatagramFace: public UDPDatagram template struct RLPXDatagram: public RLPXDatagramFace { - using RLPXDatagramFace::RLPXDatagramFace; + RLPXDatagram(bi::udp::endpoint const& _ep): RLPXDatagramFace(_ep) {} static T fromBytesConstRef(bi::udp::endpoint const& _ep, bytesConstRef _bytes) { T t(_ep); t.interpretRLP(_bytes); return std::move(t); } }; diff --git a/test/net.cpp b/test/net.cpp index 6952c282a..946995130 100644 --- a/test/net.cpp +++ b/test/net.cpp @@ -51,7 +51,7 @@ protected: struct TestNodeTable: public NodeTable { /// Constructor - using NodeTable::NodeTable; + TestNodeTable(ba::io_service& _io, KeyPair _alias, uint16_t _port = 30300): NodeTable(_io, _alias, _port) {} static std::vector> createTestNodes(unsigned _count) {