sim: Move destructor of Port to public
authorYu-hsin Wang <yuhsingw@google.com>
Fri, 3 Jan 2020 05:32:33 +0000 (13:32 +0800)
committerYu-hsin Wang <yuhsingw@google.com>
Fri, 3 Jan 2020 12:35:38 +0000 (12:35 +0000)
To preventing from instantiating an abstract class, hiding its
constructor is enough. Moving destructor to public doesn't break this
intention. This also makes us can use smart pointer to manage derived
Port class.

Change-Id: Ic9cf97e90a6c26108d359eb459df48cd23eaf15c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23925
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/sim/port.hh

index 2acdb7a7880cf2e119c105f83e359ea3019cf059..9f3268890b1963fdab7f5085b2bd51f5c444f9d4 100644 (file)
@@ -92,13 +92,13 @@ class Port
      */
     Port(const std::string& _name, PortID _id);
 
+  public:
+
     /**
      * Virtual destructor due to inheritance.
      */
     virtual ~Port();
 
-  public:
-
     /** Return a reference to this port's peer. */
     Port &getPeer() { return *_peer; }