Skip to content

Commit

Permalink
* boost::unordered -> std::unordered
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-pimenov committed Nov 27, 2019
1 parent 991ae8b commit 158881e
Show file tree
Hide file tree
Showing 64 changed files with 152 additions and 139 deletions.
6 changes: 3 additions & 3 deletions FlyFeatures/flyServer.cpp
Expand Up @@ -96,7 +96,7 @@ uint16_t CFlyServerConfig::g_winet_min_response_time_for_log = 200;
DWORD CFlyServerConfig::g_winet_receive_timeout = 1000;
DWORD CFlyServerConfig::g_winet_send_timeout = 1000;

boost::unordered_map<TTHValue, std::pair<CFlyServerInfo*, CFlyServerCache> > CFlyServerAdapter::g_fly_server_cache;
std::unordered_map<TTHValue, std::pair<CFlyServerInfo*, CFlyServerCache> > CFlyServerAdapter::g_fly_server_cache;
::CriticalSection CFlyServerAdapter::g_cs_fly_server;
::CriticalSection CFlyServerAdapter::g_cs_set_array_fly_server;
CFlyServerKeyArray CFlyServerAdapter::g_SetFlyServerArray;
Expand All @@ -105,7 +105,7 @@ ::CriticalSection CFlyServerAdapter::g_cs_get_array_fly_server;
CFlyServerKeyArray CFlyServerAdapter::g_GetFlyServerArray;

::CriticalSection CFlyServerAdapter::g_cs_tth_media_map;
boost::unordered_map<TTHValue, uint64_t> CFlyServerAdapter::g_tth_media_file_map;
std::unordered_map<TTHValue, uint64_t> CFlyServerAdapter::g_tth_media_file_map;

::CriticalSection CFlyServerJSON::g_cs_error_report;
::CriticalSection CFlyServerJSON::g_cs_download_counter;
Expand Down Expand Up @@ -1601,7 +1601,7 @@ void CFlyServerAdapter::prepare_mediainfo_to_fly_serverL()
{
// Îáîéäåì êàíäèäàòîâ äëÿ ïðåäà÷è íà ñåðâåð.
// Ìàññèâ - åñòü ó íàñ â áàçå, íî íåò íà fly-server
boost::unordered_map<TTHValue, uint64_t> l_tth_map;
std::unordered_map<TTHValue, uint64_t> l_tth_map;
{
CFlyLock(g_cs_tth_media_map);
l_tth_map.swap(g_tth_media_file_map);
Expand Down
4 changes: 2 additions & 2 deletions FlyFeatures/flyServer.h
Expand Up @@ -460,11 +460,11 @@ class CFlyServerAdapter
static ::CriticalSection g_cs_set_array_fly_server;

static ::CriticalSection g_cs_tth_media_map;
static boost::unordered_map<TTHValue, uint64_t> g_tth_media_file_map;
static std::unordered_map<TTHValue, uint64_t> g_tth_media_file_map;
static void clear_tth_media_map();


static boost::unordered_map<TTHValue, std::pair<CFlyServerInfo*, CFlyServerCache> > g_fly_server_cache;
static std::unordered_map<TTHValue, std::pair<CFlyServerInfo*, CFlyServerCache> > g_fly_server_cache;
static ::CriticalSection g_cs_fly_server;
void prepare_mediainfo_to_fly_serverL();
static void push_mediainfo_to_fly_server();
Expand Down
6 changes: 3 additions & 3 deletions client/AdcHub.cpp
Expand Up @@ -30,15 +30,15 @@

#ifdef FLYLINKDC_COLLECT_UNKNOWN_FEATURES
FastCriticalSection AdcSupports::g_debugCsUnknownAdcFeatures;
boost::unordered_map<string, string> AdcSupports::g_debugUnknownAdcFeatures;
std::unordered_map<string, string> AdcSupports::g_debugUnknownAdcFeatures;

FastCriticalSection NmdcSupports::g_debugCsUnknownNmdcConnection;
boost::unordered_set<string> NmdcSupports::g_debugUnknownNmdcConnection;
std::unordered_set<string> NmdcSupports::g_debugUnknownNmdcConnection;

#endif // FLYLINKDC_COLLECT_UNKNOWN_FEATURES
#ifdef FLYLINKDC_COLLECT_UNKNOWN_TAG
FastCriticalSection NmdcSupports::g_debugCsUnknownNmdcTagParam;
boost::unordered_map<string, unsigned> NmdcSupports::g_debugUnknownNmdcTagParam;
std::unordered_map<string, unsigned> NmdcSupports::g_debugUnknownNmdcTagParam;
#endif // FLYLINKDC_COLLECT_UNKNOWN_TAG


Expand Down
4 changes: 2 additions & 2 deletions client/AdcHub.h
Expand Up @@ -76,7 +76,7 @@ class AdcHub : public Client, public CommandHandler<AdcHub>
~AdcHub();

/** Map session id to OnlineUser */
typedef boost::unordered_map<uint32_t, OnlineUserPtr> SIDMap;
typedef std::unordered_map<uint32_t, OnlineUserPtr> SIDMap;

void getUserList(OnlineUserList& p_list) const;
bool resendMyINFO(bool p_always_send, bool p_is_force_passive);
Expand All @@ -91,7 +91,7 @@ class AdcHub : public Client, public CommandHandler<AdcHub>
string m_salt;
uint32_t m_sid;

boost::unordered_set<uint32_t> forbiddenCommands;
std::unordered_set<uint32_t> forbiddenCommands;

static const vector<StringList> m_searchExts;

Expand Down
6 changes: 3 additions & 3 deletions client/AdcSupports.h
Expand Up @@ -52,7 +52,7 @@ class AdcSupports

#ifdef FLYLINKDC_COLLECT_UNKNOWN_FEATURES
static FastCriticalSection g_debugCsUnknownAdcFeatures;
static boost::unordered_map<string, string> g_debugUnknownAdcFeatures;
static std::unordered_map<string, string> g_debugUnknownAdcFeatures;
#endif
};

Expand All @@ -76,11 +76,11 @@ class NmdcSupports
static void setSupports(Identity& id, const StringList & su);
#ifdef FLYLINKDC_COLLECT_UNKNOWN_FEATURES
static FastCriticalSection g_debugCsUnknownNmdcConnection;
static boost::unordered_set<string> g_debugUnknownNmdcConnection;
static std::unordered_set<string> g_debugUnknownNmdcConnection;
#endif // FLYLINKDC_COLLECT_UNKNOWN_FEATURES
#ifdef FLYLINKDC_COLLECT_UNKNOWN_TAG
static FastCriticalSection g_debugCsUnknownNmdcTagParam;
static boost::unordered_map<string, unsigned> g_debugUnknownNmdcTagParam;
static std::unordered_map<string, unsigned> g_debugUnknownNmdcTagParam;
#endif // FLYLINKDC_COLLECT_UNKNOWN_TAG
};

Expand Down
2 changes: 1 addition & 1 deletion client/BufferedSocket.cpp
Expand Up @@ -419,7 +419,7 @@ bool BufferedSocket::all_search_parser(const string::size_type p_pos_next_separa
std::map<string, int> l_stat_map;
{
static CriticalSection g_debug_cs;
static boost::unordered_map<string, std::pair<int, std::map<string, int> > > g_count_dup_ip_port;
static std::unordered_map<string, std::pair<int, std::map<string, int> > > g_count_dup_ip_port;
if (!l_item.m_is_passive)
{
CFlyLock(g_debug_cs);
Expand Down
2 changes: 1 addition & 1 deletion client/CFlyUserRatioInfo.h
Expand Up @@ -110,7 +110,7 @@ template <class T> class CFlyDirtyValue
}
};
typedef CFlyUploadDownloadPair<double> CFlyGlobalRatioItem;
typedef boost::unordered_map<unsigned long, CFlyUploadDownloadPair<uint64_t> > CFlyUploadDownloadMap; // TODO êåé boost::asio::ip::address_v4
typedef std::unordered_map<unsigned long, CFlyUploadDownloadPair<uint64_t> > CFlyUploadDownloadMap; // TODO êåé boost::asio::ip::address_v4
class CFlyRatioItem : public CFlyUploadDownloadPair<uint64_t>
{
public:
Expand Down
6 changes: 3 additions & 3 deletions client/CFlylinkDBManager.cpp
Expand Up @@ -33,7 +33,7 @@ int64_t g_SQLiteDBSize = 0;
int32_t CFlylinkDBManager::g_count_queue_source = 0;
int32_t CFlylinkDBManager::g_count_queue_files = 0;

boost::unordered_map<TTHValue, TigerTree> CFlylinkDBManager::g_tiger_tree_cache;
std::unordered_map<TTHValue, TigerTree> CFlylinkDBManager::g_tiger_tree_cache;
FastCriticalSection CFlylinkDBManager::g_tth_cache_cs;
unsigned CFlylinkDBManager::g_tth_cache_limit = 500;

Expand Down Expand Up @@ -1866,7 +1866,7 @@ int CFlylinkDBManager::calc_antivirus_flag(const string& p_nick, const boost::as
}
sqlite3_reader l_q = l_sql->executereader();
p_virus_path.clear();
boost::unordered_set<string> l_dup_filter;
std::unordered_set<string> l_dup_filter;
while (l_q.read())
{
if (p_ip4 == boost::asio::ip::address_v4((unsigned long)l_q.getint64(0)))
Expand Down Expand Up @@ -2659,7 +2659,7 @@ int32_t CFlylinkDBManager::load_queue()
#endif
try
{
boost::unordered_map<int, std::vector< CFlySourcesItem > > l_sources_map;
std::unordered_map<int, std::vector< CFlySourcesItem > > l_sources_map;
{
CFlyLog l_src_log("[Load queue source]");
#ifdef FLYLINKDC_USE_DEBUG_10_RECORD
Expand Down
26 changes: 13 additions & 13 deletions client/CFlylinkDBManager.h
Expand Up @@ -238,7 +238,7 @@ struct CFlyFileInfo
{
}
};
typedef boost::unordered_map<string, CFlyFileInfo> CFlyDirMap;
typedef std::unordered_map<string, CFlyFileInfo> CFlyDirMap;
struct CFlyPathItem
{
__int64 m_path_id;
Expand Down Expand Up @@ -317,7 +317,7 @@ struct CFlyDirItem : public CFlyBaseDirItem
};
typedef std::vector<CFlyDirItem> CFlyDirItemArray;
typedef std::unordered_map<string, CFlyRegistryValue> CFlyRegistryMap;
typedef boost::unordered_map<string, CFlyPathItem> CFlyPathCache;
typedef std::unordered_map<string, CFlyPathItem> CFlyPathCache;
class CFlylinkDBManager : public Singleton<CFlylinkDBManager>
{
public:
Expand Down Expand Up @@ -594,7 +594,7 @@ class CFlylinkDBManager : public Singleton<CFlylinkDBManager>
// If two threads share such an object, they must protect access to it using their own locking protocol.
// More details are available in the public header files.
sqlite3_connection m_flySQLiteDB;
typedef boost::unordered_map<string, CFlyHashCacheItem> CFlyHashCacheMap;
typedef std::unordered_map<string, CFlyHashCacheItem> CFlyHashCacheMap;
CFlyHashCacheMap m_cache_hash_files;
FastCriticalSection m_cache_hash_files_cs;
#ifdef FLYLINKDC_USE_LEVELDB
Expand Down Expand Up @@ -641,7 +641,7 @@ class CFlylinkDBManager : public Singleton<CFlylinkDBManager>

#ifdef FLYLINKDC_USE_LASTIP_CACHE
CFlySQLCommand m_select_all_last_ip_and_message_count;
boost::unordered_map<uint32_t, boost::unordered_map<std::string, CFlyLastIPCacheItem> > m_last_ip_cache;
std::unordered_map<uint32_t, std::unordered_map<string, CFlyLastIPCacheItem> > m_last_ip_cache;
FastCriticalSection m_last_ip_cs;
#else
CFlySQLCommand m_select_last_ip_and_message_count;
Expand All @@ -661,9 +661,9 @@ class CFlylinkDBManager : public Singleton<CFlylinkDBManager>
CFlySQLCommand m_find_virus_nick_and_share_and_ip4;

std::unique_ptr<webrtc::RWLockWrapper> m_virus_cs;
boost::unordered_set<std::string> m_virus_user;
boost::unordered_set<int64_t> m_virus_share;
boost::unordered_set<unsigned long> m_virus_ip4;
std::unordered_set<std::string> m_virus_user;
std::unordered_set<int64_t> m_virus_share;
std::unordered_set<unsigned long> m_virus_ip4;
void clear_virus_cacheL();
public:
void load_avdb();
Expand Down Expand Up @@ -733,7 +733,7 @@ class CFlylinkDBManager : public Singleton<CFlylinkDBManager>
{
}
};
boost::unordered_map<uint32_t, CFlyCacheIPInfo> m_ip_info_cache;
std::unordered_map<uint32_t, CFlyCacheIPInfo> m_ip_info_cache;

int m_count_fly_location_ip_record;
bool is_fly_location_ip_valid() const
Expand All @@ -748,7 +748,7 @@ class CFlylinkDBManager : public Singleton<CFlylinkDBManager>
CFlySQLCommand m_select_location_lost;
CFlySQLCommand m_update_location_lost;
CFlySQLCommand m_insert_location_lost;
boost::unordered_set<string> m_lost_location_cache;
std::unordered_set<string> m_lost_location_cache;
#endif
#ifdef FLYLINKDC_USE_GEO_IP
CFlySQLCommand m_select_country_and_location;
Expand All @@ -757,7 +757,7 @@ class CFlylinkDBManager : public Singleton<CFlylinkDBManager>
vector<CFlyLocationDesc> m_country_cache;
#endif
#ifdef _DEBUG
boost::unordered_map<uint32_t, unsigned> m_count_ip_sql_query_guard;
std::unordered_map<uint32_t, unsigned> m_count_ip_sql_query_guard;
#endif
CFlySQLCommand m_select_manual_p2p_guard;
CFlySQLCommand m_delete_manual_p2p_guard;
Expand Down Expand Up @@ -786,11 +786,11 @@ class CFlylinkDBManager : public Singleton<CFlylinkDBManager>
else
return Util::emptyString;
}
typedef boost::unordered_map<string, __int64> CFlyCacheDIC;
typedef std::unordered_map<string, __int64> CFlyCacheDIC;
std::vector<CFlyCacheDIC> m_DIC;

#ifdef FLYLINKDC_USE_CACHE_HUB_URLS
typedef boost::unordered_map<unsigned, string> CFlyCacheDICName;
typedef std::unordered_map<unsigned, string> CFlyCacheDICName;
CFlyCacheDICName m_HubNameMap;
FastCriticalSection m_hub_dic_fcs;
#endif
Expand Down Expand Up @@ -838,7 +838,7 @@ class CFlylinkDBManager : public Singleton<CFlylinkDBManager>
static int32_t g_count_queue_source;
static int32_t g_count_queue_files;

static boost::unordered_map<TTHValue, TigerTree> g_tiger_tree_cache;
static std::unordered_map<TTHValue, TigerTree> g_tiger_tree_cache;
static FastCriticalSection g_tth_cache_cs;
static void clearTTHCache();
static unsigned g_tth_cache_limit;
Expand Down
8 changes: 4 additions & 4 deletions client/Client.h
Expand Up @@ -405,7 +405,7 @@ class Client : public ClientBase, public Speaker<ClientListener>, public Buffere
{
}
};
typedef boost::unordered_map<string, CFlyFloodCommand> CFlyFloodCommandMap;
typedef std::unordered_map<string, CFlyFloodCommand> CFlyFloodCommandMap;
CFlyFloodCommandMap m_flood_detect;
protected:
bool isFloodCommand(const string& p_command, const string& p_line);
Expand Down Expand Up @@ -609,12 +609,12 @@ class Client : public ClientBase, public Speaker<ClientListener>, public Buffere
#ifdef FLYLINKDC_USE_ANTIVIRUS_DB
bool m_isAutobanAntivirusIP;
bool m_isAutobanAntivirusNick;
boost::unordered_set<string> m_virus_nick;
std::unordered_set<string> m_virus_nick;
string m_AntivirusCommandIP;
#endif
#ifdef FLYLINKDC_USE_VIRUS_CHECK_DEBUG
boost::unordered_set<string> m_virus_nick_checked;
boost::unordered_map<string, string> m_check_myinfo_dup;
std::unordered_set<string> m_virus_nick_checked;
std::unordered_map<string, string> m_check_myinfo_dup;
#endif
private:
#ifdef FLYLINKDC_USE_LASTIP_AND_USER_RATIO
Expand Down
2 changes: 1 addition & 1 deletion client/ClientManager.h
Expand Up @@ -265,7 +265,7 @@ class ClientManager : public Speaker<ClientManagerListener>,
static ClientList g_clients;
static std::unique_ptr<webrtc::RWLockWrapper> g_csClients;

typedef boost::unordered_map<CID, UserPtr> UserMap;
typedef std::unordered_map<CID, UserPtr> UserMap;

static UserMap g_users;

Expand Down
8 changes: 4 additions & 4 deletions client/ConnectionManager.cpp
Expand Up @@ -39,10 +39,10 @@ std::unique_ptr<webrtc::RWLockWrapper> ConnectionManager::g_csDdosCTM2HUBCheck =
std::unique_ptr<webrtc::RWLockWrapper> ConnectionManager::g_csTTHFilter = std::unique_ptr<webrtc::RWLockWrapper> (webrtc::RWLockWrapper::CreateRWLock());
std::unique_ptr<webrtc::RWLockWrapper> ConnectionManager::g_csFileFilter = std::unique_ptr<webrtc::RWLockWrapper>(webrtc::RWLockWrapper::CreateRWLock());

boost::unordered_set<UserConnection*> ConnectionManager::g_userConnections;
boost::unordered_map<string, ConnectionManager::CFlyTickTTH> ConnectionManager::g_duplicate_search_tth;
boost::unordered_map<string, ConnectionManager::CFlyTickFile> ConnectionManager::g_duplicate_search_file;
boost::unordered_set<string> ConnectionManager::g_ddos_ctm2hub;
std::unordered_set<UserConnection*> ConnectionManager::g_userConnections;
std::unordered_map<string, ConnectionManager::CFlyTickTTH> ConnectionManager::g_duplicate_search_tth;
std::unordered_map<string, ConnectionManager::CFlyTickFile> ConnectionManager::g_duplicate_search_file;
std::unordered_set<string> ConnectionManager::g_ddos_ctm2hub;
std::map<ConnectionManager::CFlyDDOSkey, ConnectionManager::CFlyDDoSTick> ConnectionManager::g_ddos_map;
std::set<ConnectionQueueItemPtr> ConnectionManager::g_downloads; // TODO - ñäåëàòü ïîèñê ïî User?
std::set<ConnectionQueueItemPtr> ConnectionManager::g_uploads; // TODO - ñäåëàòü ïîèñê ïî User?
Expand Down
14 changes: 7 additions & 7 deletions client/ConnectionManager.h
Expand Up @@ -175,7 +175,7 @@ class ExpectedMap

private:
/** Nick -> myNick, hubUrl for expected NMDC incoming connections */
typedef boost::unordered_map<string, NickHubPair> ExpectMap;
typedef std::unordered_map<string, NickHubPair> ExpectMap;
ExpectMap m_expectedConnections;

FastCriticalSection cs;
Expand Down Expand Up @@ -284,7 +284,7 @@ class ConnectionManager :
static std::set<ConnectionQueueItemPtr> g_uploads;

/** All active connections */
static boost::unordered_set<UserConnection*> g_userConnections;
static std::unordered_set<UserConnection*> g_userConnections;

struct CFlyDDOSkey
{
Expand Down Expand Up @@ -319,8 +319,8 @@ class ConnectionManager :
{
public:
std::string m_type_block;
boost::unordered_set<uint16_t> m_ports;
boost::unordered_map<std::string, uint32_t> m_original_query_for_debug;
std::unordered_set<uint16_t> m_ports;
std::unordered_map<string, uint32_t> m_original_query_for_debug;
CFlyDDoSTick()
{
}
Expand All @@ -338,12 +338,12 @@ class ConnectionManager :
}
};
static std::map<CFlyDDOSkey, CFlyDDoSTick> g_ddos_map;
static boost::unordered_set<string> g_ddos_ctm2hub; // $Error CTM2HUB
static std::unordered_set<string> g_ddos_ctm2hub; // $Error CTM2HUB
public:
static void addCTM2HUB(const string& p_server_port, const HintedUser& p_hinted_user);
private:
static boost::unordered_map<string, CFlyTickTTH> g_duplicate_search_tth;
static boost::unordered_map<string, CFlyTickFile> g_duplicate_search_file;
static std::unordered_map<string, CFlyTickTTH> g_duplicate_search_tth;
static std::unordered_map<string, CFlyTickFile> g_duplicate_search_file;

#define USING_IDLERS_IN_CONNECTION_MANAGER
#ifdef USING_IDLERS_IN_CONNECTION_MANAGER
Expand Down
1 change: 1 addition & 0 deletions client/ConnectivityManager.cpp
Expand Up @@ -24,6 +24,7 @@
#include "SearchManager.h"
#include "DownloadManager.h"
#include "../FlyFeatures/flyServer.h"
#include "dcformat.h"

string ConnectivityManager::g_status;
bool ConnectivityManager::g_is_running = false;
Expand Down
3 changes: 1 addition & 2 deletions client/CryptoManager.cpp
Expand Up @@ -22,15 +22,14 @@
#include "File.h"
#include "ClientManager.h"
#include "SettingsManager.h"

#include "LogManager.h"
#include "SSLSocket.h"
#include "dcformat.h"

#include <openssl/bn.h>
#include <openssl/err.h>
#include <openssl/rand.h>


namespace dcpp {

void* CryptoManager::g_tmpKeysMap[KEY_LAST] = { NULL, NULL, NULL };
Expand Down
2 changes: 1 addition & 1 deletion client/DirectoryListing.cpp
Expand Up @@ -25,7 +25,7 @@
#include "../FlyFeatures/flyServer.h"

#ifdef FLYLINKDC_USE_DIRLIST_FILE_EXT_STAT
boost::unordered_map<string, DirectoryListing::CFlyStatExt> DirectoryListing::g_ext_stat;
std::unordered_map<string, DirectoryListing::CFlyStatExt> DirectoryListing::g_ext_stat;
#endif
DirectoryListing::DirectoryListing(const HintedUser& aUser) :
hintedUser(aUser), abort(false), root(new Directory(this, nullptr, Util::emptyString, false, false, true)),
Expand Down
4 changes: 2 additions & 2 deletions client/DirectoryListing.h
Expand Up @@ -118,7 +118,7 @@ class DirectoryListing : public UserInfoBase
};
typedef vector<Ptr> List;

typedef boost::unordered_set<TTHValue> TTHSet;
typedef std::unordered_set<TTHValue> TTHSet;

List directories;

Expand Down Expand Up @@ -191,7 +191,7 @@ class DirectoryListing : public UserInfoBase
{
}
};
static boost::unordered_map<string, CFlyStatExt> g_ext_stat;
static std::unordered_map<string, CFlyStatExt> g_ext_stat;
#endif

void download(const string& aDir, const string& aTarget, bool highPrio, QueueItem::Priority prio = QueueItem::DEFAULT);
Expand Down
1 change: 0 additions & 1 deletion client/DownloadManager.h
Expand Up @@ -46,7 +46,6 @@
* Singleton. Use its listener interface to update the download list
* in the user interface.
*/
//typedef boost::unordered_map<UserPtr, UserConnection*, User::Hash> IdlersMap;
typedef std::vector<UserConnection*> UserConnectionList;

class DownloadManager : public Speaker<DownloadManagerListener>,
Expand Down

0 comments on commit 158881e

Please sign in to comment.