/* ========================================================================== * ÀÛ ¼º ÀÚ : À̼ø±Ô * ÀÛ ¼º ÀÏ : 2007.02.06 * ³» ¿ë : Æ÷ÀÎÅÍ Å¥ ÅÛÇø´ * ÁÖÀÇ»çÇ× : ³Î Æ÷ÀÎÅͰ¡ ¿ø¼Ò°¡ µÇ´Â °ÍÀ» Çã¿ëÇÏÁö ¾Ê´Â´Ù. *===========================================================================*/ #pragma once #include "Allocator.h" #include "Element.h" /// Æ÷ÀÎÅÍ Å¥ /// ³Î Æ÷ÀÎÅͰ¡ ¿ø¼Ò°¡ µÇ´Â °ÍÀ» Çã¿ëÇÏÁö ¾Ê´Â´Ù. /// Çѹø ´Ã¾î³­ ¿ë·®(¼ö¿ë°¡´ÉÇÑ ÃÖ´ë ¿ø¼Ò ¼ö)Àº ÁÙ¾îµéÁö ¾Ê´Â´Ù. template > class tPointerQueue { typedef tPointerQueue cSelf; static const unsigned int NPOS = ~(unsigned int)0; public: /* tPointerQueue(); explicit tPointerQueue( unsigned int capacity ); ~tPointerQueue(); /// ¸ðµç ¿ø¼Ò¸¦ Á¦°Å 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: tPointerQueue( const cSelf& other ); cSelf& operator = ( const cSelf& other ); private: unsigned int mHead; unsigned int mTail; /// ³¡ À妽º (¿ë·®) unsigned int mEnd; /// ¹öÆÛ T* mpBuffer; # include "PointerQueue.inl" };