summaryrefslogtreecommitdiff
path: root/src/mem/ruby/slicc_interface/Message.hh
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2010-03-22 18:43:53 -0700
committerNathan Binkert <nate@binkert.org>2010-03-22 18:43:53 -0700
commit5ab13e2deb8f904ef2a233749193fa09ea7013c4 (patch)
tree07f5f02902f9e719fe58d1a9419b5a1d51f7a2ce /src/mem/ruby/slicc_interface/Message.hh
parent2620e08722b38660658d46cdb76c337db18e877c (diff)
downloadgem5-5ab13e2deb8f904ef2a233749193fa09ea7013c4.tar.xz
ruby: style pass
Diffstat (limited to 'src/mem/ruby/slicc_interface/Message.hh')
-rw-r--r--src/mem/ruby/slicc_interface/Message.hh90
1 files changed, 40 insertions, 50 deletions
diff --git a/src/mem/ruby/slicc_interface/Message.hh b/src/mem/ruby/slicc_interface/Message.hh
index fef4bdf59..d9df6f131 100644
--- a/src/mem/ruby/slicc_interface/Message.hh
+++ b/src/mem/ruby/slicc_interface/Message.hh
@@ -1,4 +1,3 @@
-
/*
* Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
* All rights reserved.
@@ -27,67 +26,58 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/*
- * $Id$
- */
-
-#ifndef MESSAGE_H
-#define MESSAGE_H
+#ifndef __MEM_RUBY_SLICC_INTERFACE_MESSAGE_HH__
+#define __MEM_RUBY_SLICC_INTERFACE_MESSAGE_HH__
#include <iostream>
-#include "mem/ruby/common/Global.hh"
#include "mem/gems_common/RefCnt.hh"
#include "mem/gems_common/RefCountable.hh"
+#include "mem/ruby/common/Global.hh"
#include "mem/ruby/eventqueue/RubyEventQueue.hh"
class Message;
typedef RefCnt<Message> MsgPtr;
-class Message : public RefCountable {
-public:
- // Constructors
- Message() : RefCountable() { m_time = g_eventQueue_ptr->getTime(); m_LastEnqueueTime = g_eventQueue_ptr->getTime(); m_DelayedCycles = 0;}
-
- // Destructor
- virtual ~Message() { }
-
- // Public Methods
- virtual Message* clone() const = 0;
- virtual void destroy() = 0;
- virtual void print(std::ostream& out) const = 0;
-
- void setDelayedCycles(const int& cycles) { m_DelayedCycles = cycles; }
- const int& getDelayedCycles() const {return m_DelayedCycles;}
- int& getDelayedCycles() {return m_DelayedCycles;}
- void setLastEnqueueTime(const Time& time) { m_LastEnqueueTime = time; }
- const Time& getLastEnqueueTime() const {return m_LastEnqueueTime;}
- Time& getLastEnqueueTime() {return m_LastEnqueueTime;}
-
- const Time& getTime() const { return m_time; }
- void setTime(const Time& new_time) { m_time = new_time; }
-private:
- // Private Methods
-
- // Data Members (m_ prefix)
- Time m_time;
- Time m_LastEnqueueTime; // my last enqueue time
- int m_DelayedCycles; // my delayed cycles
-
+class Message : public RefCountable
+{
+ public:
+ Message()
+ : RefCountable()
+ {
+ m_time = g_eventQueue_ptr->getTime();
+ m_LastEnqueueTime = g_eventQueue_ptr->getTime();
+ m_DelayedCycles = 0;
+ }
+
+ virtual ~Message() { }
+
+ virtual Message* clone() const = 0;
+ virtual void destroy() = 0;
+ virtual void print(std::ostream& out) const = 0;
+
+ void setDelayedCycles(const int& cycles) { m_DelayedCycles = cycles; }
+ const int& getDelayedCycles() const {return m_DelayedCycles;}
+ int& getDelayedCycles() {return m_DelayedCycles;}
+ void setLastEnqueueTime(const Time& time) { m_LastEnqueueTime = time; }
+ const Time& getLastEnqueueTime() const {return m_LastEnqueueTime;}
+ Time& getLastEnqueueTime() {return m_LastEnqueueTime;}
+
+ const Time& getTime() const { return m_time; }
+ void setTime(const Time& new_time) { m_time = new_time; }
+
+ private:
+ Time m_time;
+ Time m_LastEnqueueTime; // my last enqueue time
+ int m_DelayedCycles; // my delayed cycles
};
-// Output operator declaration
-std::ostream& operator<<(std::ostream& out, const Message& obj);
-
-// ******************* Definitions *******************
-
-// Output operator definition
-extern inline
-std::ostream& operator<<(std::ostream& out, const Message& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const Message& obj)
{
- obj.print(out);
- out << std::flush;
- return out;
+ obj.print(out);
+ out << std::flush;
+ return out;
}
-#endif //MESSAGE_H
+#endif // __MEM_RUBY_SLICC_INTERFACE_MESSAGE_HH__