/* ========================================================================== * ÀÛ ¼º ÀÚ : À̼ø±Ô * ÀÛ ¼º ÀÏ : 2006.09.15 * ³» ¿ë : Å¥ ÅÛÇø´ * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once #include "Allocator.h" #include "Element.h" /// Å¥ /// Çѹø ´Ã¾î³­ ¿ë·®(¼ö¿ë°¡´ÉÇÑ ÃÖ´ë ¿ø¼Ò ¼ö)Àº ÁÙ¾îµéÁö ¾Ê´Â´Ù. template > class tQueue { typedef tQueue cSelf; static const unsigned int NPOS = (unsigned int)(-1); public: /* tQueue(); explicit tQueue( unsigned int capacity ); ~tQueue(); /// ¸ðµç ¿ø¼Ò¸¦ Á¦°Å void Clear(); /// ¿ë·®À» ¼³Á¤ void Reserve( unsigned int capacity ); /// ¿ø¼Ò¸¦ ¸¶Áö¸·¿¡ Ãß°¡ /// ¿ë·®À» ³Ñ¾î¼­¸é false¸¦ ¸®ÅÏÇÑ´Ù. bool PushBack( const T& val ); /// ù¹øÂ° ¿ø¼Ò¸¦ Á¦°Å /// ¿ø¼Ò°¡ Çϳªµµ ¾ø´Â °æ¿ì false¸¦ ¸®ÅÏÇÑ´Ù. bool PopFront(); /// ù¹øÂ° ¿ø¼Ò¸¦ ¸®ÅÏ T& Front(); const T& Front() const; /// ¸¶Áö¸· ¿ø¼Ò¸¦ ¸®ÅÏ T& Back(); const T& Back() const; /// ¿ø¼Ò ¼ö¸¦ ¸®ÅÏ unsigned int GetSize() const; /// ¿ë·®À» ¸®ÅÏ unsigned int GetCapacity() const; /// ºñ¾îÀÖ´ÂÁö ¿©ºÎ¸¦ ¸®ÅÏ bool IsEmpty() const; /// ¿ë·®ÀÌ ´Ù á´ÂÁö ¿©ºÎ¸¦ ¸®ÅÏ bool IsFull() const; /// ÂüÁ¶ ¿¬»êÀÚ T& operator [] ( unsigned int i ); const T& operator [] ( unsigned int i ) const; */ private: tQueue( const cSelf& other ); cSelf& operator = ( const cSelf& other ); private: unsigned int mHead; unsigned int mTail; /// ³¡ À妽º (¿ë·®) unsigned int mEnd; /// ¹öÆÛ T* mpBuffer; # include "Queue.inl" };