00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _FL_PTR_STACK_H_
00023 #define _FL_PTR_STACK_H_
00024
00025 #include "Fl_Ptr_List.h"
00026
00028 class FL_API Fl_Ptr_Stack {
00029 public:
00030
00031 Fl_Ptr_Stack(int max_size=0) { max_size_ = max_size; }
00032 virtual ~Fl_Ptr_Stack() { clear(); }
00033
00034 void clear();
00035
00036 void push(void *data);
00037 void *pop();
00038 void *peek();
00039
00040 bool empty() { return (items.size()==0); }
00041 uint size() { return items.size(); }
00042
00043 uint max_size() { return max_size_; }
00044 void max_size(int m) { max_size_ = m; }
00045
00046 protected:
00047
00048 virtual void free_item(void *item);
00049
00050 void check_size();
00051 Fl_Ptr_List items;
00052 uint max_size_;
00053 };
00054
00055 #endif
00056