summaryrefslogtreecommitdiff
path: root/src/mem/ruby/buffers
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/buffers
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/buffers')
-rw-r--r--src/mem/ruby/buffers/MessageBuffer.hh23
-rw-r--r--src/mem/ruby/buffers/MessageBufferNode.cc3
-rw-r--r--src/mem/ruby/buffers/MessageBufferNode.hh10
3 files changed, 21 insertions, 15 deletions
diff --git a/src/mem/ruby/buffers/MessageBuffer.hh b/src/mem/ruby/buffers/MessageBuffer.hh
index 950423ee5..8d5a8de25 100644
--- a/src/mem/ruby/buffers/MessageBuffer.hh
+++ b/src/mem/ruby/buffers/MessageBuffer.hh
@@ -38,6 +38,9 @@
#ifndef MESSAGEBUFFER_H
#define MESSAGEBUFFER_H
+#include <iostream>
+#include <string>
+
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/buffers/MessageBufferNode.hh"
#include "mem/ruby/common/Consumer.hh"
@@ -49,13 +52,13 @@
class MessageBuffer {
public:
// Constructors
- MessageBuffer(const string &name = "");
+ MessageBuffer(const std::string &name = "");
// ~MessageBuffer()
// Public Methods
- static void printConfig(ostream& out) {}
+ static void printConfig(std::ostream& out) {}
void setRecycleLatency(int recycle_latency) { m_recycle_latency = recycle_latency; }
// TRUE if head of queue timestamp <= SystemTime
@@ -73,8 +76,8 @@ public:
int getPriority() { return m_priority_rank; }
void setPriority(int rank) { m_priority_rank = rank; }
void setConsumer(Consumer* consumer_ptr) { ASSERT(m_consumer_ptr==NULL); m_consumer_ptr = consumer_ptr; }
- void setDescription(const string& name) { m_name = name; }
- string getDescription() { return m_name;}
+ void setDescription(const std::string& name) { m_name = name; }
+ std::string getDescription() { return m_name;}
Consumer* getConsumer() { return m_consumer_ptr; }
@@ -102,8 +105,8 @@ public:
void clear();
- void print(ostream& out) const;
- void printStats(ostream& out);
+ void print(std::ostream& out) const;
+ void printStats(std::ostream& out);
void clearStats() { m_not_avail_count = 0; m_msg_counter = 0; }
private:
@@ -120,7 +123,7 @@ private:
// Data Members (m_ prefix)
Consumer* m_consumer_ptr; // Consumer to signal a wakeup(), can be NULL
PrioHeap<MessageBufferNode> m_prio_heap;
- string m_name;
+ std::string m_name;
int m_max_size;
int m_size;
@@ -145,16 +148,16 @@ private:
// Output operator declaration
//template <class TYPE>
-ostream& operator<<(ostream& out, const MessageBuffer& obj);
+std::ostream& operator<<(std::ostream& out, const MessageBuffer& obj);
// ******************* Definitions *******************
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const MessageBuffer& obj)
+std::ostream& operator<<(std::ostream& out, const MessageBuffer& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
diff --git a/src/mem/ruby/buffers/MessageBufferNode.cc b/src/mem/ruby/buffers/MessageBufferNode.cc
index 22b077363..aec977acd 100644
--- a/src/mem/ruby/buffers/MessageBufferNode.cc
+++ b/src/mem/ruby/buffers/MessageBufferNode.cc
@@ -29,7 +29,8 @@
#include "mem/ruby/buffers/MessageBufferNode.hh"
-void MessageBufferNode::print(ostream& out) const
+void
+MessageBufferNode::print(std::ostream& out) const
{
out << "[";
out << m_time << ", ";
diff --git a/src/mem/ruby/buffers/MessageBufferNode.hh b/src/mem/ruby/buffers/MessageBufferNode.hh
index cb64974d5..747c1d889 100644
--- a/src/mem/ruby/buffers/MessageBufferNode.hh
+++ b/src/mem/ruby/buffers/MessageBufferNode.hh
@@ -30,6 +30,8 @@
#ifndef MESSAGEBUFFERNODE_H
#define MESSAGEBUFFERNODE_H
+#include <iostream>
+
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/slicc_interface/Message.hh"
@@ -43,7 +45,7 @@ public:
//~MessageBufferNode();
// Public Methods
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
// Private Methods
@@ -59,7 +61,7 @@ public:
};
// Output operator declaration
-ostream& operator<<(ostream& out, const MessageBufferNode& obj);
+std::ostream& operator<<(std::ostream& out, const MessageBufferNode& obj);
// ******************* Definitions *******************
@@ -78,10 +80,10 @@ bool node_less_then_eq(const MessageBufferNode& n1, const MessageBufferNode& n2)
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const MessageBufferNode& obj)
+std::ostream& operator<<(std::ostream& out, const MessageBufferNode& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}