Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.5 KiB

  1. //--------------------------------------------------------------------------------------------------
  2. /**
  3. @file qhList.h
  4. @author Dirk Gregorius
  5. @version 0.1
  6. @date 30/11/2011
  7. Copyright(C) 2011 by D. Gregorius. All rights reserved.
  8. */
  9. //--------------------------------------------------------------------------------------------------
  10. #pragma once
  11. //--------------------------------------------------------------------------------------------------
  12. // qhListNode
  13. //--------------------------------------------------------------------------------------------------
  14. template < typename T >
  15. void qhInsert( T* Node, T* Where );
  16. template < typename T >
  17. void qhRemove( T* Node );
  18. template < typename T >
  19. bool qhInList( T* Node );
  20. //--------------------------------------------------------------------------------------------------
  21. // qhList
  22. //--------------------------------------------------------------------------------------------------
  23. template < typename T >
  24. class qhList
  25. {
  26. public:
  27. qhList( void );
  28. int Size( void ) const;
  29. bool Empty( void ) const;
  30. void Clear( void );
  31. void PushFront( T* Node );
  32. void PopFront( void );
  33. void PushBack( T* Node );
  34. void PopBack( void );
  35. void Insert( T* Node, T* Where );
  36. void Remove( T* Node );
  37. int IndexOf( const T* Node ) const;
  38. T* Begin( void );
  39. const T* Begin( void ) const;
  40. T* End( void );
  41. const T* End( void ) const;
  42. private:
  43. T mHead;
  44. // Non-copyable
  45. qhList( const qhList< T >& );
  46. qhList< T >& operator=( const qhList< T >& );
  47. };
  48. #include "qhList.inl"