mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
use DHT table for floodfills
This commit is contained in:
parent
692600dfac
commit
d40cd00cdb
4 changed files with 49 additions and 87 deletions
|
@ -44,20 +44,20 @@ namespace data
|
|||
|
||||
void Insert (const std::shared_ptr<RouterInfo>& r);
|
||||
bool Remove (const IdentHash& h);
|
||||
std::shared_ptr<RouterInfo> FindClosest (const IdentHash& h, const Filter& filter = nullptr);
|
||||
std::vector<std::shared_ptr<RouterInfo> > FindClosest (const IdentHash& h, size_t num, const Filter& filter = nullptr);
|
||||
std::shared_ptr<RouterInfo> FindClosest (const IdentHash& h, const Filter& filter = nullptr) const;
|
||||
std::vector<std::shared_ptr<RouterInfo> > FindClosest (const IdentHash& h, size_t num, const Filter& filter = nullptr) const;
|
||||
|
||||
void Print (std::stringstream& s);
|
||||
size_t GetSize () const { return m_Size; };
|
||||
void Clear ();
|
||||
void Cleanup (Filter filter);
|
||||
void Cleanup (const Filter& filter);
|
||||
|
||||
private:
|
||||
|
||||
void Insert (const std::shared_ptr<RouterInfo>& r, DHTNode * root, int level); // recursive
|
||||
bool Remove (const IdentHash& h, DHTNode * root, int level);
|
||||
std::shared_ptr<RouterInfo> FindClosest (const IdentHash& h, DHTNode * root, int level);
|
||||
void FindClosest (const IdentHash& h, size_t num, DHTNode * root, int level, std::vector<std::shared_ptr<RouterInfo> >& hashes);
|
||||
std::shared_ptr<RouterInfo> FindClosest (const IdentHash& h, DHTNode * root, int level) const;
|
||||
void FindClosest (const IdentHash& h, size_t num, DHTNode * root, int level, std::vector<std::shared_ptr<RouterInfo> >& hashes) const;
|
||||
void Cleanup (DHTNode * root);
|
||||
void Print (std::stringstream& s, DHTNode * root, int level);
|
||||
|
||||
|
@ -66,7 +66,7 @@ namespace data
|
|||
DHTNode * m_Root;
|
||||
size_t m_Size;
|
||||
// transient
|
||||
Filter m_Filter;
|
||||
mutable Filter m_Filter;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue