home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / netds / winsock / dt_dll / stack.h < prev   
Text File  |  1997-09-21  |  971b  |  41 lines

  1. /*++
  2.  
  3.   Copyright (c) 1995 Intel Corp
  4.  
  5.   File Name:
  6.  
  7.     stack.h
  8.  
  9.   Abstract:
  10.  
  11.     Implements stack structure.
  12.  
  13. --*/
  14.  
  15. #ifndef _STACKH_
  16. #define _STACKH_
  17.  
  18. #include "nowarn.h"  /* turn off benign warnings */
  19. #ifndef _WINSOCKAPI_
  20. #define _WINSOCKAPI_   /* Prevent inclusion of winsock.h in windows.h */
  21. #endif
  22. #include <winsock2.h>
  23. #include "nowarn.h"  /* some warnings may have been turned back on */
  24. #include "nideque.h"
  25.  
  26. // Name:     Stack_c
  27. // Purpose:  A general purpose stack.
  28. // Context:  Can be used anywhere.
  29. template<class T> class Stack_c : private NIDeque_c<T> {
  30.  
  31.     public:
  32.                 Stack_c() : NIDeque_c<T>() {}
  33.                 ~Stack_c()       {}
  34.         inline BOOL Push(T Data) {return NIDeque_c<T>::InsertIntoFront(Data);}
  35.         inline BOOL    Pop(T &Data) {return
  36.                                   NIDeque_c<T>::RemoveFromFront(Data);}
  37.         inline BOOL IsEmpty()    {return NIDeque_c<T>::IsEmpty();}
  38. };
  39.  
  40. #endif
  41.