ulib  1.0
S.W. Lee's essential C++ library
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
ustack.h
Go to the documentation of this file.
1 
12 #ifndef ___ustack___
13 #define ___ustack___
14 
15 #include <string.h>
16 #include <stdio.h>
17 #include <stdlib.h>
18 
19 namespace ulib {
20 
30  {
31  public:
32  CUStackNode( void *arg_data, short arg_data_size );
33  public:
34  void *data;
35  short data_size;
38 
39 
40  };
41 
42 
51  class CUStack
52  {
53  public:
54  CUStack( int arg_verbose = 0);
55  ~CUStack();
56 
57  public:
58  void Verbose( int arg_verbose );
59  long GetSize();
60  bool GetTop( void *ret_data );
61  long Push( void* arg_data, short arg_data_size );
62  bool Pop( void* ret_data );
63  void Clear();
64 
65  private:
66  int verbose;
67  long size;
68  CUStackNode *head;
69  CUStackNode *top;
70  };
71 
72 }
73 
74 #endif
75