/**************************************************************
 * 
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 * 
 *************************************************************/

#ifndef SYSTEM_STL_HASHSET
#define SYSTEM_STL_HASHSET

#ifdef HAVE_STL_INCLUDE_PATH
	// TODO: use computed include file name
	#include_next <unordered_set>
#elif defined(__cplusplus) && (__cplusplus >= 201103L)
	#include <unordered_set>
#elif defined(_MSC_VER)
	#include <../../VC/include/unordered_set>
	#define STLP4_EMUBASE_NS ::std::tr1
#else // fall back to boost/tr1
	#include <boost/tr1/tr1/unordered_set>
	#define STLP4_EMUBASE_NS ::boost
#endif


#ifndef NO_STLPORT4_EMULATION

namespace std
{
#ifdef STLP4_EMUBASE_NS
	using STLP4_EMUBASE_NS::hash;
	using STLP4_EMUBASE_NS::unordered_set;
	using STLP4_EMUBASE_NS::unordered_multiset;
	#undef STLP4_EMUBASE_NS
#endif


template<
	typename __K,
	typename __H = hash<__K>,
	typename __E = equal_to<__K> >
class hash_set
:	public unordered_set<__K,__H,__E>
{
	typedef unordered_set<__K,__H,__E> _super;
public:
	hash_set( void) {}
	hash_set( size_t n) : _super(n) {}

private:
	// setting the hasher dynamically is not supported in the emulation!
	hash_set( size_t, const __H&, const __E& rE=__E()); // not implemented
};

template<
	typename __K,
	typename __H = hash<__K>,
	typename __E = equal_to<__K> >
class hash_multiset
:	public unordered_multiset<__K,__H,__E>
{
	typedef unordered_multiset<__K,__H,__E> _super;
public:
	hash_multiset( void) {}
	hash_multiset( size_t n) : _super( n) {}

private:
	// setting the hasher dynamically is not supported in the emulation!
	hash_multiset( size_t, const __H&, const __E& rE=__E()); // not implemented
};

} // namespace std

#endif // NO_STLPORT4_EMULATION

#endif