LazyTrans.hpp

Go to the documentation of this file.
00001 #ifndef wali_wpds_LAZY_TRANS_GUARD
00002 #define wali_wpds_LAZY_TRANS_GUARD 1
00003 
00004 /*!
00005  * @author Akash Lal
00006  * @author Nicholas Kidd
00007  *
00008  */
00009 
00010 #include "wali/Common.hpp"
00011 
00012 #include "wali/wfa/DecoratorTrans.hpp"
00013 
00014 #include "wali/graph/InterGraph.hpp"
00015 
00016 #include "wali/wpds/ewpds/ETrans.hpp"
00017 
00018 struct FWPDSSourceFunctor;
00019 
00020 namespace wali
00021 {
00022   namespace wpds
00023   {
00024     class WPDS;
00025     class Config;
00026 
00027     namespace fwpds
00028     {
00029       class FWPDS;
00030 
00031       class LazyTrans : public wfa::DecoratorTrans
00032       {
00033         public:
00034           friend class WPDS;
00035 
00036         public:
00037           LazyTrans(  wali_key_t from,
00038               wali_key_t stack,
00039               wali_key_t to,
00040               sem_elem_t  se,
00041               Config *config
00042               );
00043 
00044           /*! TODO comments */
00045           LazyTrans( wfa::ITrans* delegate );
00046 
00047           /*! TODO comments */
00048           LazyTrans( wfa::ITrans* delegate, graph::InterGraphPtr igr );
00049 
00050           virtual ~LazyTrans();
00051 
00052           virtual wali::wpds::ewpds::ETrans *getETrans();
00053 
00054           virtual wfa::ITrans* copy() const;
00055           virtual wfa::ITrans* copy(Key f, Key s, Key t) const;
00056 
00057           virtual const sem_elem_t weight() const throw();
00058 
00059           virtual sem_elem_t weight() throw();              
00060 
00061           virtual void setWeight(sem_elem_t w);
00062 
00063           virtual void combineTrans( wfa::ITrans* tp );
00064 
00065           virtual TaggedWeight apply_post( TaggedWeight tw) const;
00066           virtual TaggedWeight apply_pre( TaggedWeight tw) const;
00067           virtual void applyWeightChanger(util::WeightChanger &wc);
00068 
00069           void setInterGraph(graph::InterGraphPtr igr);
00070 
00071           virtual std::ostream &print(std::ostream &o) const;
00072 
00073         private:
00074           void compute_weight() const;
00075 
00076         private:
00077           //is the delegate an ETrans?
00078           bool is_etrans; 
00079 
00080           graph::InterGraphPtr intergr;
00081       };
00082     }
00083 
00084   } // namespace wpds
00085 
00086 } // namespace wali
00087 
00088 #endif  // wali_wpds_LAZY_TRANS_GUARD
00089