00001 // Copyright (C) 2007 University of Louisiana at Lafayette 00002 // Authors: Suresh Golconda 00003 00004 #ifndef CAJUN_BASIC_WORK_LIST_H 00005 #define CAJUN_BASIC_WORK_LIST_H 00006 00007 #include "wave_gc_oracle.H" 00008 #include "work_list_interface.H" 00009 00010 #include <cassert> 00011 #include <iostream> 00012 00013 00014 namespace cajun 00015 { 00016 00018 class basic_work_list_t: public work_list_interface_t 00019 { 00020 public: 00021 basic_work_list_t (); 00022 ~basic_work_list_t (); 00023 00024 void clear (); 00025 bool empty () const; 00026 public: 00027 void init_traverse (); 00028 void add (work_info_t &wi_); 00029 work_info_t *get (); 00030 void remove (work_info_t const &wi_); 00031 00032 00033 private: 00034 typedef std::vector<work_info_t> bucket_t; 00035 00036 std::vector<bucket_t *> m_bucket_list; 00037 std::vector<bucket_t *> m_free_bucket_list; 00038 00039 void alloc_buckets (unsigned max_index_); 00040 void ensure_bucket (unsigned bi_); 00041 bool next_bucket (); 00042 00043 unsigned m_bi; 00044 unsigned m_next_bi; 00045 unsigned m_ei; 00046 }; 00047 00048 }; 00049 00050 00051 00052 #endif
1.6.1