00001 #ifndef MAKEVISITOR_H 00002 #define MAKEVISITOR_H 00003 00004 #include "string" 00005 #include "vector" 00006 #include "Any.h" 00007 00008 #define HOW_MANY_ITEMS 8 00009 00010 class ClassAndNamespace 00011 { 00012 public: 00013 static ClassAndNamespace makeIt( Any *); 00014 00015 ClassAndNamespace( const std::string& pName, const std::string& pSpace, const std::string& pStrictSpace); 00016 std::string name() const; 00017 std::string space() const; 00018 std::string strictSpace() const; 00019 std::string infoName() const; // gives back a NMSPKIND form (informative name) 00020 std::string exactType() const;// gives back a type NMPS::KIND form (exact C++ type name) 00021 private: 00022 std::string m_name; 00023 std::string m_space; 00024 std::string m_strictSpace; 00025 }; 00026 00027 class MakeVisitor 00028 { 00029 public: 00030 static std::string getVisitorName( const std::string& name) { return name + "Visitor"; } 00031 MakeVisitor( const std::string& name) { m_className = getVisitorName( name); } 00032 const std::string& getClassName() { return m_className; } 00033 00034 void addEntity( Any::KIND_TYPE , const ClassAndNamespace&); 00035 std::string dumpVisitorHeader(); 00036 std::string dumpVisitorSource(); 00037 std::string dumpSpecificMethods( const ClassAndNamespace& name); 00038 std::string dumpGenericMethods(); 00039 protected: 00040 std::vector< ClassAndNamespace > m_entities[HOW_MANY_ITEMS]; 00041 std::string m_className; 00042 }; 00043 00044 #endif // MAKEVISITOR_H