Set.hh (6372:f1a41ea3bbab) Set.hh (7055:4e24742201d7)
1
2/*
3 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

--- 31 unchanged lines hidden (view full) ---

40// >32 set lengths, using an array of ints w/ 32 bits/int
41
42// NOTE: Never include this file directly, this should only be
43// included from Set.hh
44
45#ifndef SET_H
46#define SET_H
47
1
2/*
3 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright

--- 31 unchanged lines hidden (view full) ---

40// >32 set lengths, using an array of ints w/ 32 bits/int
41
42// NOTE: Never include this file directly, this should only be
43// included from Set.hh
44
45#ifndef SET_H
46#define SET_H
47
48#include <iostream>
49
48#include "mem/ruby/system/System.hh"
49#include "mem/ruby/common/Global.hh"
50#include "mem/gems_common/Vector.hh"
51#include "mem/ruby/system/NodeID.hh"
52
53// gibson 05/20/05
54// enum PresenceBit {NotPresent, Present};
55

--- 103 unchanged lines hidden (view full) ---

159
160 // DEPRECATED METHODS
161 void addToSet(NodeID newElement) { add(newElement); } // Deprecated
162 void removeFromSet(NodeID newElement) { remove(newElement); } // Deprecated
163 void clearSet() { clear(); } // Deprecated
164 void setBroadcast() { broadcast(); } // Deprecated
165 bool presentInSet(NodeID element) const { return isElement(element); } // Deprecated
166
50#include "mem/ruby/system/System.hh"
51#include "mem/ruby/common/Global.hh"
52#include "mem/gems_common/Vector.hh"
53#include "mem/ruby/system/NodeID.hh"
54
55// gibson 05/20/05
56// enum PresenceBit {NotPresent, Present};
57

--- 103 unchanged lines hidden (view full) ---

161
162 // DEPRECATED METHODS
163 void addToSet(NodeID newElement) { add(newElement); } // Deprecated
164 void removeFromSet(NodeID newElement) { remove(newElement); } // Deprecated
165 void clearSet() { clear(); } // Deprecated
166 void setBroadcast() { broadcast(); } // Deprecated
167 bool presentInSet(NodeID element) const { return isElement(element); } // Deprecated
168
167 void print(ostream& out) const;
169 void print(std::ostream& out) const;
168private:
169 // Private Methods
170
171 // Data Members (m_ prefix)
172 // gibson 05/20/05
173 // Vector<uint8> m_bits; // This is an vector of uint8 to reduce the size of the set
174
175 int m_nSize; // the number of bits in this set

--- 4 unchanged lines hidden (view full) ---

180 // 64 bits if the -m64 parameter is passed to g++, which it is
181 // for an AMD opteron under our configuration
182
183 long * m_p_nArray; // an word array to hold the bits in the set
184 long m_p_nArray_Static[NUMBER_WORDS_PER_SET];
185};
186
187// Output operator declaration
170private:
171 // Private Methods
172
173 // Data Members (m_ prefix)
174 // gibson 05/20/05
175 // Vector<uint8> m_bits; // This is an vector of uint8 to reduce the size of the set
176
177 int m_nSize; // the number of bits in this set

--- 4 unchanged lines hidden (view full) ---

182 // 64 bits if the -m64 parameter is passed to g++, which it is
183 // for an AMD opteron under our configuration
184
185 long * m_p_nArray; // an word array to hold the bits in the set
186 long m_p_nArray_Static[NUMBER_WORDS_PER_SET];
187};
188
189// Output operator declaration
188ostream& operator<<(ostream& out, const Set& obj);
190std::ostream& operator<<(std::ostream& out, const Set& obj);
189
190// ******************* Definitions *******************
191
192// Output operator definition
193extern inline
191
192// ******************* Definitions *******************
193
194// Output operator definition
195extern inline
194ostream& operator<<(ostream& out, const Set& obj)
196std::ostream& operator<<(std::ostream& out, const Set& obj)
195{
196 obj.print(out);
197{
198 obj.print(out);
197 out << flush;
199 out << std::flush;
198 return out;
199}
200
201#endif //SET_H
202
200 return out;
201}
202
203#endif //SET_H
204