some std::hash_map/set -> boost::unordered_map/set changes

This commit is contained in:
Fridrich Strba
2011-02-03 14:05:04 -07:00
committed by Fridrich Štrba
parent 712fba7496
commit f8e27a7c46
9 changed files with 12 additions and 76 deletions

View File

@@ -30,7 +30,7 @@
#include <stdio.h>
#include <hash_map>
#include <boost/unordered_map.hpp>
#include <list>
#include <vector>
#include <set>
@@ -73,7 +73,7 @@ typedef ::std::list< AstUnionLabel* > LabelList;
class AstDeclaration;
typedef ::std::hash_map< ::rtl::OString, AstDeclaration*, HashString, EqualString > DeclMap;
typedef ::boost::unordered_map< ::rtl::OString, AstDeclaration*, HashString, EqualString > DeclMap;
typedef ::std::list< AstDeclaration* > DeclList;
class AstScope;

View File

@@ -31,7 +31,7 @@
#include <idlc/idlctypes.hxx>
typedef ::std::hash_map< ::rtl::OString,
typedef ::boost::unordered_map< ::rtl::OString,
::rtl::OString,
HashString,
EqualString > OptionMap;

View File

@@ -30,7 +30,7 @@
#define _REGIMPL_HXX_
#include <set>
#include <hash_map>
#include <boost/unordered_map.hpp>
#include <registry/registry.h>
#include <rtl/ustring.hxx>
@@ -168,11 +168,7 @@ private:
const rtl::OUString& sName,
sal_Int16 nSpace) const;
#ifdef USE_MSVC_HASH_MAP
typedef std::hash_map< rtl::OUString, ORegKey* > KeyMap;
#else
typedef std::hash_map< rtl::OUString, ORegKey*, rtl::OUStringHash > KeyMap;
#endif
typedef boost::unordered_map< rtl::OUString, ORegKey*, rtl::OUStringHash > KeyMap;
sal_uInt32 m_refCount;
osl::Mutex m_mutex;

View File

@@ -32,7 +32,6 @@
#include <cstdlib>
#include <iostream>
#include "preextstl.h"
#include "cppunit/CompilerOutputter.h"
#include "cppunit/TestResult.h"
#include "cppunit/TestResultCollector.h"
@@ -40,7 +39,6 @@
#include "cppunit/extensions/TestFactoryRegistry.h"
#include "cppunit/plugin/PlugInManager.h"
#include "cppunit/portability/Stream.h"
#include "postextstl.h"
#include "osl/thread.h"
#include "rtl/process.h"
#include "rtl/string.hxx"

View File

@@ -43,7 +43,7 @@
#if ! defined(_RTL_INSTANCE_HXX_)
#include "rtl/instance.hxx"
#endif
#include <hash_set>
#include <boost/unordered_set.hpp>
#include <functional>
#include <typeinfo>
@@ -96,22 +96,8 @@ struct VoidPtrHash : ::std::unary_function<void const*, ::std::size_t> {
}
};
#ifdef USE_MSVC_HASH_SET
namespace stdext
{
inline ::std::size_t hash_value( void const* p ) {
::std::size_t const d = static_cast< ::std::size_t >(
reinterpret_cast< ::std::ptrdiff_t >(p) );
return d + (d >> 3);
}
}
typedef ::std::hash_set<void const*, ::std::hash_compare<void const *>,
typedef ::boost::unordered_set<void const*, VoidPtrHash, ::std::equal_to<void const*>,
::rtl::Allocator<void const*> > VoidPointerSet;
#else
typedef ::std::hash_set<void const*, VoidPtrHash, ::std::equal_to<void const*>,
::rtl::Allocator<void const*> > VoidPointerSet;
#endif
struct ObjectRegistryData {
ObjectRegistryData( ::std::type_info const& rTypeInfo )

View File

@@ -1550,14 +1550,6 @@ inline OString OUStringToOString( const OUString & rUnicode,
} /* Namespace */
namespace stdext
{
inline size_t hash_value(const rtl::OUString &rString)
{
return rtl::OUStringHash()(rString);
}
}
#endif /* __cplusplus */
#endif /* _RTL_USTRING_HXX */

View File

@@ -36,7 +36,6 @@
#include "osl/diagnose.hxx"
#include "boost/bind.hpp"
#include <vector>
#include <algorithm>
// define own ones, independent of OSL_DEBUG_LEVEL:
#define DEBUGBASE_ENSURE_(c, f, l, m) \

View File

@@ -50,7 +50,7 @@
#include "macro.hxx"
#include <hash_map>
#include <boost/unordered_map.hpp>
#include <list>
#define MY_STRING_(x) # x
@@ -604,19 +604,10 @@ void Bootstrap_Impl::expandValue(
namespace {
struct bootstrap_map {
// map<> may be preferred here, but hash_map<> is implemented fully inline,
// thus there is no need to link against the stlport:
#ifdef USE_MSVC_HASH_MAP
typedef std::hash_map<
rtl::OUString, Bootstrap_Impl *,
std::hash_compare<rtl::OUString>,
rtl::Allocator< OUString> > t;
#else
typedef std::hash_map<
typedef boost::unordered_map<
rtl::OUString, Bootstrap_Impl *,
rtl::OUStringHash, std::equal_to< rtl::OUString >,
rtl::Allocator< OUString > > t;
#endif
// get and release must only be called properly synchronized via some mutex
// (e.g., osl::Mutex::getGlobalMutex()):

View File

@@ -32,7 +32,7 @@
#include <rtl/alloc.h>
#include <rtl/ustring.hxx>
#include <osl/mutex.hxx>
#include <hash_map>
#include <boost/unordered_map.hpp>
#include "rtl/allocator.hxx"
#include <functional>
@@ -157,30 +157,13 @@ struct hashModule
}
};
#ifdef USE_MSVC_HASH_MAP
namespace stdext
{
inline size_t hash_value( const oslModule& rkey)
{
return (size_t)rkey;
}
}
typedef std::hash_map<
oslModule,
std::pair<sal_uInt32, component_canUnloadFunc>,
std::hash_compare<oslModule>,
rtl::Allocator<oslModule>
> ModuleMap;
#else
typedef std::hash_map<
typedef boost::unordered_map<
oslModule,
std::pair<sal_uInt32, component_canUnloadFunc>,
hashModule,
std::equal_to<oslModule>,
rtl::Allocator<oslModule>
> ModuleMap;
#endif
typedef ModuleMap::iterator Mod_IT;
@@ -323,22 +306,13 @@ struct hashListener
}
};
#ifdef USE_MSVC_HASH_MAP
typedef std::hash_map<
sal_Int32,
std::pair<rtl_unloadingListenerFunc, void*>,
std::hash_compare<sal_Int32>,
rtl::Allocator<sal_Int32>
> ListenerMap;
#else
typedef std::hash_map<
typedef boost::unordered_map<
sal_Int32,
std::pair<rtl_unloadingListenerFunc, void*>,
hashListener,
std::equal_to<sal_Int32>,
rtl::Allocator<sal_Int32>
> ListenerMap;
#endif
typedef ListenerMap::iterator Lis_IT;