From c7bd1ec261d24a5301b5349508f67e636f893ea0 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Thu, 5 Mar 2009 19:09:53 -0800 Subject: [PATCH] stats: better naming of template parameters for the wrapper stuff Parent and Child are bad names. Derived and Base are better. --- src/base/statistics.hh | 50 +++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/base/statistics.hh b/src/base/statistics.hh index 8a0079b27..30715daa3 100644 --- a/src/base/statistics.hh +++ b/src/base/statistics.hh @@ -397,16 +397,16 @@ class InfoAccess const Info *info() const; }; -template class Info> -class Wrap : public Child +template class Info> +class Wrap : public Base { public: - typedef Parent ParentType; - typedef Child ChildType; - typedef Info InfoType; + typedef Derived DerivedType; + typedef Base BaseType; + typedef Info InfoType; protected: - Parent &self() { return *reinterpret_cast(this); } + Derived &self() { return *reinterpret_cast(this); } protected: InfoType * @@ -444,7 +444,7 @@ class Wrap : public Child * @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 @@ class Wrap : public Child * @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 @@ class Wrap : public Child * @param _precision The new precision * @return A reference to this stat. */ - Parent & + Derived & precision(int _precision) { this->info()->precision = _precision; @@ -483,7 +483,7 @@ class Wrap : public Child * @param f The new flags. * @return A reference to this stat. */ - Parent & + Derived & flags(StatFlags _flags) { this->info()->flags |= _flags; @@ -497,7 +497,7 @@ class Wrap : public Child * @return A reference to this stat. */ template - Parent & + Derived & prereq(const Stat &prereq) { this->info()->prereq = prereq.info(); @@ -505,13 +505,13 @@ class Wrap : public Child } }; -template class Info> -class WrapVec : public Wrap +template class Info> +class WrapVec : public Wrap { public: - typedef Parent ParentType; - typedef Child ChildType; - typedef Info InfoType; + typedef Derived DerivedType; + typedef Base BaseType; + typedef Info InfoType; public: // The following functions are specific to vectors. If you use them @@ -524,7 +524,7 @@ class WrapVec : public Wrap * @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 &subn = this->info()->subnames; @@ -541,7 +541,7 @@ class WrapVec : public Wrap * @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 &subd = this->info()->subdescs; @@ -554,20 +554,20 @@ class WrapVec : public Wrap }; -template class Info> -class WrapVec2d : public WrapVec +template class Info> +class WrapVec2d : public WrapVec { public: - typedef Parent ParentType; - typedef Child ChildType; - typedef Info InfoType; + typedef Derived DerivedType; + typedef Base BaseType; + typedef Info 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 @@ class WrapVec2d : public WrapVec return this->self(); } - Parent & + Derived & ysubname(off_type index, const std::string subname) { InfoType *info = this->info();