* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// NetDest specifies the network destination of a NetworkMessage
+// NetDest specifies the network destination of a Message
// This is backward compatible with the Set class that was previously
// used to specify network destinations.
// NetDest supports both node networks and component networks
#ifndef __MEM_RUBY_COMMON_NETDEST_HH__
#define __MEM_RUBY_COMMON_NETDEST_HH__
-#include "mem/ruby/common/Global.hh"
-#include "mem/gems_common/Vector.hh"
-#include "mem/ruby/system/NodeID.hh"
-#include "mem/ruby/system/MachineID.hh"
+#include <iostream>
+#include <vector>
+
#include "mem/ruby/common/Set.hh"
-#include "mem/protocol/MachineType.hh"
+#include "mem/ruby/common/MachineID.hh"
class NetDest
{
NetDest& operator=(const Set& obj);
~NetDest()
- {
- DEBUG_MSG(MEMORY_COMP, LowPrio, "NetDest Destructor");
- }
+ { }
void add(MachineID newElement);
void addNetDest(const NetDest& netDest);
- void addRandom();
void setNetDest(MachineType machine, const Set& set);
void remove(MachineID oldElement);
void removeNetDest(const NetDest& netDest);
void broadcast();
void broadcast(MachineType machine);
int count() const;
- bool isEqual(const NetDest& netDest);
+ bool isEqual(const NetDest& netDest) const;
// return the logical OR of this netDest and orNetDest
NetDest OR(const NetDest& orNetDest) const;
bool isEmpty() const;
// For Princeton Network
- Vector<NodeID> getAllDest();
+ std::vector<NodeID> getAllDest();
MachineID smallestElement() const;
MachineID smallestElement(MachineType machine) const;
- void setSize();
+ void resize();
int getSize() const { return m_bits.size(); }
// get element for a index
NodeID elementAt(MachineID index);
- void print(ostream& out) const;
+ void print(std::ostream& out) const;
private:
// returns a value >= MachineType_base_level("this machine")
return vec_index;
}
- NodeID
- bitIndex(NodeID index) const
- {
- return index;
- }
+ NodeID bitIndex(NodeID index) const { return index; }
- Vector <Set> m_bits; // a Vector of bit vectors - i.e. Sets
+ std::vector<Set> m_bits; // a vector of bit vectors - i.e. Sets
};
-inline ostream&
-operator<<(ostream& out, const NetDest& obj)
+inline std::ostream&
+operator<<(std::ostream& out, const NetDest& obj)
{
obj.print(out);
- out << flush;
+ out << std::flush;
return out;
}
#endif // __MEM_RUBY_COMMON_NETDEST_HH__
-