From 140785d24c27f3afddbe95c9e504e27bf8274290 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Wed, 10 Mar 2010 18:33:11 -0800 Subject: ruby: get rid of std-includes.hh Do not use "using namespace std;" in headers Include header files as needed --- src/mem/ruby/system/MachineID.hh | 11 +++++++---- src/mem/ruby/system/MemoryNode.cc | 2 ++ src/mem/ruby/system/MemoryNode.hh | 10 ++++++---- src/mem/ruby/system/NodeID.hh | 4 +++- src/mem/ruby/system/PseudoLRUPolicy.hh | 2 ++ 5 files changed, 20 insertions(+), 9 deletions(-) (limited to 'src/mem/ruby/system') 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 +#include + #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 + #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 + #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 + #include "mem/ruby/system/AbstractReplacementPolicy.hh" /** -- cgit v1.2.3