Files Classes Functions Hierarchy
00001 #ifndef VISITORPRINT_H 00002 #define VISITORPRINT_H 00003 00004 #include <element.h> 00005 #include <visitor.h> 00006 00010 template<typename T> 00011 class visitorPrint : public Visitor 00012 { 00013 T arg; 00014 visitorPrint() { assert(false); } 00015 public: 00016 00019 visitorPrint(T arg_) : arg(arg_) {} 00020 00022 void visit(ElementA & w) const { w.print(arg); } 00024 void visit(ElementB & w) const { w.print(arg); } 00025 00026 }; 00027 00028 00029 00030 #endif 00031 00032 00033 00034
1.5.8