summaryrefslogtreecommitdiff
path: root/src/mem/ruby/common/DataBlock.hh
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/common/DataBlock.hh
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/common/DataBlock.hh')
-rw-r--r--src/mem/ruby/common/DataBlock.hh15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mem/ruby/common/DataBlock.hh b/src/mem/ruby/common/DataBlock.hh
index d62efc72b..5407033bf 100644
--- a/src/mem/ruby/common/DataBlock.hh
+++ b/src/mem/ruby/common/DataBlock.hh
@@ -30,6 +30,9 @@
#ifndef DATABLOCK_H
#define DATABLOCK_H
+#include <iomanip>
+#include <iostream>
+
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/system/System.hh"
#include "mem/gems_common/Vector.hh"
@@ -63,7 +66,7 @@ class DataBlock {
void setData(uint8* data, int offset, int len);
void copyPartial(const DataBlock & dblk, int offset, int len);
bool equal(const DataBlock& obj) const;
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
void alloc();
@@ -73,7 +76,7 @@ private:
};
// Output operator declaration
-ostream& operator<<(ostream& out, const DataBlock& obj);
+std::ostream& operator<<(std::ostream& out, const DataBlock& obj);
bool operator==(const DataBlock& obj1, const DataBlock& obj2);
@@ -110,8 +113,10 @@ bool DataBlock::equal(const DataBlock& obj) const
}
inline
-void DataBlock::print(ostream& out) const
+void DataBlock::print(std::ostream& out) const
{
+ using namespace std;
+
int size = RubySystem::getBlockSizeBytes();
out << "[ ";
for (int i = 0; i < size; i++) {
@@ -157,10 +162,10 @@ void DataBlock::copyPartial(const DataBlock & dblk, int offset, int len)
// Output operator definition
extern inline
-ostream& operator<<(ostream& out, const DataBlock& obj)
+std::ostream& operator<<(std::ostream& out, const DataBlock& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}