libktorrent  2.2.0
Public Types | Public Member Functions | List of all members
dht::KClosestNodesSearch Class Reference

#include <kclosestnodessearch.h>

Public Types

typedef std::map< dht::Key, KBucketEntry >::const_iterator CItr
 
typedef std::map< dht::Key, KBucketEntry >::iterator Itr
 

Public Member Functions

 KClosestNodesSearch (const dht::Key &key, bt::Uint32 max_entries)
 
Itr begin ()
 
CItr begin () const
 
Itr end ()
 
CItr end () const
 
bt::Uint32 getNumEntries () const
 Get the number of entries.
 
const dht::KeygetSearchTarget () const
 Get the target key of the search3.
 
void pack (PackedNodeContainer *cnt)
 
void tryInsert (const KBucketEntry &e)
 

Detailed Description

Author
Joris Guisson joris.nosp@m..gui.nosp@m.sson@.nosp@m.gmai.nosp@m.l.com

Class used to store the search results during a K closests nodes search Note: we use a std::map because of lack of functionality in QMap

Definition at line 55 of file kclosestnodessearch.h.

Constructor & Destructor Documentation

◆ KClosestNodesSearch()

dht::KClosestNodesSearch::KClosestNodesSearch ( const dht::Key key,
bt::Uint32  max_entries 
)

Constructor sets the key to compare with

Parameters
keyThe key to compare with
max_entriesThe maximum number of entries can be in the map
Returns

Member Function Documentation

◆ pack()

void dht::KClosestNodesSearch::pack ( PackedNodeContainer cnt)

Pack the search results in a PackedNodeContainer.

Parameters
cntPlace to store IPv6 nodes

◆ tryInsert()

void dht::KClosestNodesSearch::tryInsert ( const KBucketEntry e)

Try to insert an entry.

Parameters
eThe entry

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