Leaked source code of windows server 2003
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.

62 lines
1.2 KiB

  1. //
  2. // QBASE.h
  3. //
  4. // This file defines CQElement - a base class for all types which
  5. // are to be used in the lockq.h and other templated queue manipulation
  6. // classes.
  7. //
  8. //
  9. #ifndef _QBASE_H_
  10. #define _QBASE_H_
  11. #include "dbgtrace.h"
  12. //-----------------------------------------------
  13. // Base Element Class
  14. //
  15. // This is the base class for Queue and stack Elements.
  16. // The various implementations of Stacks and Queues are friends.
  17. //
  18. class CQElement {
  19. public :
  20. CQElement *m_pNext ;
  21. inline CQElement( ) ;
  22. inline CQElement( CQElement* p ) ;
  23. inline ~CQElement( ) ;
  24. } ;
  25. CQElement::CQElement( ) :
  26. m_pNext( 0 ) {
  27. //
  28. // Construct a queue element - not in any list pointer must be NULL
  29. //
  30. }
  31. CQElement::~CQElement( ) {
  32. //
  33. // Destroy a queue element - next pointer must be NULL or
  34. // 0xFFFFFFFF (for lockq.h) so that we know the element is not
  35. // on a queue at destruction time and the user has properly
  36. // managed the linking and unlinking of the queue.
  37. //
  38. _ASSERT( m_pNext == 0 || m_pNext == (CQElement*)0xFFFFFFFF ) ;
  39. }
  40. CQElement::CQElement( CQElement *pIn ) :
  41. m_pNext( pIn ) {
  42. //
  43. // Constructor which sets the initial next pointer value !
  44. //
  45. }
  46. #endif // _CQUEUE_H