RankedWorklist.hpp

Go to the documentation of this file.
00001 #ifndef wali_RANKED_WORKLIST_GUARD
00002 #define wali_RANKED_WORKLIST_GUARD 1
00003 
00004 /*!
00005  * @author Nicholas Kidd
00006  */
00007 
00008 #include "wali/Common.hpp"
00009 #include "wali/Worklist.hpp"
00010 #include "wali/wfa/Trans.hpp"
00011 #include <map>
00012 #include <set>
00013 
00014 namespace wali
00015 {
00016   class RankedWorklist : public Worklist<wfa::ITrans>
00017   {
00018     public:
00019       typedef std::multimap< int, wfa::ITrans* > pwl_t;
00020 
00021     public:
00022       RankedWorklist();
00023 
00024       virtual ~RankedWorklist();
00025 
00026       virtual bool put( wfa::ITrans *t );
00027 
00028       virtual wfa::ITrans * get();
00029 
00030       virtual bool empty() const;
00031 
00032       virtual void clear();
00033 
00034       /*
00035        * Override this to get the rank of a transition
00036        */
00037       virtual int doRankOf( sem_elem_t a ) const = 0;
00038 
00039     private:
00040       pwl_t workset;
00041 
00042       int rankOf( const wfa::ITrans* a ) const;
00043 
00044   }; // class RankedWorklist
00045 
00046 } // namespace wali
00047 
00048 #endif  // wali_RANKED_WORKLIST_GUARD
00049