summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2010-03-10 18:33:11 -0800
committerNathan Binkert <nate@binkert.org>2010-03-10 18:33:11 -0800
commit140785d24c27f3afddbe95c9e504e27bf8274290 (patch)
treecc4d27a7d4e417a6cd0f0364cff3db67ca1825b7 /src/mem/ruby/system
parent1badec39a94397397a3c918bfcc75c71efc507ea (diff)
downloadgem5-140785d24c27f3afddbe95c9e504e27bf8274290.tar.xz
ruby: get rid of std-includes.hh
Do not use "using namespace std;" in headers Include header files as needed
Diffstat (limited to 'src/mem/ruby/system')
-rw-r--r--src/mem/ruby/system/MachineID.hh11
-rw-r--r--src/mem/ruby/system/MemoryNode.cc2
-rw-r--r--src/mem/ruby/system/MemoryNode.hh10
-rw-r--r--src/mem/ruby/system/NodeID.hh4
-rw-r--r--src/mem/ruby/system/PseudoLRUPolicy.hh2
5 files changed, 20 insertions, 9 deletions
diff --git a/src/mem/ruby/system/MachineID.hh b/src/mem/ruby/system/MachineID.hh
index 5bfa1584c..9da71f349 100644
--- a/src/mem/ruby/system/MachineID.hh
+++ b/src/mem/ruby/system/MachineID.hh
@@ -39,6 +39,9 @@
#ifndef MACHINEID_H
#define MACHINEID_H
+#include <iostream>
+#include <string>
+
#include "mem/ruby/common/Global.hh"
#include "mem/gems_common/util.hh"
#include "mem/protocol/MachineType.hh"
@@ -49,7 +52,7 @@ struct MachineID {
};
extern inline
-string MachineIDToString (MachineID machine) {
+std::string MachineIDToString (MachineID machine) {
return MachineType_to_string(machine.type)+"_"+int_to_string(machine.num);
}
@@ -66,13 +69,13 @@ bool operator!=(const MachineID & obj1, const MachineID & obj2)
}
// Output operator declaration
-ostream& operator<<(ostream& out, const MachineID& obj);
+std::ostream& operator<<(std::ostream& out, const MachineID& obj);
// ******************* Definitions *******************
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const MachineID& obj)
+std::ostream& operator<<(std::ostream& out, const MachineID& obj)
{
if ((obj.type < MachineType_NUM) && (obj.type >= MachineType_FIRST)) {
out << MachineType_to_string(obj.type);
@@ -81,7 +84,7 @@ ostream& operator<<(ostream& out, const MachineID& obj)
}
out << "-";
out << obj.num;
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/system/MemoryNode.cc b/src/mem/ruby/system/MemoryNode.cc
index 3ab3d05ef..5b74f497a 100644
--- a/src/mem/ruby/system/MemoryNode.cc
+++ b/src/mem/ruby/system/MemoryNode.cc
@@ -28,6 +28,8 @@
#include "mem/ruby/system/MemoryNode.hh"
+using namespace std;
+
void MemoryNode::print(ostream& out) const
{
out << "[";
diff --git a/src/mem/ruby/system/MemoryNode.hh b/src/mem/ruby/system/MemoryNode.hh
index 95d4227f9..d56057dee 100644
--- a/src/mem/ruby/system/MemoryNode.hh
+++ b/src/mem/ruby/system/MemoryNode.hh
@@ -28,6 +28,8 @@
#ifndef MEMORYNODE_H
#define MEMORYNODE_H
+#include <iostream>
+
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/slicc_interface/Message.hh"
#include "mem/protocol/MemoryRequestType.hh"
@@ -61,7 +63,7 @@ public:
~MemoryNode() {};
// Public Methods
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
// Data Members (m_ prefix) (all public -- this is really more a struct)
@@ -74,16 +76,16 @@ public:
};
// Output operator declaration
-ostream& operator<<(ostream& out, const MemoryNode& obj);
+std::ostream& operator<<(std::ostream& out, const MemoryNode& obj);
// ******************* Definitions *******************
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const MemoryNode& obj)
+std::ostream& operator<<(std::ostream& out, const MemoryNode& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/system/NodeID.hh b/src/mem/ruby/system/NodeID.hh
index e5d5f4d98..6191ad489 100644
--- a/src/mem/ruby/system/NodeID.hh
+++ b/src/mem/ruby/system/NodeID.hh
@@ -39,12 +39,14 @@
#ifndef NODEID_H
#define NODEID_H
+#include <string>
+
#include "mem/ruby/common/Global.hh"
#include "mem/gems_common/util.hh"
typedef int NodeID;
extern inline
-string NodeIDToString (NodeID node) { return int_to_string(node); }
+std::string NodeIDToString (NodeID node) { return int_to_string(node); }
#endif //NODEID_H
diff --git a/src/mem/ruby/system/PseudoLRUPolicy.hh b/src/mem/ruby/system/PseudoLRUPolicy.hh
index 57a0b40e9..fbbe5191a 100644
--- a/src/mem/ruby/system/PseudoLRUPolicy.hh
+++ b/src/mem/ruby/system/PseudoLRUPolicy.hh
@@ -2,6 +2,8 @@
#ifndef PSEUDOLRUPOLICY_H
#define PSEUDOLRUPOLICY_H
+#include <cmath>
+
#include "mem/ruby/system/AbstractReplacementPolicy.hh"
/**