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 |
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 |
169 void print(std::ostream& out) const; |
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 |
190std::ostream& operator<<(std::ostream& out, const Set& obj); |
191 192// ******************* Definitions ******************* 193 194// Output operator definition 195extern inline |
196std::ostream& operator<<(std::ostream& out, const Set& obj) |
197{ 198 obj.print(out); |
199 out << std::flush; |
200 return out; 201} 202 203#endif //SET_H 204 |