Merge with head.
[gem5.git] / src / mem / mem_object.hh
index c81ea03d832fee79ca2180fa164c2a844cb1cc1e..79e555cdabfc9afe2b10baf63be12e1b1e0c9a6c 100644 (file)
 
 /**
  * @file
- * Base Memory Object decleration.
+ * Base Memory Object declaration.
  */
 
 #ifndef __MEM_MEM_OBJECT_HH__
 #define __MEM_MEM_OBJECT_HH__
 
-#include "sim/sim_object.hh"
 #include "mem/port.hh"
+#include "params/MemObject.hh"
+#include "sim/sim_object.hh"
 
 /**
  * The base MemoryObject class, allows for an accesor function to a
 class MemObject : public SimObject
 {
   public:
+    typedef MemObjectParams Params;
+    MemObject(const Params *params);
     MemObject(const std::string &name);
 
+    const Params *
+    params() const
+    {
+        return dynamic_cast<const Params *>(_params);
+    }
+
   public:
     /** Additional function to return the Port of a memory object. */
     virtual Port *getPort(const std::string &if_name, int idx = -1) = 0;
+
+    /** Tell object that this port is about to disappear, so it should remove it
+     * from any structures that it's keeping it in. */
+    virtual void deletePortRefs(Port *p) ;
 };
 
 #endif //__MEM_MEM_OBJECT_HH__