WitnessTrans.hpp

Go to the documentation of this file.
00001 #ifndef wali_wfa_TRANS_WITNESS_GUARD
00002 #define wali_wfa_TRANS_WITNESS_GUARD 1
00003 
00004 /*!
00005  * @author Nicholas Kidd
00006  */
00007 
00008 #include "wali/Common.hpp"
00009 #include "wali/witness/Witness.hpp"
00010 #include "wali/wfa/ITrans.hpp"
00011 #include "wali/wfa/Trans.hpp"
00012 
00013 namespace wali
00014 {
00015   namespace witness
00016   {
00017 
00018     /*!
00019      * @class WitnessTrans
00020      *
00021      * This class bears witness to the fact that a weight comes from a
00022      * transition, most likely user supplied as in the input WFA to
00023      * pre/poststar
00024      */
00025     class WitnessTrans : public Witness
00026     {
00027       public:
00028         /*!
00029          * @brief constructor
00030          *
00031          * Creates a WitnessTrans. Copies information from trans_t
00032          * excluding the weight, which it passes to its parent class
00033          * Witness. This class should be kept in sync with reference
00034          * counting of transitions, namely if it is changed that WFA
00035          * uses reference counting then the contructor should reflect
00036          * that. Local copies of the Trans object are made so that a
00037          * cycle is not created b/c cycles render reference counting
00038          * useless.
00039          *
00040          * @see Witness
00041          * @see Trans
00042          * @see sem_elem_t
00043          * @see WFA
00044          */
00045         WitnessTrans( const wfa::ITrans& t );
00046 
00047         /*!
00048          * Destructor does nothing.
00049          */
00050         ~WitnessTrans();
00051 
00052         /*!
00053          * Override Witness::accept
00054          */
00055         virtual void accept( Visitor& v, bool visitOnce=false );
00056 
00057         /*!
00058          * Overrides Witness::prettyPrint
00059          */
00060         virtual std::ostream& prettyPrint( std::ostream& o,size_t depth ) const;
00061 
00062         const wfa::Trans& getTrans() const;
00063 
00064       protected:
00065         wfa::Trans t;
00066 
00067     }; // class WitnessTrans
00068 
00069   } // namespace witness
00070 
00071 } // namespace wali
00072 
00073 #endif  // wali_wfa_TRANS_WITNESS_GUARD
00074