/* ========================================================================== * ÀÛ ¼º ÀÚ : À̼ø±Ô * ÀÛ ¼º ÀÏ : 2007.02.06 * ³» ¿ë : std::list¸¦ °¨½Ñ ¸®½ºÆ® ÅÛÇø´ * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once #pragma warning( push ) //#pragma warning( disable: 4996 ) #pragma warning( disable: 4267 ) #include using namespace std; template class tList; /// ¸®½ºÆ® template class tList : protected list { typedef list list; typedef tList cSelf; public: typedef list::iterator cIterator; typedef list::const_iterator cConstIterator; public: /* explicit tList(); explicit tList( unsigned int size ); tList( unsigned int size, const T& val ); tList( cIterator first, cIterator last ); /// ¸ðµç ¿ø¼Ò¸¦ Á¦°Å void Clear(); /// n°³ÀÇ °ªÀ» ÇÒ´ç void Assign( unsigned int n, const T& val ); /// [first, last) ¹üÀ§ÀÇ °ªÀ» ÇÒ´ç void Assign( cIterator first, cIterator last ); /// pos À§Ä¡¿¡ ¿ø¼Ò¸¦ »ðÀÔ /// »õ·Î¿î ¿ø¼ÒÀÇ À§Ä¡¸¦ ¸®ÅÏÇÑ´Ù. cIterator Insert( cIterator pos, const T& val ); /// pos À§Ä¡¿¡ [first, last) ¹üÀ§ÀÇ ¸ðµç ¿ø¼ÒµéÀ» º¹»çÇÏ¿© »ðÀÔ void Insert( cIterator pos, cIterator first, cIterator last ); /// ¸Ç ¾Õ¿¡ ¿ø¼Ò¸¦ Ãß°¡ void PushFront( const T& val ); /// ¸Ç µÚ¿¡ ¿ø¼Ò¸¦ Ãß°¡ void PushBack( const T& val ); /// pos À§Ä¡ÀÇ ¿ø¼Ò¸¦ Á¦°Å /// ´ÙÀ½ ¿ø¼ÒÀÇ À§Ä¡¸¦ ¸®ÅÏÇÑ´Ù. cIterator Erase( cIterator pos ); /// [first, last) ¹üÀ§ÀÇ ¸ðµç ¿ø¼Ò¸¦ Á¦°Å /// ´ÙÀ½ ¿ø¼ÒÀÇ À§Ä¡¸¦ ¸®ÅÏÇÑ´Ù. cIterator Erase( cIterator first, cIterator last ); /// ¸Ç ¾ÕÀÇ ¿ø¼Ò¸¦ Á¦°Å void PopFront(); /// ¸Ç ³¡ÀÇ ¿ø¼Ò¸¦ Á¦°Å void PopBack(); /// ¸®½ºÆ® otherÀÇ ¸ðµç ¿ø¼Ò¸¦ pos À§Ä¡ ¾ÕÀ¸·Î À̵¿ void Splice( cIterator pos, cSelf& other ); /// ¸®½ºÆ® otherÀÇ [first, last) ¹üÀ§ÀÇ ¸ðµç ¿ø¼Ò¸¦ pos À§Ä¡ ¾ÕÀ¸·Î À̵¿ void Splice( cIterator pos, cSelf& other, cIterator first, cIterator last ); /// ¸®½ºÆ® otherÀÇ i¿¡ ÀÖ´Â ¿ø¼Ò¸¦ pos À§Ä¡ ¾ÕÀ¸·Î À̵¿ void Splice( cIterator pos, cSelf& other, cIterator i ); /// °ªÀÌ valÀÎ ¸ðµç ¿ø¼Ò¸¦ Á¦°Å void Remove( const T& val ); /// ÇÔ¼öÀÚ op°¡ true¸¦ ¸®ÅÏÇÏ´Â ¸ðµç ¿ø¼Ò¸¦ Á¦°Å template void RemoveIf( Predicate op ); /// < ¿¬»êÀÚ¸¦ Á¤·Ä ±âÁØÀ¸·Î Á¤·Ä void Sort(); /// ÇÔ¼öÀÚ op¸¦ ±âÁØÀ¸·Î Á¤·Ä template void Sort( StrictWeakOrdering op ); /// ¹Ýº¹ÀÚ¸¦ ¸®ÅÏ cIterator Begin(); cConstIterator Begin() const; cIterator End(); cConstIterator End() const; /// ¿ø¼Ò¸¦ ¸®ÅÏ T& Front(); const T& Front() const; T& Back(); const T& Back() const; /// ¿ø¼Ò ¼ö¸¦ ¸®ÅÏ unsigned int GetSize() const; /// ºñ¾îÀÖ´ÂÁö ¿©ºÎ¸¦ ¸®ÅÏ bool IsEmpty() const; /// ÁÖÀÇ: ºÎÇϸ¦ ¾ß±âÇÒ ¼ö ÀÖÀ¸¹Ç·Î Á¶½ÉÇØ¼­ »ç¿ëÇÑ´Ù. tList( const cSelf& other ); */ private: cSelf& operator = ( const cSelf& other ); private: /// ÁÖÀÇ: ¾Æ·¡ ÇÔ¼öµéÀº »ç¿ë ºóµµ°¡ ³·°Å³ª ºÎÇϸ¦ ¾ß±âÇϹǷΠÄÄÆÄÀÏ ±ÝÁö! /// ¸ðµç ¿ø¼ÒµéÀÇ ¼ø¼­¸¦ µÚ¹Ù²Þ void Reverse(); /// °°Àº °ªÀ» °¡Áö´Â ¿¬¼ÓµÈ ¿ø¼ÒµéÀÇ Áߺ¹À» Á¦°Å /// ¿¹) 1, 2, 3, 3, 4, 3 -> 1, 2, 3, 4, 3 void Unique(); /// op°¡ true¸¦ ¸®ÅÏÇÏ´Â ¿¬¼ÓµÈ ¿ø¼ÒµéÀÇ Áߺ¹À» Á¦°Å template void Unique( BinaryPredicate op ); /// ÀÌ¹Ì Á¤·ÄµÈ µÎ ¸®½ºÆ®¸¦ ÇÔ¼öÀÚ op¸¦ ±âÁØÀ¸·Î Á¤·Ä º´ÇÕ template void Merge( cSelf& other, StrictWeakOrdering op ); # include "List.inl" }; #pragma warning( pop )