summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system/MachineID.hh
diff options
context:
space:
mode:
authorKorey Sewell <ksewell@umich.edu>2010-03-23 00:29:10 -0400
committerKorey Sewell <ksewell@umich.edu>2010-03-23 00:29:10 -0400
commitd484e1b334c6fd3f2721a2a4628c2324ed14fd08 (patch)
treec95594df5ecae29b11262967f3f8b99fca82ca5d /src/mem/ruby/system/MachineID.hh
parent70308bc835035b940efb36d7f335643dfaa39851 (diff)
parenta0651b8f6127c8b7994a165b525e93d87c470d20 (diff)
downloadgem5-d484e1b334c6fd3f2721a2a4628c2324ed14fd08.tar.xz
m5merge(2): another merge of regression stats
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__