Markable.hpp

Go to the documentation of this file.
00001 #ifndef wali_MARKABLE_GUARD
00002 #define wali_MARKABLE_GUARD 1
00003 
00004 /*!
00005  * @author Nicholas Kidd
00006  */
00007 
00008 #include "wali/IMarkable.hpp"
00009 
00010 namespace wali
00011 {
00012   /*!
00013    * @class Markable
00014    *
00015    * Class Markable is a mixin for worklist algorithms.
00016    * Each instantiation of Markable begins in the unmarked state.
00017    * A Markable's state may only be changed through mark() and unmark().
00018    *
00019    * @see Worklist
00020    */
00021 
00022   class Markable : public virtual IMarkable
00023   {
00024     public:
00025 
00026       /*! Creates a new Markable in the unmarked state */
00027       Markable();
00028 
00029       /*!
00030        * This copy constructor actually acts just like the default
00031        * constructor. This input Markable m is ignored. Any time a 
00032        * Markable is created it is "born" in the unmarked state.
00033        *
00034        * @param m is ignored
00035        */
00036       Markable( const Markable& m );
00037 
00038       /*!
00039        * Markable::operator= has no effect. The input is ignored.
00040        * This is because Markable specifies that state may only
00041        * be changed by mark and unmark operations.
00042        */
00043       Markable& operator=( const Markable& m );
00044 
00045       virtual ~Markable(); 
00046 
00047       /*! Mark this */
00048       virtual void mark() const throw();
00049 
00050       /*! Unmark this */
00051       virtual void unmark() const throw();
00052 
00053       /*!
00054        * Check if this is marked.
00055        *
00056        * @return true if this is marked
00057        */
00058       virtual bool marked() const throw();
00059 
00060     private:
00061       /*! bool marker : true if "this" is marked */
00062       mutable bool marker;
00063 
00064   }; // class Markable
00065 
00066 } // namespace wali
00067 
00068 #endif  // wali_MARKABLE_GUARD
00069