/* ========================================================================== * ÀÛ ¼º ÀÚ : À̼ø±Ô * ÀÛ ¼º ÀÏ : 2006.09.11 * ³» ¿ë : std::hashtable¸¦ Æ÷ÇÔÇÑ ÇØ½Ã™V ÅÛÇø´ * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once #pragma warning( push ) #pragma warning( disable: 4267 ) #pragma warning( disable: 4311 ) //#pragma warning( disable: 4996 ) #include #include "Hasher.h" #include "Functor.h" using namespace std; /// ÇØ½Ã ™V /// Áߺ¹µÈ ۸¦ Çã¿ëÇÏÁö ¾Ê´Â´Ù. template, class EQUAL = tBinaryEqual > class tHashSet { typedef tHashSet cSelf; typedef _STLP_PRIV _HashSetTraitsT _HashSetTraits; typedef hashtable, EQUAL, allocator > cTable; public: typedef typename cTable::iterator cIterator; typedef typename cTable::const_iterator cConstIterator; typedef typename cTable::hasher cHasher; typedef typename cTable::key_equal cKeyEqual; typedef typename cTable::allocator_type cAllocatorType; private: /// ÇØ½Ã Å×À̺í cTable mTable; public: /* tHashSet(); explicit tHashSet( unsigned int hint ); /// ¸ðµç ¿ø¼ÒµéÀ» Á¦°Å void Clear(); /// ÇØ½Ã Å×À̺íÀÇ ¹öŶ Å©±â¸¦ º¯°æ void Resize( unsigned int hint ); /// µ¿ÀÏÇÑ °ª¸¦ °¡Áö´Â ¿ø¼ÒÀÇ À§Ä¡¸¦ ¸®ÅÏ cIterator Find( const T& val ); cConstIterator Find( const T& val) const; /// °ªÀ» »ðÀÔ /// ½ÇÆÐÇϸé false¸¦ ¸®ÅÏÇÑ´Ù. bool Insert( const T& val ); /// [first, last) ¹üÀ§ÀÇ ¿ø¼Ò¸¦ »ðÀÔ void Insert( const T* first, const T* last ); /// [first, last) ¹üÀ§ÀÇ ¿ø¼Ò¸¦ »ðÀÔ void Insert( cConstIterator first, cConstIterator last ); /// ÇØ´ç °ªÀ» °¡Áö´Â ¿ø¼Ò¸¦ Á¦°Å /// Á¦°ÅµÈ ¿ø¼ÒÀÇ °³¼ö¸¦ ¸®ÅÏÇÑ´Ù. unsigned int Erase( const T& val ); /// posÀ§Ä¡ÀÇ ¿ø¼Ò¸¦ Á¦°Å void Erase( cIterator pos ); /// [first, last) ¹üÀ§ÀÇ ¿ø¼ÒµéÀ» Á¦°Å void Erase( cIterator first, cIterator last ); /// ¹Ýº¹ÀÚ¸¦ ¸®ÅÏ cIterator Begin(); cConstIterator Begin() const; cIterator End(); cConstIterator End() const; /// µ¿ÀÏÇÑ °ªÀ» °¡Áö´Â ¿ø¼ÒÀÇ °³¼ö¸¦ ¸®ÅÏ unsigned int GetCount( const T& val ) const; /// ¿ø¼Ò ¼ö¸¦ ¸®ÅÏ unsigned int GetSize() const; /// ºñ¾îÀÖ´ÂÁö ¿©ºÎ¸¦ ¸®ÅÏ bool IsEmpty() const; */ /// 070208 ¿õÁÖ ÀζóÀÎ ÆÄÀÏ¿¡ ¼±¾ðµÇ¾î ÀÖ¾î ÁÖ¼®Ã³¸® Çß¾î¿ä //tHashSet( const cSelf& other ); private: cSelf& operator = ( const cSelf& other ); # include "HashSet.inl" }; #pragma warning( pop )