00001 #ifndef MODULE_INSTANCE_H_INCLUDED_ 00002 #define MODULE_INSTANCE_H_INCLUDED_ 00003 00004 #include <string> 00005 #include <vector> 00006 #include <map> 00007 00008 #include "rose.h" 00009 00010 #include "instance.h" 00011 #include "port.h" 00012 #include "object.h" 00013 00014 #include "class.h" // included for get_definition 00015 #include "module.h" // included for get_definition 00016 00017 namespace risc { 00018 00024 class ModuleInstance: public Instance { 00025 00026 public: 00027 00031 explicit ModuleInstance(SgVariableDefinition *ast_node, Module *ir_def); 00032 00037 explicit ModuleInstance(SgVariableDefinition *ast_node, Type type); 00038 00043 virtual Module* get_definition(); 00044 00049 void add_mapping(Port *port, Object *object); 00050 00056 std::string get_instance_qualified_name(); 00057 00058 std::map<Port*, Object*> mapping_; 00059 00060 private: 00061 00066 Module* module_definition_; 00067 00071 ModuleInstance(const ModuleInstance &md); 00072 }; 00073 00074 typedef std::vector<ModuleInstance*> 00075 ModuleInstanceVector; 00076 typedef std::vector<ModuleInstance*>::iterator 00077 ModuleInstanceVectorIter; 00078 typedef std::vector<ModuleInstance*>::const_iterator 00079 ModuleInstanceVectorConstIter; 00080 00081 }; // end namespace risc 00082 00083 #endif /* MODULE_INSTANCE_H_INCLUDED_ */ 00084 00085 /* ex: set softtabstop=2 tabstop=2 shiftwidth=2 expandtab: */