summaryrefslogtreecommitdiff
path: root/base/circlebuf.hh
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2003-11-04 17:43:41 -0500
committerNathan Binkert <binkertn@umich.edu>2003-11-04 17:43:41 -0500
commit247984bc22442c5871bc2f19285bccc730dcd578 (patch)
tree0db8e022406c1983bf5ad10d4387923b94010e3c /base/circlebuf.hh
parenta7635fa6ef488b8e44b127c40ab2a6818620145e (diff)
downloadgem5-247984bc22442c5871bc2f19285bccc730dcd578.tar.xz
A little bit of code here and there to get more access to
what the console output is. base/circlebuf.hh: base/circlebuf.cc: add stuff to spit to an ostream prepend _ in front of protected member variables formatting dev/console.hh: dev/console.cc: Add DPRINTF to spit out the lines of console data dev/console.cc: little hack to append name() to the file so that we can easily get multiple output files. dev/console.hh: TRACING_ON == 1 not defined(TRACING_ON) --HG-- extra : convert_revision : bbe80715fb97ee4c4ed6b484955ef71289f09fc9
Diffstat (limited to 'base/circlebuf.hh')
-rw-r--r--base/circlebuf.hh43
1 files changed, 23 insertions, 20 deletions
diff --git a/base/circlebuf.hh b/base/circlebuf.hh
index e0abed31c..168158bb7 100644
--- a/base/circlebuf.hh
+++ b/base/circlebuf.hh
@@ -29,31 +29,34 @@
#ifndef __CIRCLEBUF_HH__
#define __CIRCLEBUF_HH__
+#include <iosfwd>
class CircleBuf
{
-protected:
- char *buf;
- bool rollover;
- int buflen;
- int size;
- int start;
- int stop;
+ protected:
+ char *_buf;
+ bool _rollover;
+ int _buflen;
+ int _size;
+ int _start;
+ int _stop;
-public:
- explicit CircleBuf(int l);
- ~CircleBuf();
+ public:
+ explicit CircleBuf(int l);
+ ~CircleBuf();
- bool empty() { return size == 0; }
- void dump();
- void flush();
- void read(char *b, int len);
- void read(int fd, int len);
- void read(int fd);
- void readall(int fd);
- void write(char b);
- void write(const char *b);
- void write(const char *b, int len);
+ bool empty() const { return _size == 0; }
+ int size() const { return _size; }
+ void dump();
+ void flush();
+ void read(char *b, int len);
+ void read(int fd, int len);
+ void read(int fd);
+ void read(std::ostream &out);
+ void readall(int fd);
+ void write(char b);
+ void write(const char *b);
+ void write(const char *b, int len);
};
#endif // __CIRCLEBUF_HH__