changeset 2c9823c60c8c in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=2c9823c60c8c
description:
        stats: better naming of template parameters for the wrapper stuff
        Parent and Child are bad names.  Derived and Base are better.

diffstat:

1 file changed, 25 insertions(+), 25 deletions(-)
src/base/statistics.hh |   50 ++++++++++++++++++++++++------------------------

diffs (144 lines):

diff -r 19131d568007 -r 2c9823c60c8c src/base/statistics.hh
--- a/src/base/statistics.hh    Thu Mar 05 19:09:53 2009 -0800
+++ b/src/base/statistics.hh    Thu Mar 05 19:09:53 2009 -0800
@@ -397,16 +397,16 @@
     const Info *info() const;
 };
 
-template <class Parent, class Child, template <class> class Info>
-class Wrap : public Child
+template <class Derived, class Base, template <class> class Info>
+class Wrap : public Base
 {
   public:
-    typedef Parent ParentType;
-    typedef Child ChildType;
-    typedef Info<Child> InfoType;
+    typedef Derived DerivedType;
+    typedef Base BaseType;
+    typedef Info<Base> InfoType;
 
   protected:
-    Parent &self() { return *reinterpret_cast<Parent *>(this); }
+    Derived &self() { return *reinterpret_cast<Derived *>(this); }
 
   protected:
     InfoType *
@@ -444,7 +444,7 @@
      * @param name The new name.
      * @return A reference to this stat.
      */
-    Parent &
+    Derived &
     name(const std::string &_name)
     {
         InfoType *info = this->info();
@@ -459,7 +459,7 @@
      * @param desc The new description.
      * @return A reference to this stat.
      */
-    Parent &
+    Derived &
     desc(const std::string &_desc)
     {
         this->info()->desc = _desc;
@@ -471,7 +471,7 @@
      * @param _precision The new precision
      * @return A reference to this stat.
      */
-    Parent &
+    Derived &
     precision(int _precision)
     {
         this->info()->precision = _precision;
@@ -483,7 +483,7 @@
      * @param f The new flags.
      * @return A reference to this stat.
      */
-    Parent &
+    Derived &
     flags(StatFlags _flags)
     {
         this->info()->flags |= _flags;
@@ -497,7 +497,7 @@
      * @return A reference to this stat.
      */
     template <class Stat>
-    Parent &
+    Derived &
     prereq(const Stat &prereq)
     {
         this->info()->prereq = prereq.info();
@@ -505,13 +505,13 @@
     }
 };
 
-template <class Parent, class Child, template <class Child> class Info>
-class WrapVec : public Wrap<Parent, Child, Info>
+template <class Derived, class Base, template <class Base> class Info>
+class WrapVec : public Wrap<Derived, Base, Info>
 {
   public:
-    typedef Parent ParentType;
-    typedef Child ChildType;
-    typedef Info<Child> InfoType;
+    typedef Derived DerivedType;
+    typedef Base BaseType;
+    typedef Info<Base> InfoType;
 
   public:
     // The following functions are specific to vectors.  If you use them
@@ -524,7 +524,7 @@
      * @param name The new name of the subfield.
      * @return A reference to this stat.
      */
-    Parent &
+    Derived &
     subname(off_type index, const std::string &name)
     {
         std::vector<std::string> &subn = this->info()->subnames;
@@ -541,7 +541,7 @@
      * @param desc The new description of the subfield
      * @return A reference to this stat.
      */
-    Parent &
+    Derived &
     subdesc(off_type index, const std::string &desc)
     {
         std::vector<std::string> &subd = this->info()->subdescs;
@@ -554,20 +554,20 @@
 
 };
 
-template <class Parent, class Child, template <class Child> class Info>
-class WrapVec2d : public WrapVec<Parent, Child, Info>
+template <class Derived, class Base, template <class Base> class Info>
+class WrapVec2d : public WrapVec<Derived, Base, Info>
 {
   public:
-    typedef Parent ParentType;
-    typedef Child ChildType;
-    typedef Info<Child> InfoType;
+    typedef Derived DerivedType;
+    typedef Base BaseType;
+    typedef Info<Base> InfoType;
 
   public:
     /**
      * @warning This makes the assumption that if you're gonna subnames a 2d
      * vector, you're subnaming across all y
      */
-    Parent &
+    Derived &
     ysubnames(const char **names)
     {
         InfoType *info = this->info();
@@ -577,7 +577,7 @@
         return this->self();
     }
 
-    Parent &
+    Derived &
     ysubname(off_type index, const std::string subname)
     {
         InfoType *info = this->info();
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to