ED2K Class Reference

#include <ed2k.h>

List of all members.


Public Member Functions

virtual bool onInit ()
virtual int onExit ()
virtual std::string getDesc ()
Accessors for various commonly-used variables in this module
uint32_t getId () const
uint16_t getTcpPort () const
uint16_t getUdpPort () const
Hash< MD4Hash > getHash () const
std::string getNick () const
bool isLowId () const
bool isHighId () const
boost::filesystem::path getConfigDir () const
void setId (uint32_t id)
 Used by ServerList.
void setNick (const std::string &nick)
void setTcpPort (uint16_t port)
void setUdpPort (uint16_t port)

Private Member Functions

 DECLARE_MODULE (ED2K,"ed2k")
std::string createUserHash () const
 Generates new userhash.
bool linkHandler (const std::string &link)
 Handler for string-based links for starting a download.

Private Attributes

boost::filesystem::path m_configDir
 Configuration directory.
uint32_t m_id
 Own ID in ed2k network.
uint16_t m_tcpPort
 Where we have our TCP listener.
uint16_t m_udpPort
 Where we have our UDP listener.
std::string m_nick
 Our nickname on ed2k net.
Hash< MD4Hash > m_userHash
 own userhash on ed2k network.

Member Function Documentation

ED2K::DECLARE_MODULE ED2K  ,
"ed2k" 
[private]
 

bool ED2K::onInit  )  [virtual]
 

Definition at line 50 of file ed2k.cpp.

References createUserHash(), ServerList::init(), ClientList::init(), DownloadList::init(), CreditsDb::initCrypting(), ClientList::instance(), DownloadList::instance(), ServerList::instance(), ED2KConfig::instance(), CreditsDb::instance(), linkHandler(), CreditsDb::load(), ServerList::load(), m_configDir, m_id, m_tcpPort, m_udpPort, m_userHash, and setNick().

int ED2K::onExit  )  [virtual]
 

Definition at line 142 of file ed2k.cpp.

References ServerList::exit(), DownloadList::exit(), ClientList::exit(), DownloadList::instance(), ClientList::instance(), CreditsDb::instance(), ServerList::instance(), ED2KConfig::instance(), m_configDir, m_tcpPort, m_udpPort, CreditsDb::save(), and ServerList::save().

virtual std::string ED2K::getDesc  )  [inline, virtual]
 

Definition at line 56 of file ed2k.h.

uint32_t ED2K::getId  )  const [inline]
 

Definition at line 62 of file ed2k.h.

References m_id.

uint16_t ED2K::getTcpPort  )  const [inline]
 

Definition at line 63 of file ed2k.h.

References m_tcpPort.

uint16_t ED2K::getUdpPort  )  const [inline]
 

Definition at line 64 of file ed2k.h.

References m_udpPort.

Hash<MD4Hash> ED2K::getHash  )  const [inline]
 

Definition at line 65 of file ed2k.h.

References m_userHash.

std::string ED2K::getNick  )  const [inline]
 

Definition at line 66 of file ed2k.h.

References m_nick.

bool ED2K::isLowId  )  const [inline]
 

Definition at line 67 of file ed2k.h.

References isLowId(), and m_id.

bool ED2K::isHighId  )  const [inline]
 

Definition at line 68 of file ed2k.h.

References isHighId(), and m_id.

boost::filesystem::path ED2K::getConfigDir  )  const [inline]
 

Definition at line 69 of file ed2k.h.

References m_configDir.

void ED2K::setId uint32_t  id  )  [inline]
 

Used by ServerList.

Definition at line 71 of file ed2k.h.

References m_id.

void ED2K::setNick const std::string &  nick  )  [inline]
 

Definition at line 72 of file ed2k.h.

References ED2KConfig::instance(), and m_nick.

Referenced by onInit().

void ED2K::setTcpPort uint16_t  port  )  [inline]
 

Definition at line 76 of file ed2k.h.

References m_tcpPort.

void ED2K::setUdpPort uint16_t  port  )  [inline]
 

Definition at line 77 of file ed2k.h.

References m_udpPort.

std::string ED2K::createUserHash  )  const [private]
 

Generates new userhash.

Definition at line 220 of file ed2k.cpp.

Referenced by onInit().

bool ED2K::linkHandler const std::string &  link  )  [private]
 

Handler for string-based links for starting a download.

Definition at line 156 of file ed2k.cpp.

Referenced by onInit().


Member Data Documentation

boost::filesystem::path ED2K::m_configDir [private]
 

Configuration directory.

Definition at line 84 of file ed2k.h.

Referenced by getConfigDir(), onExit(), and onInit().

uint32_t ED2K::m_id [private]
 

Own ID in ed2k network.

Definition at line 86 of file ed2k.h.

Referenced by getId(), isHighId(), isLowId(), onInit(), and setId().

uint16_t ED2K::m_tcpPort [private]
 

Where we have our TCP listener.

Definition at line 87 of file ed2k.h.

Referenced by getTcpPort(), onExit(), onInit(), and setTcpPort().

uint16_t ED2K::m_udpPort [private]
 

Where we have our UDP listener.

Definition at line 88 of file ed2k.h.

Referenced by getUdpPort(), onExit(), onInit(), and setUdpPort().

std::string ED2K::m_nick [private]
 

Our nickname on ed2k net.

Definition at line 89 of file ed2k.h.

Referenced by getNick(), and setNick().

Hash<MD4Hash> ED2K::m_userHash [private]
 

own userhash on ed2k network.

This just a bunch of randomness really, but - its a hash afterall. Thus the object type.

Definition at line 93 of file ed2k.h.

Referenced by getHash(), and onInit().


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