proj home

Files   Classes   Functions   Hierarchy  

visitbase.h

Go to the documentation of this file.
00001 #ifndef VISITBASE_H
00002 #define VISITBASE_H
00003 
00004 #include <cassert>
00005 using namespace std;
00006 
00007 #include <typedefs.h>
00008 
00009 class visitbase
00010 {
00011 public:
00012 
00014   virtual boolc visit( visitbase & w ) 
00015     { return false; }
00016 
00019   boolc operator()(visitbase& x)
00020   {
00021     if( this->visit(x) )
00022       return true;
00023     return x.visit(*this);
00024   }
00025 
00026   boolc operator()(visitbase* x)
00027   {
00028     assert(x!=0);
00029 
00030     if( this->visit(*x) )
00031       return true;
00032     return x->visit(*this);
00033   }
00034 
00036   virtual ~visitbase() {}
00037 
00038 };
00039 
00040 
00041 #endif
00042 

Generated on Fri Mar 4 00:49:31 2011 for Chelton Evans Source by  doxygen 1.5.8