summaryrefslogtreecommitdiff
path: root/src/dev/net/etherobject.hh
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2019-03-06 17:29:43 -0800
committerGabe Black <gabeblack@google.com>2019-03-15 18:12:58 +0000
commitf5ba0d66459c1c035d4613376d1d39af08e483de (patch)
tree2deb1b27c75279df5467d6035d27a0007380d01f /src/dev/net/etherobject.hh
parent94a00fb6d9270990cd04ae293556297a3c2f2563 (diff)
downloadgem5-f5ba0d66459c1c035d4613376d1d39af08e483de.tar.xz
dev: Turn EtherObject into an interface class.
This class used to drive from SimObject so that it could be derived from to get both the interface and SimObject while still using single inheritance. With this change, EtherObject is now just an interface class with only one pure virtual function which can be inherited alongside SimObject. This makes it more flexible so that it can be used in places where you might want a different inheritance hierarchy, for instance to inherit from MemObject. Change-Id: I0f07664d104eed012cf4ce6e30c416ada19505a7 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17028 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/dev/net/etherobject.hh')
-rw-r--r--src/dev/net/etherobject.hh25
1 files changed, 6 insertions, 19 deletions
diff --git a/src/dev/net/etherobject.hh b/src/dev/net/etherobject.hh
index 55cfa97e6..638c50667 100644
--- a/src/dev/net/etherobject.hh
+++ b/src/dev/net/etherobject.hh
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2007 The Regents of The University of Michigan
+ * Copyright 2019 Google, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -26,6 +27,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Authors: Ali Saidi
+ * Gabe Black
*/
/**
@@ -36,32 +38,17 @@
#ifndef __DEV_NET_ETHEROBJECT_HH__
#define __DEV_NET_ETHEROBJECT_HH__
-#include "params/EtherObject.hh"
-#include "sim/sim_object.hh"
+#include <string>
class EtherInt;
/**
- * The base EtherObject class, allows for an accesor function to a
- * simobj that returns the Port.
+ * The base EtherObject interface.
*/
-class EtherObject : public SimObject
+class EtherObject
{
public:
- typedef EtherObjectParams Params;
- EtherObject(const Params *params)
- : SimObject(params) {}
-
- const Params *
- params() const
- {
- return dynamic_cast<const Params *>(_params);
- }
-
- public:
- /** Additional function to return the Port of a memory object. */
- virtual EtherInt *getEthPort(const std::string &if_name, int idx = -1) = 0;
-
+ virtual EtherInt *getEthPort(const std::string &if_name, int idx=-1) = 0;
};
#endif // __DEV_NET_ETHEROBJECT_HH__