summaryrefslogtreecommitdiff
path: root/src/mem/ruby/common
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2010-04-02 11:20:32 -0700
committerNathan Binkert <nate@binkert.org>2010-04-02 11:20:32 -0700
commitf1c3f3044b73d890ffdfdd113b3b37ae2809d21b (patch)
tree959d71e897a8d01868c8dea8a8b225cbd1b5ce2c /src/mem/ruby/common
parentbe10204729c107b41d5d7487323c732e9fa09df5 (diff)
downloadgem5-f1c3f3044b73d890ffdfdd113b3b37ae2809d21b.tar.xz
ruby: get "using namespace" out of headers
In addition to obvious changes, this required a slight change to the slicc grammar to allow types with :: in them. Otherwise slicc barfs on std::string which we need for the headers that slicc generates.
Diffstat (limited to 'src/mem/ruby/common')
-rw-r--r--src/mem/ruby/common/Address.cc8
-rw-r--r--src/mem/ruby/common/Address.hh14
-rw-r--r--src/mem/ruby/common/Driver.hh6
-rw-r--r--src/mem/ruby/common/NetDest.cc2
-rw-r--r--src/mem/ruby/common/NetDest.hh18
-rw-r--r--src/mem/ruby/common/Set.cc2
-rw-r--r--src/mem/ruby/common/Set.hh10
-rw-r--r--src/mem/ruby/common/SubBlock.cc2
-rw-r--r--src/mem/ruby/common/SubBlock.hh10
9 files changed, 40 insertions, 32 deletions
diff --git a/src/mem/ruby/common/Address.cc b/src/mem/ruby/common/Address.cc
index e74bdb47b..2d895cc33 100644
--- a/src/mem/ruby/common/Address.cc
+++ b/src/mem/ruby/common/Address.cc
@@ -29,23 +29,23 @@
#include "mem/ruby/common/Address.hh"
void
-Address::output(ostream& out) const
+Address::output(std::ostream& out) const
{
// Note: this outputs addresses in the form "ffff", not "0xffff".
// This code should always be able to write out addresses in a
// format that can be read in by the below input() method. Please
// don't change this without talking to Milo first.
- out << hex << m_address << dec;
+ out << std::hex << m_address << std::dec;
}
void
-Address::input(istream& in)
+Address::input(std::istream& in)
{
// Note: this only works with addresses in the form "ffff", not
// "0xffff". This code should always be able to read in addresses
// written out by the above output() method. Please don't change
// this without talking to Milo first.
- in >> hex >> m_address >> dec;
+ in >> std::hex >> m_address >> std::dec;
}
Address::Address(const Address& obj)
diff --git a/src/mem/ruby/common/Address.hh b/src/mem/ruby/common/Address.hh
index c495f8d86..dc58d012f 100644
--- a/src/mem/ruby/common/Address.hh
+++ b/src/mem/ruby/common/Address.hh
@@ -98,9 +98,9 @@ class Address
Index memoryModuleIndex() const;
- void print(ostream& out) const;
- void output(ostream& out) const;
- void input(istream& in);
+ void print(std::ostream& out) const;
+ void output(std::ostream& out) const;
+ void input(std::istream& in);
void
setOffset(int offset)
@@ -128,11 +128,11 @@ operator<(const Address& obj1, const Address& obj2)
return obj1.getAddress() < obj2.getAddress();
}
-inline ostream&
-operator<<(ostream& out, const Address& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const Address& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
@@ -259,7 +259,7 @@ ADDRESS_WIDTH MEMORY_SIZE_BITS PAGE_SIZE_BITS DATA_BLOCK_BITS
}
inline void
-Address::print(ostream& out) const
+Address::print(std::ostream& out) const
{
using namespace std;
out << "[" << hex << "0x" << m_address << "," << " line 0x"
diff --git a/src/mem/ruby/common/Driver.hh b/src/mem/ruby/common/Driver.hh
index f5f2f9c58..8d687ef4f 100644
--- a/src/mem/ruby/common/Driver.hh
+++ b/src/mem/ruby/common/Driver.hh
@@ -29,6 +29,8 @@
#ifndef __MEM_RUBY_COMMON_DRIVER_HH__
#define __MEM_RUBY_COMMON_DRIVER_HH__
+#include <iostream>
+
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/Consumer.hh"
#include "mem/ruby/common/Global.hh"
@@ -51,10 +53,10 @@ class Driver
int conflict_thread) const;
virtual void printDebug(); //called by Sequencer
- virtual void printStats(ostream& out) const = 0;
+ virtual void printStats(std::ostream& out) const = 0;
virtual void clearStats() = 0;
- virtual void printConfig(ostream& out) const = 0;
+ virtual void printConfig(std::ostream& out) const = 0;
virtual integer_t readPhysicalMemory(int procID, physical_address_t addr,
int len);
diff --git a/src/mem/ruby/common/NetDest.cc b/src/mem/ruby/common/NetDest.cc
index 1edf6d1a6..f694af99b 100644
--- a/src/mem/ruby/common/NetDest.cc
+++ b/src/mem/ruby/common/NetDest.cc
@@ -260,7 +260,7 @@ NetDest::setSize()
}
void
-NetDest::print(ostream& out) const
+NetDest::print(std::ostream& out) const
{
out << "[NetDest (" << m_bits.size() << ") ";
diff --git a/src/mem/ruby/common/NetDest.hh b/src/mem/ruby/common/NetDest.hh
index 7592ad9b5..a8d0009d7 100644
--- a/src/mem/ruby/common/NetDest.hh
+++ b/src/mem/ruby/common/NetDest.hh
@@ -34,12 +34,14 @@
#ifndef __MEM_RUBY_COMMON_NETDEST_HH__
#define __MEM_RUBY_COMMON_NETDEST_HH__
-#include "mem/ruby/common/Global.hh"
+#include <iostream>
+
#include "mem/gems_common/Vector.hh"
-#include "mem/ruby/system/NodeID.hh"
-#include "mem/ruby/system/MachineID.hh"
-#include "mem/ruby/common/Set.hh"
#include "mem/protocol/MachineType.hh"
+#include "mem/ruby/common/Global.hh"
+#include "mem/ruby/common/Set.hh"
+#include "mem/ruby/system/MachineID.hh"
+#include "mem/ruby/system/NodeID.hh"
class NetDest
{
@@ -98,7 +100,7 @@ class NetDest
// get element for a index
NodeID elementAt(MachineID index);
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
// returns a value >= MachineType_base_level("this machine")
@@ -120,11 +122,11 @@ class NetDest
Vector <Set> m_bits; // a Vector of bit vectors - i.e. Sets
};
-inline ostream&
-operator<<(ostream& out, const NetDest& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const NetDest& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/common/Set.cc b/src/mem/ruby/common/Set.cc
index 55648043c..a9ced0078 100644
--- a/src/mem/ruby/common/Set.cc
+++ b/src/mem/ruby/common/Set.cc
@@ -557,7 +557,7 @@ Set& Set::operator=(const Set& obj) {
return *this;
}
-void Set::print(ostream& out) const
+void Set::print(std::ostream& out) const
{
if(m_p_nArray==NULL) {
out << "[Set {Empty}]";
diff --git a/src/mem/ruby/common/Set.hh b/src/mem/ruby/common/Set.hh
index a22da914c..d0660c6e6 100644
--- a/src/mem/ruby/common/Set.hh
+++ b/src/mem/ruby/common/Set.hh
@@ -45,6 +45,8 @@
#ifndef SET_H
#define SET_H
+#include <iostream>
+
#include "mem/ruby/system/System.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/gems_common/Vector.hh"
@@ -164,7 +166,7 @@ public:
void setBroadcast() { broadcast(); } // Deprecated
bool presentInSet(NodeID element) const { return isElement(element); } // Deprecated
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
// Private Methods
@@ -185,16 +187,16 @@ private:
};
// Output operator declaration
-ostream& operator<<(ostream& out, const Set& obj);
+std::ostream& operator<<(std::ostream& out, const Set& obj);
// ******************* Definitions *******************
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const Set& obj)
+std::ostream& operator<<(std::ostream& out, const Set& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/common/SubBlock.cc b/src/mem/ruby/common/SubBlock.cc
index 533aefbe7..5a42a415d 100644
--- a/src/mem/ruby/common/SubBlock.cc
+++ b/src/mem/ruby/common/SubBlock.cc
@@ -61,7 +61,7 @@ SubBlock::internalMergeTo(DataBlock& data) const
}
void
-SubBlock::print(ostream& out) const
+SubBlock::print(std::ostream& out) const
{
out << "[" << m_address << ", " << getSize() << ", " << m_data << "]";
}
diff --git a/src/mem/ruby/common/SubBlock.hh b/src/mem/ruby/common/SubBlock.hh
index ab286dd0e..571d45b57 100644
--- a/src/mem/ruby/common/SubBlock.hh
+++ b/src/mem/ruby/common/SubBlock.hh
@@ -29,6 +29,8 @@
#ifndef __MEM_RUBY_COMMON_SUBBLOCK_HH__
#define __MEM_RUBY_COMMON_SUBBLOCK_HH__
+#include <iostream>
+
#include "mem/gems_common/Vector.hh"
#include "mem/ruby/common/Address.hh"
#include "mem/ruby/common/DataBlock.hh"
@@ -58,7 +60,7 @@ class SubBlock
void mergeTo(DataBlock& data) const { internalMergeTo(data); }
void mergeFrom(const DataBlock& data) { internalMergeFrom(data); }
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
void internalMergeTo(DataBlock& data) const;
@@ -69,11 +71,11 @@ class SubBlock
Vector<uint8_t> m_data;
};
-inline ostream&
-operator<<(ostream& out, const SubBlock& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const SubBlock& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}