/* ========================================================================== * ÀÛ ¼º ÀÚ : À̼ø±Ô * ÀÛ ¼º ÀÏ : 2007.02.06 * ³» ¿ë : 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 tPointerHashSet { typedef tPointerHashSet 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: /* tPointerHashSet(); explicit tPointerHashSet( 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 ); /// ÇØ´ç °ªÀ» °¡Áö´Â ¿ø¼Ò¸¦ Á¦°Å /// Á¦°ÅµÈ ¿ø¼ÒÀÇ °³¼ö¸¦ ¸®ÅÏÇÑ´Ù. 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; /// ÁÖÀÇ: ºÎÇϸ¦ ¾ß±âÇÒ ¼ö ÀÖÀ¸¹Ç·Î Á¶½ÉÇØ¼­ »ç¿ëÇÑ´Ù. tPointerHashSet( const cSelf& other ); */ private: cSelf& operator = ( const cSelf& other ); # include "PointerHashSet.inl" }; #pragma warning( pop )