mirror of
https://github.com/SWG-Source/src.git
synced 2026-07-29 23:15:56 -04:00
Removed references to tr1 now that c++11 works
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered_map>
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -89,7 +89,7 @@ protected:
|
||||
ReferenceCountingData *referenceData;
|
||||
};
|
||||
|
||||
typedef std::tr1::unordered_map<void *, ObjectData, ptr_hash> ObjectMap;
|
||||
typedef std::unordered_map<void *, ObjectData, ptr_hash> ObjectMap;
|
||||
|
||||
ObjectMap liveObjects;
|
||||
};
|
||||
|
||||
@@ -156,8 +156,6 @@ inline size_t NetworkId::getHashValue () const
|
||||
// STL standard hash function
|
||||
namespace std
|
||||
{
|
||||
namespace tr1
|
||||
{
|
||||
|
||||
template <>
|
||||
struct hash<NetworkId> // stl standard hash
|
||||
@@ -165,6 +163,6 @@ struct hash<NetworkId> // stl standard hash
|
||||
size_t operator()(const NetworkId &x) const { return x.getHashValue(); }
|
||||
};
|
||||
|
||||
}}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -60,12 +60,8 @@ namespace std
|
||||
|
||||
typedef basic_string<char, char_traits<char>, allocator<char> > string;
|
||||
|
||||
namespace tr1
|
||||
{
|
||||
template <class _T1> struct hash;
|
||||
template <class _Key, class _Tp, class _Hash, class _Compare, class _Alloc> class unordered_map;
|
||||
template <class _Key, class _Hash, class _Compare, class _Alloc> class unordered_set;
|
||||
}
|
||||
template <class _Key, class _Tp, class _Hash, class _Compare, class _Alloc> class unordered_map;
|
||||
template <class _Key, class _Hash, class _Compare, class _Alloc> class unordered_set;
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc = std::allocator<_Tp> > struct stddeque
|
||||
@@ -88,9 +84,9 @@ template <class _Key, class _Tp, class _Compare = std::less<_Key>, class _Alloc
|
||||
// typedef std::hash_map<_Key, _Tp, _HashFcn, _Compare, _Alloc> fwd;
|
||||
//};
|
||||
|
||||
template <class _Key, class _Tp, class _HashFcn = std::tr1::hash<_Key>, class _Compare = std::equal_to<_Key>, class _Alloc = std::allocator< std::pair <const _Key, _Tp> > > struct stdunordered_map
|
||||
template <class _Key, class _Tp, class _HashFcn = std::hash<_Key>, class _Compare = std::equal_to<_Key>, class _Alloc = std::allocator< std::pair <const _Key, _Tp> > > struct stdunordered_map
|
||||
{
|
||||
typedef std::tr1::unordered_map<_Key, _Tp, _HashFcn, _Compare, _Alloc> fwd;
|
||||
typedef std::unordered_map<_Key, _Tp, _HashFcn, _Compare, _Alloc> fwd;
|
||||
};
|
||||
|
||||
template <class _Key, class _Tp, class _Compare = std::less<_Key>, class _Alloc = std::allocator< std::pair <const _Key, _Tp> > > struct stdmultimap
|
||||
@@ -108,9 +104,9 @@ template <class _Key, class _Compare = std::less<_Key>, class _Alloc = std::allo
|
||||
// typedef std::hash_set<_Key, _HashFcn, _Compare, _Alloc> fwd;
|
||||
//};
|
||||
|
||||
template <class _Key, class _HashFcn = std::tr1::hash<_Key>, class _Compare = std::equal_to<_Key>, class _Alloc = std::allocator<_Key> > struct stdunordered_set
|
||||
template <class _Key, class _HashFcn = std::hash<_Key>, class _Compare = std::equal_to<_Key>, class _Alloc = std::allocator<_Key> > struct stdunordered_set
|
||||
{
|
||||
typedef std::tr1::unordered_set<_Key, _HashFcn, _Compare, _Alloc> fwd;
|
||||
typedef std::unordered_set<_Key, _HashFcn, _Compare, _Alloc> fwd;
|
||||
};
|
||||
|
||||
template <class _Key, class _Compare = std::less<_Key>, class _Alloc = std::allocator<_Key> > struct stdmultiset
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered_map>
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace CombatDataTableNamespace
|
||||
std::string const cs_columnActionNameCrc("actionNameCrc");
|
||||
int s_actionNameCrcColumn;
|
||||
|
||||
std::tr1::unordered_map<uint32, int> s_commandsWithMinInvisLevelRequired;
|
||||
std::unordered_map<uint32, int> s_commandsWithMinInvisLevelRequired;
|
||||
}
|
||||
|
||||
using namespace CombatDataTableNamespace;
|
||||
@@ -402,7 +402,7 @@ int CombatDataTable::getMinInvisLevelRequired(uint32 commandHash)
|
||||
if(commandHash == 0)
|
||||
return -1;
|
||||
|
||||
std::tr1::unordered_map<uint32, int>::const_iterator it = s_commandsWithMinInvisLevelRequired.find(commandHash);
|
||||
std::unordered_map<uint32, int>::const_iterator it = s_commandsWithMinInvisLevelRequired.find(commandHash);
|
||||
if (it != s_commandsWithMinInvisLevelRequired.end())
|
||||
return it->second;
|
||||
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
#include "sharedMessageDispatch/Transceiver.h"
|
||||
#include "unicodeArchive/UnicodeArchive.h"
|
||||
#include "UnicodeUtils.h"
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered_map>
|
||||
|
||||
// ======================================================================
|
||||
|
||||
namespace WaypointNamespace
|
||||
{
|
||||
typedef std::tr1::unordered_map<NetworkId, WaypointData *> WaypointMapById;
|
||||
typedef std::unordered_map<NetworkId, WaypointData *> WaypointMapById;
|
||||
WaypointMapById s_waypointMapById;
|
||||
bool s_installed;
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace Archive
|
||||
if (networkId.isValid())
|
||||
{
|
||||
WaypointData *data = 0;
|
||||
std::tr1::unordered_map<NetworkId, WaypointData *>::iterator f = s_waypointMapById.find(networkId);
|
||||
std::unordered_map<NetworkId, WaypointData *>::iterator f = s_waypointMapById.find(networkId);
|
||||
if (f == s_waypointMapById.end())
|
||||
data = new WaypointData(networkId);
|
||||
else
|
||||
@@ -331,7 +331,7 @@ std::string const &Waypoint::getColorNameById(uint8 id) // static
|
||||
Waypoint const Waypoint::getWaypointById(NetworkId const &id) // static
|
||||
{
|
||||
Waypoint result;
|
||||
std::tr1::unordered_map<NetworkId, WaypointData *>::iterator f = s_waypointMapById.find(id);
|
||||
std::unordered_map<NetworkId, WaypointData *>::iterator f = s_waypointMapById.find(id);
|
||||
if (f != s_waypointMapById.end())
|
||||
result.releaseData(f->second);
|
||||
return result;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "Unicode.h"
|
||||
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered_map>
|
||||
|
||||
//======================================================================
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "sharedGame/FirstSharedGame.h"
|
||||
#include "sharedGame/ShipComponentType.h"
|
||||
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered_map>
|
||||
|
||||
//======================================================================
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
#include "sharedMath/Vector.h"
|
||||
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered_map>
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -42,7 +42,7 @@ private:
|
||||
|
||||
private:
|
||||
|
||||
typedef std::tr1::unordered_multimap<uint32 /*crc*/, int /*index*/> VertexIndexMap;
|
||||
typedef std::unordered_multimap<uint32 /*crc*/, int /*index*/> VertexIndexMap;
|
||||
|
||||
VectorVector * m_vertices;
|
||||
VertexIndexMap * m_indexMap;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "sharedMessageDispatch/Message.h"
|
||||
#include "sharedMessageDispatch/Receiver.h"
|
||||
#include <set>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered_map>
|
||||
|
||||
// ======================================================================
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "sharedMessageDispatch/Receiver.h"
|
||||
|
||||
#include <set>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace MessageDispatch {
|
||||
|
||||
@@ -15,8 +15,8 @@ MessageManager MessageManager::ms_instance;
|
||||
|
||||
struct MessageManager::Data
|
||||
{
|
||||
std::tr1::unordered_map<unsigned long int, std::set<Receiver *> > receivers;
|
||||
std::tr1::unordered_map<unsigned long int, std::set<void (*)(const Emitter &, const MessageBase &)> > staticCallbacks;
|
||||
std::unordered_map<unsigned long int, std::set<Receiver *> > receivers;
|
||||
std::unordered_map<unsigned long int, std::set<void (*)(const Emitter &, const MessageBase &)> > staticCallbacks;
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
@@ -72,7 +72,7 @@ void MessageManager::addReceiver(Receiver & target, const MessageBase & source)
|
||||
|
||||
void MessageManager::addReceiver(Receiver & target, const unsigned long int messageType)
|
||||
{
|
||||
std::tr1::unordered_map<unsigned long int, std::set<Receiver *> >::iterator i = data->receivers.find(messageType);
|
||||
std::unordered_map<unsigned long int, std::set<Receiver *> >::iterator i = data->receivers.find(messageType);
|
||||
if(i != data->receivers.end())
|
||||
{
|
||||
target.setHasTargets(true);
|
||||
@@ -92,7 +92,7 @@ void MessageManager::addReceiver(Receiver & target, const unsigned long int mess
|
||||
|
||||
void MessageManager::addStaticCallback(void (*callback)(const Emitter &, const MessageBase &), const unsigned long int messageType)
|
||||
{
|
||||
std::tr1::unordered_map<unsigned long int, std::set<void (*)(const Emitter &, const MessageBase &)> >::iterator f = data->staticCallbacks.find(messageType);
|
||||
std::unordered_map<unsigned long int, std::set<void (*)(const Emitter &, const MessageBase &)> >::iterator f = data->staticCallbacks.find(messageType);
|
||||
if(f != data->staticCallbacks.end())
|
||||
{
|
||||
std::set<void (*)(const Emitter &, const MessageBase &)> & targets = f->second;
|
||||
@@ -121,7 +121,7 @@ void MessageManager::addStaticCallback(void (*callback)(const Emitter &, const M
|
||||
void MessageManager::emitMessage(const Emitter & emitter, const MessageBase & message) const
|
||||
{
|
||||
const unsigned long int messageType = message.getType();
|
||||
std::tr1::unordered_map<unsigned long int, std::set<Receiver *> >::const_iterator i = data->receivers.find(messageType);
|
||||
std::unordered_map<unsigned long int, std::set<Receiver *> >::const_iterator i = data->receivers.find(messageType);
|
||||
if(i != data->receivers.end())
|
||||
{
|
||||
const std::set<Receiver *> targets = (*i).second;
|
||||
@@ -136,7 +136,7 @@ void MessageManager::emitMessage(const Emitter & emitter, const MessageBase & me
|
||||
}
|
||||
}
|
||||
|
||||
std::tr1::unordered_map<unsigned long int, std::set<void (*)(const Emitter &, const MessageBase &)> >::iterator f = data->staticCallbacks.find(messageType);
|
||||
std::unordered_map<unsigned long int, std::set<void (*)(const Emitter &, const MessageBase &)> >::iterator f = data->staticCallbacks.find(messageType);
|
||||
if(f != data->staticCallbacks.end())
|
||||
{
|
||||
const std::set<void (*)(const Emitter &, const MessageBase &)> targets = f->second;
|
||||
@@ -160,7 +160,7 @@ void MessageManager::receiverDestroyed(const Receiver & target)
|
||||
return;
|
||||
}
|
||||
// find receiver
|
||||
std::tr1::unordered_map<unsigned long int, std::set<Receiver *> >::iterator i;
|
||||
std::unordered_map<unsigned long int, std::set<Receiver *> >::iterator i;
|
||||
for(i = data->receivers.begin(); i != data->receivers.end(); ++i)
|
||||
{
|
||||
std::set<Receiver *> & targets = (*i).second;
|
||||
@@ -200,7 +200,7 @@ void MessageManager::removeReceiver(const Receiver & target, const char * const
|
||||
|
||||
void MessageManager::removeReceiver(const Receiver & target, const unsigned long int messageType)
|
||||
{
|
||||
std::tr1::unordered_map<unsigned long int, std::set<Receiver *> >::iterator i = data->receivers.find(messageType);
|
||||
std::unordered_map<unsigned long int, std::set<Receiver *> >::iterator i = data->receivers.find(messageType);
|
||||
if(i != data->receivers.end())
|
||||
{
|
||||
std::set<Receiver *> & targets = (*i).second;
|
||||
|
||||
@@ -374,7 +374,7 @@ size_t Address::hashFunction() const
|
||||
|
||||
Example:
|
||||
\code
|
||||
typedef std::tr1::unordered_map<Address, Connection *, Address::HashFunction, Address::EqualFunction> AddressMap;
|
||||
typedef std::unordered_map<Address, Connection *, Address::HashFunction, Address::EqualFunction> AddressMap;
|
||||
\endcode
|
||||
|
||||
@return true if the left hand side and right hand side are equal
|
||||
|
||||
+4
-4
@@ -13,7 +13,7 @@
|
||||
#include "sharedFoundation/CrcString.h"
|
||||
#include "sharedNetworkMessages/NetworkMessageFactory.h"
|
||||
#include <algorithm>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered_map>
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -22,7 +22,7 @@ std::string const GameNetworkMessage::NetworkVersionId = "20100225-17:43";
|
||||
|
||||
namespace GameNetworkMessageNamespace
|
||||
{
|
||||
std::tr1::unordered_map<unsigned long, int> gs_messageCount;
|
||||
std::unordered_map<unsigned long, int> gs_messageCount;
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace GameNetworkMessageNamespace
|
||||
}
|
||||
};
|
||||
|
||||
std::tr1::unordered_map<unsigned long, std::string> s_messageTypes;
|
||||
std::unordered_map<unsigned long, std::string> s_messageTypes;
|
||||
}
|
||||
|
||||
using namespace GameNetworkMessageNamespace;
|
||||
@@ -105,7 +105,7 @@ std::vector<std::pair<std::string, int> > const GameNetworkMessage::getMessageCo
|
||||
{
|
||||
std::vector<std::pair<std::string, int> > result;
|
||||
|
||||
for (std::tr1::unordered_map <unsigned long, int>::const_iterator i = gs_messageCount.begin(); i != gs_messageCount.end(); ++i)
|
||||
for (std::unordered_map <unsigned long, int>::const_iterator i = gs_messageCount.begin(); i != gs_messageCount.end(); ++i)
|
||||
result.push_back(std::make_pair(s_messageTypes[(*i).first], (*i).second));
|
||||
|
||||
std::sort(result.begin(), result.end(), SortPair());
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "sharedFoundation/NetworkId.h"
|
||||
#include "sharedObject/Object.h"
|
||||
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include "sharedDebug/InstallTimer.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
|
||||
SkillManager *SkillManager::ms_instance = NULL;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "sharedUtility/DataTableCell.h"
|
||||
|
||||
#include <map>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered_map>
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered_map>
|
||||
|
||||
class Iff;
|
||||
|
||||
@@ -84,7 +84,7 @@ private:
|
||||
void buildColumnIndexMap();
|
||||
|
||||
typedef std::vector<const DataTableColumnType *> DataTableColumnTypeVector;
|
||||
typedef std::tr1::unordered_map<std::string /*column name*/, int /*column index*/> ColumnIndexMap;
|
||||
typedef std::unordered_map<std::string /*column name*/, int /*column index*/> ColumnIndexMap;
|
||||
|
||||
int m_numRows;
|
||||
int m_numCols;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <tr1/unordered_map>
|
||||
#include <unordered_map>
|
||||
|
||||
//===================================================================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user