summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system/MachineID.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/system/MachineID.hh
parent2620e08722b38660658d46cdb76c337db18e877c (diff)
downloadgem5-5ab13e2deb8f904ef2a233749193fa09ea7013c4.tar.xz
ruby: style pass
Diffstat (limited to 'src/mem/ruby/system/MachineID.hh')
-rw-r--r--src/mem/ruby/system/MachineID.hh70
1 files changed, 29 insertions, 41 deletions
diff --git a/src/mem/ruby/system/MachineID.hh b/src/mem/ruby/system/MachineID.hh
index 9da71f349..716196248 100644
--- a/src/mem/ruby/system/MachineID.hh
+++ b/src/mem/ruby/system/MachineID.hh
@@ -1,4 +1,3 @@
-
/*
* Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
* All rights reserved.
@@ -27,66 +26,55 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/*
- * NodeID.hh
- *
- * Description:
- *
- * $Id$
- *
- */
-
-#ifndef MACHINEID_H
-#define MACHINEID_H
+#ifndef __MEM_RUBY_SYSTEM_MACHINEID_HH__
+#define __MEM_RUBY_SYSTEM_MACHINEID_HH__
#include <iostream>
#include <string>
-#include "mem/ruby/common/Global.hh"
#include "mem/gems_common/util.hh"
#include "mem/protocol/MachineType.hh"
+#include "mem/ruby/common/Global.hh"
-struct MachineID {
- MachineType type;
- int num; // range: 0 ... number of this machine's components in the system - 1
+struct MachineID
+{
+ MachineType type;
+ int num; // range: 0 ... number of this machine's components in system - 1
};
-extern inline
-std::string MachineIDToString (MachineID machine) {
- return MachineType_to_string(machine.type)+"_"+int_to_string(machine.num);
+inline std::string
+MachineIDToString(MachineID machine)
+{
+ return MachineType_to_string(machine.type)+"_"+int_to_string(machine.num);
}
-extern inline
-bool operator==(const MachineID & obj1, const MachineID & obj2)
+inline bool
+operator==(const MachineID & obj1, const MachineID & obj2)
{
- return (obj1.type == obj2.type && obj1.num == obj2.num);
+ return (obj1.type == obj2.type && obj1.num == obj2.num);
}
-extern inline
-bool operator!=(const MachineID & obj1, const MachineID & obj2)
+inline bool
+operator!=(const MachineID & obj1, const MachineID & obj2)
{
- return (obj1.type != obj2.type || obj1.num != obj2.num);
+ return (obj1.type != obj2.type || obj1.num != obj2.num);
}
// Output operator declaration
std::ostream& operator<<(std::ostream& out, const MachineID& obj);
-// ******************* Definitions *******************
-
-// Output operator definition
-extern inline
-std::ostream& operator<<(std::ostream& out, const MachineID& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const MachineID& obj)
{
- if ((obj.type < MachineType_NUM) && (obj.type >= MachineType_FIRST)) {
- out << MachineType_to_string(obj.type);
- } else {
- out << "NULL";
- }
- out << "-";
- out << obj.num;
- out << std::flush;
- return out;
+ if ((obj.type < MachineType_NUM) && (obj.type >= MachineType_FIRST)) {
+ out << MachineType_to_string(obj.type);
+ } else {
+ out << "NULL";
+ }
+ out << "-";
+ out << obj.num;
+ out << std::flush;
+ return out;
}
-
-#endif //MACHINEID_H
+#endif // __MEM_RUBY_SYSTEM_MACHINEID_HH__